Coder Social home page Coder Social logo

cmakexfind's People

Contributors

julp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cmakexfind's Issues

Clarify Copyright License

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.

FindMySQL.cmake Module Cannot Find Correct Library in Windows

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.