mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
Fix static build in cmake (#2455)
* Fix cmake build issue when poco build as static lib with enabled tests * Cleanup compile flags output in cmake * Some minor improvements in cmake
This commit is contained in:
parent
d292d65ca8
commit
a7f9ebe116
@ -112,7 +112,7 @@ endif()
|
||||
if(ENABLE_DATA_POSTGRESQL)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
else()
|
||||
find_package(PostgreSQL QUIET)
|
||||
find_package(PostgreSQL)
|
||||
endif()
|
||||
|
||||
if(POSTGRESQL_FOUND)
|
||||
@ -440,25 +440,13 @@ install(
|
||||
Devel
|
||||
)
|
||||
|
||||
# in tree build settings
|
||||
#configure_file(PocoBuildTreeSettings.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PocoBuildTreeSettings.cmake @ONLY)
|
||||
|
||||
|
||||
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
|
||||
message(STATUS "Installation target path: ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
message(STATUS "C_FLAGS: =${CMAKE_C_FLAGS}")
|
||||
message(STATUS "CMAKE_C_FLAGS_DEBUG:=${CMAKE_C_FLAGS_DEBUG}")
|
||||
message(STATUS "CMAKE_C_FLAGS_RELEASE:=${CMAKE_C_FLAGS_RELEASE}")
|
||||
message(STATUS "CMAKE_C_FLAGS_MINSIZEREL:=${CMAKE_C_FLAGS_MINSIZEREL}")
|
||||
message(STATUS "CMAKE_C_FLAGS_RELWITHDEBINFO:=${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
message(STATUS "")
|
||||
message(STATUS "")
|
||||
message(STATUS "CXX_FLAGS:=${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_DEBUG:=${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_RELEASE:=${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL:=${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO:=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
message(STATUS "[cmake] build type: ${CMAKE_BUILD_TYPE}")
|
||||
message(STATUS "[cmake] build with cxx flags: ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "[cmake] build with c flags: ${CMAKE_C_FLAGS_${BUILD_TYPE}} ${CMAKE_C_FLAGS}")
|
||||
|
||||
foreach(component ${Poco_COMPONENTS})
|
||||
message(STATUS "Building: ${component}")
|
||||
|
@ -204,6 +204,9 @@ POCO_INSTALL(Foundation)
|
||||
POCO_GENERATE_PACKAGE(Foundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if(POCO_STATIC)
|
||||
set_property(TARGET Foundation PROPERTY POSITION_INDEPENDENT_CODE ON) # This is needed to build TestLibrary.so as shared.
|
||||
endif()
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
Loading…
Reference in New Issue
Block a user