Files
wlan-cloud-lib-poco/SQL/MySQL/CMakeLists.txt
Yegor Yefremov 6b9054dfa2 cmake: create and install pkg-config files (#2224)
* cmake: create and install pkg-config files

Automatically create and install *.pc files for selected components.

PocoFoundation.pc
PocoNet.pc
PocoUtil.pc
etc.
2018-06-12 20:42:19 +02:00

38 lines
1.2 KiB
CMake

# Sources
file(GLOB SRCS_G "src/*.cpp")
POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G})
# Headers
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( MYSQL_SRCS ${HDRS_G})
add_library(SQLMySQL ${MYSQL_SRCS} )
add_library(Poco::SQLMySQL ALIAS SQLMySQL)
set_target_properties(SQLMySQL
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
OUTPUT_NAME PocoSQLMySQL
DEFINE_SYMBOL MySQL_EXPORTS
)
target_link_libraries(SQLMySQL PUBLIC Poco::SQL ${MYSQL_LIB}) # TODO(Bjoe) Use namespace target
target_include_directories(SQLMySQL
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_compile_definitions(SQLMySQL PUBLIC THREADSAFE NO_TCL)
POCO_INSTALL(SQLMySQL)
POCO_GENERATE_PACKAGE(SQLMySQL)
if (POCO_ENABLE_TESTS)
add_subdirectory(testsuite)
endif ()
configure_file(PocoSQLMySQL.pc.in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/PocoSQLMySQL.pc @ONLY)
list(APPEND POCO_PKG_CONFIG_FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/PocoSQLMySQL.pc)
set(POCO_PKG_CONFIG_FILES ${POCO_PKG_CONFIG_FILES} PARENT_SCOPE)