mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-10-29 09:42:31 +00:00
make CMake files style (more) consistent
This commit is contained in:
337
CMakeLists.txt
337
CMakeLists.txt
@@ -4,7 +4,7 @@ project(Poco)
|
||||
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)
|
||||
# Read the version information from the VERSION file
|
||||
file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION)
|
||||
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})
|
||||
@@ -40,42 +40,42 @@ check_for_cxx14_compiler(CXX14_COMPILER)
|
||||
|
||||
# If a C++14 compiler is available, then set the appropriate flags
|
||||
if(CXX14_COMPILER)
|
||||
set (CMAKE_CXX_STANDARD 14)
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler does not support C++14." )
|
||||
message(FATAL_ERROR "Compiler does not support C++14.")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
# Include some common macros to simpilfy the Poco CMake files
|
||||
include(PocoMacros)
|
||||
|
||||
if(POCO_STATIC)
|
||||
message(WARNING "POCO_STATIC has been deprecated. Please use BUILD_SHARED_LIBS instead.")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
message(WARNING "POCO_STATIC has been deprecated. Please use BUILD_SHARED_LIBS instead.")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
else()
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
option(POCO_MT "Set to OFF|ON (default is OFF) to control build of POCO as /MT instead of /MD" OFF)
|
||||
option(ENABLE_MSVC_MP "Set to OFF|ON (default is OFF) to control parallel build of POCO with MSVC" ON)
|
||||
option(POCO_MT "Set to OFF|ON (default is OFF) to control build of POCO as /MT instead of /MD" OFF)
|
||||
option(ENABLE_MSVC_MP "Set to OFF|ON (default is OFF) to control parallel build of POCO with MSVC" ON)
|
||||
|
||||
if(BUILD_SHARED_LIBS AND POCO_MT)
|
||||
message(FATAL_ERROR "Cannot have both BUILD_SHARED_LIBS and POCO_MT")
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS AND POCO_MT)
|
||||
message(FATAL_ERROR "Cannot have both BUILD_SHARED_LIBS and POCO_MT")
|
||||
endif()
|
||||
|
||||
# allow disabling of internally built OpenSSL# (see below for details)
|
||||
# if POCO pre-built OpenSSL directory is found, and POCO_DISABLE_INTERNAL_OPENSSL=OFF,
|
||||
# the internal OpenSSL build will be used
|
||||
option(POCO_DISABLE_INTERNAL_OPENSSL "Disable internal OpensSSL binaries use" ON)
|
||||
# allow disabling of internally built OpenSSL# (see below for details)
|
||||
# if POCO pre-built OpenSSL directory is found, and POCO_DISABLE_INTERNAL_OPENSSL=OFF,
|
||||
# the internal OpenSSL build will be used
|
||||
option(POCO_DISABLE_INTERNAL_OPENSSL "Disable internal OpensSSL binaries use" ON)
|
||||
|
||||
if((NOT POCO_DISABLE_INTERNAL_OPENSSL) AND (ENABLE_NETSSL OR ENABLE_CRYPTO OR (ENABLE_DATA_MYSQL AND MINGW)))
|
||||
include(UseEmbeddedOpenSSL)
|
||||
endif()
|
||||
if((NOT POCO_DISABLE_INTERNAL_OPENSSL) AND (ENABLE_NETSSL OR ENABLE_CRYPTO OR (ENABLE_DATA_MYSQL AND MINGW)))
|
||||
include(UseEmbeddedOpenSSL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
||||
@@ -98,62 +98,62 @@ else()
|
||||
endif()
|
||||
|
||||
if(ENABLE_APACHECONNECTOR)
|
||||
find_package(APR REQUIRED)
|
||||
find_package(APR REQUIRED)
|
||||
find_package(APRUTIL REQUIRED)
|
||||
find_package(Apache2 REQUIRED)
|
||||
else()
|
||||
find_package(APR)
|
||||
find_package(APR)
|
||||
find_package(APRUTIL)
|
||||
find_package(Apache2)
|
||||
endif()
|
||||
|
||||
if(APR_FOUND AND APRUTIL_FOUND AND APACHE2_FOUND AND
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON)
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON)
|
||||
else()
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_MYSQL)
|
||||
find_package(MySQL REQUIRED)
|
||||
find_package(MySQL REQUIRED)
|
||||
else()
|
||||
find_package(MySQL)
|
||||
find_package(MySQL)
|
||||
endif()
|
||||
|
||||
if(MYSQL_FOUND)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" ON)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF)
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_POSTGRESQL)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
else()
|
||||
find_package(PostgreSQL)
|
||||
find_package(PostgreSQL)
|
||||
endif()
|
||||
|
||||
if(PostgreSQL_FOUND)
|
||||
option(ENABLE_DATA "Enable SQL" ON)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" ON)
|
||||
option(ENABLE_DATA "Enable SQL" ON)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable SQL" OFF)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" OFF)
|
||||
option(ENABLE_DATA "Enable SQL" OFF)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_ODBC)
|
||||
find_package(ODBC REQUIRED)
|
||||
find_package(ODBC REQUIRED)
|
||||
else()
|
||||
find_package(ODBC)
|
||||
find_package(ODBC)
|
||||
endif()
|
||||
|
||||
if(ODBC_FOUND)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF)
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF)
|
||||
endif()
|
||||
|
||||
# Allow enabling and disabling components
|
||||
@@ -177,23 +177,23 @@ option(ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
|
||||
option(ENABLE_PAGECOMPILER_FILE2PAGE "Enable File2Page" ON)
|
||||
|
||||
option(ENABLE_TESTS
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests & samples" OFF)
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests & samples" OFF)
|
||||
|
||||
option(POCO_UNBUNDLED
|
||||
"Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF)
|
||||
"Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
message(STATUS "Building with unittests & samples")
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
message(STATUS "Building with unittests & samples")
|
||||
else()
|
||||
message(STATUS "Building without tests & samples")
|
||||
message(STATUS "Building without tests & samples")
|
||||
endif()
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
message(STATUS "Using external sqlite, zlib, pcre, expat, ...")
|
||||
message(STATUS "Using external sqlite, zlib, pcre, expat, ...")
|
||||
else()
|
||||
message(STATUS "Using internal sqlite, zlib, pcre, expat, ...")
|
||||
message(STATUS "Using internal sqlite, zlib, pcre, expat, ...")
|
||||
endif()
|
||||
|
||||
include(DefinePlatformSpecifc)
|
||||
@@ -202,217 +202,218 @@ include(DefinePlatformSpecifc)
|
||||
set(Poco_COMPONENTS "")
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(CppUnit)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE )
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
add_subdirectory(CppUnit)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
|
||||
if(ENABLE_ZIP)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
if(ENABLE_ZIP)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_ENCODINGS_COMPILER OR ENABLE_APACHECONNECTOR)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_MONGODB OR ENABLE_REDIS)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_SQLITE OR ENABLE_DATA_MYSQL OR ENABLE_DATA_ODBC OR ENABLE_DATA_POSTGRESQL)
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA AND ENABLE_TESTS)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_NETSSL_WIN)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
endif()
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_NETSSL)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CRYPTO AND ENABLE_TESTS)
|
||||
set(ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_NET AND ENABLE_TESTS)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PDF)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_POCODOC)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_CPPPARSER ON CACHE BOOL "Enable C++ parser" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_CPPPARSER ON CACHE BOOL "Enable C++ parser" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SEVENZIP OR ENABLE_ZIP)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_UTIL AND ENABLE_TESTS)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_JWT)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_FOUNDATION)
|
||||
add_subdirectory(Foundation)
|
||||
add_subdirectory(Foundation)
|
||||
endif()
|
||||
if(ENABLE_ENCODINGS)
|
||||
add_subdirectory(Encodings)
|
||||
list(APPEND Poco_COMPONENTS "Encodings")
|
||||
add_subdirectory(Encodings)
|
||||
list(APPEND Poco_COMPONENTS "Encodings")
|
||||
endif()
|
||||
|
||||
if(ENABLE_XML)
|
||||
add_subdirectory(XML)
|
||||
list(APPEND Poco_COMPONENTS "XML")
|
||||
add_subdirectory(XML)
|
||||
list(APPEND Poco_COMPONENTS "XML")
|
||||
endif()
|
||||
|
||||
if(ENABLE_JSON)
|
||||
add_subdirectory(JSON)
|
||||
list(APPEND Poco_COMPONENTS "JSON")
|
||||
add_subdirectory(JSON)
|
||||
list(APPEND Poco_COMPONENTS "JSON")
|
||||
endif()
|
||||
|
||||
if(ENABLE_UTIL)
|
||||
add_subdirectory(Util)
|
||||
list(APPEND Poco_COMPONENTS "Util")
|
||||
add_subdirectory(Util)
|
||||
list(APPEND Poco_COMPONENTS "Util")
|
||||
endif()
|
||||
|
||||
if(ENABLE_NET)
|
||||
add_subdirectory(Net)
|
||||
list(APPEND Poco_COMPONENTS "Net")
|
||||
add_subdirectory(Net)
|
||||
list(APPEND Poco_COMPONENTS "Net")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/MongoDB AND ENABLE_MONGODB)
|
||||
add_subdirectory(MongoDB)
|
||||
list(APPEND Poco_COMPONENTS "MongoDB")
|
||||
add_subdirectory(MongoDB)
|
||||
list(APPEND Poco_COMPONENTS "MongoDB")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS)
|
||||
add_subdirectory(Redis)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
add_subdirectory(Redis)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF)
|
||||
add_subdirectory(PDF)
|
||||
list(APPEND Poco_COMPONENTS "PDF")
|
||||
add_subdirectory(PDF)
|
||||
list(APPEND Poco_COMPONENTS "PDF")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/JWT AND ENABLE_JWT)
|
||||
add_subdirectory(JWT)
|
||||
list(APPEND Poco_COMPONENTS "JWT")
|
||||
add_subdirectory(JWT)
|
||||
list(APPEND Poco_COMPONENTS "JWT")
|
||||
endif()
|
||||
|
||||
#NetSSL
|
||||
|
||||
|
||||
if(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN)
|
||||
add_subdirectory(NetSSL_Win)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_Win")
|
||||
add_subdirectory(NetSSL_Win)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_Win")
|
||||
endif(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL)
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Crypto AND ENABLE_CRYPTO)
|
||||
add_subdirectory(Crypto)
|
||||
list(APPEND Poco_COMPONENTS "Crypto")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL)
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Crypto AND ENABLE_CRYPTO)
|
||||
add_subdirectory(Crypto)
|
||||
list(APPEND Poco_COMPONENTS "Crypto")
|
||||
endif()
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Data AND ENABLE_DATA)
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/SevenZip AND ENABLE_SEVENZIP)
|
||||
add_subdirectory(SevenZip)
|
||||
list(APPEND Poco_COMPONENTS "SevenZip")
|
||||
add_subdirectory(SevenZip)
|
||||
list(APPEND Poco_COMPONENTS "SevenZip")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Zip AND ENABLE_ZIP)
|
||||
add_subdirectory(Zip)
|
||||
list(APPEND Poco_COMPONENTS "Zip")
|
||||
add_subdirectory(Zip)
|
||||
list(APPEND Poco_COMPONENTS "Zip")
|
||||
endif()
|
||||
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND AND
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
add_subdirectory(ApacheConnector)
|
||||
list(APPEND Poco_COMPONENTS "ApacheConnector")
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
add_subdirectory(ApacheConnector)
|
||||
list(APPEND Poco_COMPONENTS "ApacheConnector")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/CppParser AND ENABLE_CPPPARSER)
|
||||
add_subdirectory(CppParser)
|
||||
list(APPEND Poco_COMPONENTS "CppParser")
|
||||
add_subdirectory(CppParser)
|
||||
list(APPEND Poco_COMPONENTS "CppParser")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PocoDoc AND ENABLE_POCODOC)
|
||||
add_subdirectory(PocoDoc)
|
||||
list(APPEND Poco_COMPONENTS "PocoDoc")
|
||||
add_subdirectory(PocoDoc)
|
||||
list(APPEND Poco_COMPONENTS "PocoDoc")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler AND ENABLE_PAGECOMPILER)
|
||||
add_subdirectory(PageCompiler)
|
||||
list(APPEND Poco_COMPONENTS "PageCompiler")
|
||||
add_subdirectory(PageCompiler)
|
||||
list(APPEND Poco_COMPONENTS "PageCompiler")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler/File2Page AND ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
add_subdirectory(PageCompiler/File2Page)
|
||||
list(APPEND Poco_COMPONENTS "File2Page")
|
||||
add_subdirectory(PageCompiler/File2Page)
|
||||
list(APPEND Poco_COMPONENTS "File2Page")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Encodings/Compiler AND ENABLE_ENCODINGS_COMPILER)
|
||||
add_subdirectory(Encodings/Compiler)
|
||||
list(APPEND Poco_COMPONENTS "EncodingsCompiler")
|
||||
add_subdirectory(Encodings/Compiler)
|
||||
list(APPEND Poco_COMPONENTS "EncodingsCompiler")
|
||||
endif()
|
||||
|
||||
|
||||
#############################################################
|
||||
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
)
|
||||
|
||||
#############################################################
|
||||
# Enable packaging
|
||||
@@ -432,38 +433,38 @@ include(CPack)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
# Set config script install location in a location that find_package() will
|
||||
# look for, which is different on MS Windows than for UNIX
|
||||
# Note: also set in POCO_GENERATE_PACKAGE macro in cmake/PocoMacros.cmake
|
||||
if (WIN32)
|
||||
set(PocoConfigPackageLocation "cmake")
|
||||
if(WIN32)
|
||||
set(PocoConfigPackageLocation "cmake")
|
||||
else()
|
||||
set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}")
|
||||
set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
configure_file(cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" @ONLY)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake
|
||||
DESTINATION
|
||||
"lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}"
|
||||
COMPONENT
|
||||
Devel
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake
|
||||
DESTINATION
|
||||
"lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}"
|
||||
COMPONENT
|
||||
Devel
|
||||
)
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
install(FILES cmake/FindPCRE.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}")
|
||||
install(FILES cmake/V39/FindEXPAT.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V39")
|
||||
install(FILES cmake/V313/FindSQLite3.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V313")
|
||||
install(FILES cmake/FindPCRE.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}")
|
||||
install(FILES cmake/V39/FindEXPAT.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V39")
|
||||
install(FILES cmake/V313/FindSQLite3.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V313")
|
||||
endif()
|
||||
|
||||
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
|
||||
@@ -475,16 +476,16 @@ else()
|
||||
endif()
|
||||
message(STATUS "[cmake] Installation target path: ${CMAKE_INSTALL_PREFIX}")
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
message(STATUS "[cmake] Use toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
||||
message(STATUS "[cmake] Use toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
||||
endif()
|
||||
message(STATUS "[cmake] Bulid for OS type: ${CMAKE_SYSTEM_NAME}")
|
||||
message(STATUS "[cmake] Build for OS version: ${CMAKE_SYSTEM_VERSION}")
|
||||
message(STATUS "[cmake] Build for CPU type: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(STATUS "[cmake] Build type: ${CMAKE_BUILD_TYPE}")
|
||||
message(STATUS "[cmake] Bulid for OS type: ${CMAKE_SYSTEM_NAME}")
|
||||
message(STATUS "[cmake] Build for OS version: ${CMAKE_SYSTEM_VERSION}")
|
||||
message(STATUS "[cmake] Build for CPU type: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(STATUS "[cmake] Build type: ${CMAKE_BUILD_TYPE}")
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" 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}")
|
||||
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}")
|
||||
message(STATUS "Building: ${component}")
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user