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)
|
if(ENABLE_DATA_POSTGRESQL)
|
||||||
find_package(PostgreSQL REQUIRED)
|
find_package(PostgreSQL REQUIRED)
|
||||||
else()
|
else()
|
||||||
find_package(PostgreSQL QUIET)
|
find_package(PostgreSQL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(POSTGRESQL_FOUND)
|
if(POSTGRESQL_FOUND)
|
||||||
@ -440,25 +440,13 @@ install(
|
|||||||
Devel
|
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 "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
|
||||||
message(STATUS "Installation target path: ${CMAKE_INSTALL_PREFIX}")
|
message(STATUS "Installation target path: ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
message(STATUS "C_FLAGS: =${CMAKE_C_FLAGS}")
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||||
message(STATUS "CMAKE_C_FLAGS_DEBUG:=${CMAKE_C_FLAGS_DEBUG}")
|
message(STATUS "[cmake] build type: ${CMAKE_BUILD_TYPE}")
|
||||||
message(STATUS "CMAKE_C_FLAGS_RELEASE:=${CMAKE_C_FLAGS_RELEASE}")
|
message(STATUS "[cmake] build with cxx flags: ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
|
||||||
message(STATUS "CMAKE_C_FLAGS_MINSIZEREL:=${CMAKE_C_FLAGS_MINSIZEREL}")
|
message(STATUS "[cmake] build with c flags: ${CMAKE_C_FLAGS_${BUILD_TYPE}} ${CMAKE_C_FLAGS}")
|
||||||
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}")
|
|
||||||
|
|
||||||
foreach(component ${Poco_COMPONENTS})
|
foreach(component ${Poco_COMPONENTS})
|
||||||
message(STATUS "Building: ${component}")
|
message(STATUS "Building: ${component}")
|
||||||
|
@ -204,6 +204,9 @@ POCO_INSTALL(Foundation)
|
|||||||
POCO_GENERATE_PACKAGE(Foundation)
|
POCO_GENERATE_PACKAGE(Foundation)
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
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(samples)
|
||||||
add_subdirectory(testsuite)
|
add_subdirectory(testsuite)
|
||||||
endif ()
|
endif ()
|
||||||
|
Loading…
Reference in New Issue
Block a user