mirror of
https://github.com/pocoproject/poco.git
synced 2025-12-24 14:19:08 +01:00
CMake: Create PocoConfig.cmake to make importable from other CMake projects
The generated PocoConfig.cmake can be used by other CMake projects using find_package.
This commit is contained in:
@@ -8,12 +8,18 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAME}
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
PROPERTIES
|
||||
VERSION "1" SOVERSION "1"
|
||||
DEFINE_SYMBOL CppUnit_EXPORTS)
|
||||
target_link_libraries( ${LIBNAME} )
|
||||
target_link_libraries( "${LIBNAME}" )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
add_subdirectory(WinTestRunner)
|
||||
|
||||
@@ -13,15 +13,21 @@ POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G})
|
||||
|
||||
# TODO: Is this flag always required?
|
||||
add_definitions("-D_AFXDLL")
|
||||
#TODO: Use instead of the flag above: find_package(MFC)
|
||||
|
||||
include_directories( "src" )
|
||||
|
||||
add_library( ${LIBNAME} ${LIB_MODE} ${WIN_SRCS} )
|
||||
set_target_properties( ${LIBNAME}
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${WIN_SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
PROPERTIES
|
||||
VERSION "1" SOVERSION "1"
|
||||
DEFINE_SYMBOL WinTestRunner_EXPORTS)
|
||||
target_link_libraries( ${LIBNAME} CppUnit )
|
||||
target_link_libraries( "${LIBNAME}" CppUnit )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries( ${LIBNAME} winmm )
|
||||
endif(WIN32)
|
||||
|
||||
Reference in New Issue
Block a user