julp / cmakexfind Goto Github PK
View Code? Open in Web Editor NEW[CMake] [BSD-2] CMake extra find packages
[CMake] [BSD-2] CMake extra find packages
The copyright headers in each of these modules make reference to "the OSI-approved BSD License", however the OSI has approved both the 2-clause and the 3-clause BSD license.
Since this is an interpreted build-tool plugin and not linked with nor distributed with the resulting executable, it probably doesn't make a difference from a compliance stand-point (IANAL). However, clarity in licensing is important.
Please forgive me for my poor English.
I have installed MySQL 8.0 and MinGW-w64 in Windows 10. I tried to use the FindMySQL.cmake file to link MySQL C API like this:
SET (CMAKE_CXX_STANDARD 17)
SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
FIND_PACKAGE (MySQL REQUIRED)
AUX_SOURCE_DIRECTORY (src DIR_SRCS)
ADD_EXECUTABLE (${PROJECT_NAME} ${DIR_SRCS})
INCLUDE_DIRECTORIES (
${PROJECT_SOURCE_DIR}/headers
${MYSQL_INCLUDE_DIRS}
)
TARGET_LINK_LIBRARIES (${PROJECT_NAME} ${MYSQL_LIBRARIES})
But it didn't work. So I modified FindMySQL.cmake from line 110 to line 135 like this:
if(WIN32) # MSVC
include(SelectLibraryConfigurations)
# "On Windows, the static library is mysqlclient.lib and the dynamic library is libmysql.dll. Windows distributions also include libmysql.lib, a static import library needed for using the dynamic library."
#set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "mysqld mysqlclientd")
#set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "mysql mysqlclient")
set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "mysql")
set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "mysql")
find_library(
${MYSQL_PUBLIC_VAR_NS}_LIBRARY_RELEASE
NAMES ${${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
DOC "Release library for mysqlclient"
)
find_library(
${MYSQL_PUBLIC_VAR_NS}_LIBRARY_DEBUG
NAMES ${${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
DOC "Debug library for mysqlclient"
)
select_library_configurations("${MYSQL_PUBLIC_VAR_NS}")
else(WIN32) # MSVC
# "On Unix (and Unix-like) sytems, the static library is libmysqlclient.a. The dynamic library is libmysqlclient.so on most Unix systems and libmysqlclient.dylib on OS X."
find_library(
${MYSQL_PUBLIC_VAR_NS}_LIBRARY
NAMES mysqlclient
PATHS ${${PC_MYSQL_PRIVATE_VAR_NS}_LIBRARY_DIRS} ${${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_LIBRARY_DIR}
)
endif(WIN32) # MSVC
and it worked well. I guess that it is because of the version of MySQL that caused this problem.
I think CMakeXFind is a fantastic project and I hope it will be better in the future.
Best wishes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.