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:
Pascal Bach
2014-10-09 13:42:51 +02:00
parent c5ffa2629d
commit b69fafb84c
39 changed files with 677 additions and 166 deletions

View File

@@ -8,14 +8,18 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
include_directories( "include" )
add_library( ${LIBNAME} SHARED ${SRCS} )
set_target_properties( ${LIBNAME}
add_library( "${LIBNAME}" SHARED ${SRCS} )
set_target_properties( "${LIBNAME}"
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
DEFINE_SYMBOL ApacheHandlers_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 (ENABLE_TESTS)
add_subdirectory(samples)