mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-01 23:31:01 +02:00
Add POCO_VERBOSE_MESSAGES option (#1679)
Allows informational logging to be turned off. All find-related messages, warnings, errors, etc. are still always logged. The option is ON by default to preserve existing behaviour.
This commit is contained in:
parent
f8bacb47b5
commit
035177e1d2
@ -11,11 +11,15 @@ cmake_minimum_required(VERSION 3.0.0)
|
|||||||
|
|
||||||
project(Poco)
|
project(Poco)
|
||||||
|
|
||||||
|
option(POCO_VERBOSE_MESSAGES "Enable informational messages during configure" ON)
|
||||||
|
|
||||||
file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)
|
file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)
|
||||||
|
|
||||||
# Read the version information from the VERSION file
|
# Read the version information from the VERSION file
|
||||||
file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
|
file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
|
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
|
||||||
|
endif()
|
||||||
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_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_MINOR ${PACKAGE_VERSION})
|
||||||
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})
|
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})
|
||||||
@ -117,31 +121,41 @@ endif()
|
|||||||
if(POCO_STATIC)
|
if(POCO_STATIC)
|
||||||
set( LIB_MODE_DEFINITIONS -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
|
set( LIB_MODE_DEFINITIONS -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
|
||||||
set( LIB_MODE STATIC )
|
set( LIB_MODE STATIC )
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building static libraries")
|
message(STATUS "Building static libraries")
|
||||||
|
endif()
|
||||||
else(POCO_STATIC)
|
else(POCO_STATIC)
|
||||||
set( LIB_MODE SHARED )
|
set( LIB_MODE SHARED )
|
||||||
set( LIB_MODE_DEFINITIONS -DPOCO_NO_AUTOMATIC_LIBS)
|
set( LIB_MODE_DEFINITIONS -DPOCO_NO_AUTOMATIC_LIBS)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building dynamic libraries")
|
message(STATUS "Building dynamic libraries")
|
||||||
|
endif()
|
||||||
endif(POCO_STATIC)
|
endif(POCO_STATIC)
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
if (ENABLE_TESTS)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building with tests")
|
message(STATUS "Building with tests")
|
||||||
else ()
|
endif()
|
||||||
|
elseif (POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building without tests")
|
message(STATUS "Building without tests")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (ENABLE_SAMPLES)
|
if (ENABLE_SAMPLES)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building with samples")
|
message(STATUS "Building with samples")
|
||||||
else ()
|
endif()
|
||||||
|
elseif (POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building without samples")
|
message(STATUS "Building without samples")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (POCO_UNBUNDLED)
|
if (POCO_UNBUNDLED)
|
||||||
add_definitions( -DPOCO_UNBUNDLED)
|
add_definitions( -DPOCO_UNBUNDLED)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Build with using external sqlite, libz, pcre, expat ...")
|
message(STATUS "Build with using external sqlite, libz, pcre, expat ...")
|
||||||
else ()
|
endif()
|
||||||
|
elseif (POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Build with using internal copy of sqlite, libz, pcre, expat, ...")
|
message(STATUS "Build with using internal copy of sqlite, libz, pcre, expat, ...")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@ -308,7 +322,7 @@ install(
|
|||||||
# in tree build settings
|
# in tree build settings
|
||||||
#configure_file(PocoBuildTreeSettings.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PocoBuildTreeSettings.cmake @ONLY)
|
#configure_file(PocoBuildTreeSettings.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PocoBuildTreeSettings.cmake @ONLY)
|
||||||
|
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
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}")
|
||||||
|
|
||||||
@ -333,3 +347,4 @@ 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}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
endif()
|
||||||
|
@ -48,9 +48,11 @@ if(ENABLE_DATA_MYSQL)
|
|||||||
find_package(MySQL)
|
find_package(MySQL)
|
||||||
if(MYSQL_FOUND)
|
if(MYSQL_FOUND)
|
||||||
include_directories("${MYSQL_INCLUDE_DIR}")
|
include_directories("${MYSQL_INCLUDE_DIR}")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "MySQL Support Enabled")
|
message(STATUS "MySQL Support Enabled")
|
||||||
|
endif()
|
||||||
add_subdirectory( MySQL )
|
add_subdirectory( MySQL )
|
||||||
else()
|
elseif(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||||
endif(MYSQL_FOUND)
|
endif(MYSQL_FOUND)
|
||||||
endif(ENABLE_DATA_MYSQL)
|
endif(ENABLE_DATA_MYSQL)
|
||||||
@ -59,9 +61,11 @@ if(ENABLE_DATA_POSTGRESQL)
|
|||||||
find_package(PostgreSQL)
|
find_package(PostgreSQL)
|
||||||
if(POSTGRESQL_FOUND)
|
if(POSTGRESQL_FOUND)
|
||||||
include_directories("${POSTGRESQL_INCLUDE_DIR}")
|
include_directories("${POSTGRESQL_INCLUDE_DIR}")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "PostgreSQL Support Enabled")
|
message(STATUS "PostgreSQL Support Enabled")
|
||||||
|
endif()
|
||||||
add_subdirectory( PostgreSQL )
|
add_subdirectory( PostgreSQL )
|
||||||
else()
|
elseif(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library")
|
message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library")
|
||||||
endif(POSTGRESQL_FOUND)
|
endif(POSTGRESQL_FOUND)
|
||||||
endif(ENABLE_DATA_POSTGRESQL)
|
endif(ENABLE_DATA_POSTGRESQL)
|
||||||
@ -70,14 +74,18 @@ if(ENABLE_DATA_ODBC)
|
|||||||
find_package(ODBC)
|
find_package(ODBC)
|
||||||
if(WIN32 AND NOT WINCE)
|
if(WIN32 AND NOT WINCE)
|
||||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Windows native ODBC Support Enabled")
|
message(STATUS "Windows native ODBC Support Enabled")
|
||||||
|
endif()
|
||||||
add_subdirectory( ODBC )
|
add_subdirectory( ODBC )
|
||||||
else(WIN32 AND NOT WINCE)
|
else(WIN32 AND NOT WINCE)
|
||||||
if(ODBC_FOUND)
|
if(ODBC_FOUND)
|
||||||
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
|
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "ODBC Support Enabled")
|
message(STATUS "ODBC Support Enabled")
|
||||||
|
endif()
|
||||||
add_subdirectory( ODBC )
|
add_subdirectory( ODBC )
|
||||||
else()
|
elseif(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||||
endif()
|
endif()
|
||||||
endif(WIN32 AND NOT WINCE)
|
endif(WIN32 AND NOT WINCE)
|
||||||
|
@ -120,7 +120,9 @@ if(UNIX AND NOT APPLE)
|
|||||||
INCLUDE (CheckLibraryExists)
|
INCLUDE (CheckLibraryExists)
|
||||||
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
|
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
|
if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
|
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
|
||||||
|
endif()
|
||||||
else(HAVE_PTHREAD_SETAFFINITY_NP)
|
else(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
add_definitions(-DHAVE_PTHREAD_SETAFFINITY_NP)
|
add_definitions(-DHAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
@ -132,7 +134,9 @@ if(UNIX AND NOT APPLE)
|
|||||||
}" HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
}" HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||||
|
|
||||||
if(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
if(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Platform has THREE PARAM at PTHREAD_SETAFFINITY_NP")
|
message(STATUS "Platform has THREE PARAM at PTHREAD_SETAFFINITY_NP")
|
||||||
|
endif()
|
||||||
add_definitions(-DHAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
add_definitions(-DHAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||||
else(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
else(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
@ -144,7 +148,9 @@ if(UNIX AND NOT APPLE)
|
|||||||
}" HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
}" HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||||
|
|
||||||
if(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
if(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Platform has TWO PARAM at PTHREAD_SETAFFINITY_NP")
|
message(STATUS "Platform has TWO PARAM at PTHREAD_SETAFFINITY_NP")
|
||||||
|
endif()
|
||||||
add_definitions(-DHAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
add_definitions(-DHAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||||
endif(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
endif(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||||
|
|
||||||
|
@ -16,9 +16,11 @@ if(ENABLE_DATA_MYSQL)
|
|||||||
find_package(MySQL)
|
find_package(MySQL)
|
||||||
if(MYSQL_FOUND)
|
if(MYSQL_FOUND)
|
||||||
target_include_directories(${BII_BLOCK_TARGET} INTERFACE "${MYSQL_INCLUDE_DIR}")
|
target_include_directories(${BII_BLOCK_TARGET} INTERFACE "${MYSQL_INCLUDE_DIR}")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "MySQL Support Enabled")
|
message(STATUS "MySQL Support Enabled")
|
||||||
|
endif()
|
||||||
include( MySQL )
|
include( MySQL )
|
||||||
else()
|
elseif(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||||
endif(MYSQL_FOUND)
|
endif(MYSQL_FOUND)
|
||||||
endif(ENABLE_DATA_MYSQL)
|
endif(ENABLE_DATA_MYSQL)
|
||||||
@ -27,14 +29,18 @@ if(ENABLE_DATA_ODBC)
|
|||||||
find_package(ODBC)
|
find_package(ODBC)
|
||||||
if(WIN32 AND NOT WINCE)
|
if(WIN32 AND NOT WINCE)
|
||||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Windows native ODBC Support Enabled")
|
message(STATUS "Windows native ODBC Support Enabled")
|
||||||
|
endif()
|
||||||
include( ODBC )
|
include( ODBC )
|
||||||
else(WIN32 AND NOT WINCE)
|
else(WIN32 AND NOT WINCE)
|
||||||
if(ODBC_FOUND)
|
if(ODBC_FOUND)
|
||||||
target_include_directories(${BII_BLOCK_TARGET} INTERFACE "${ODBC_INCLUDE_DIRECTORIES}")
|
target_include_directories(${BII_BLOCK_TARGET} INTERFACE "${ODBC_INCLUDE_DIRECTORIES}")
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "ODBC Support Enabled")
|
message(STATUS "ODBC Support Enabled")
|
||||||
|
endif()
|
||||||
include( ODBC )
|
include( ODBC )
|
||||||
else()
|
elseif(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||||
endif()
|
endif()
|
||||||
endif(WIN32 AND NOT WINCE)
|
endif(WIN32 AND NOT WINCE)
|
||||||
|
@ -16,10 +16,14 @@ option(POCO_STATIC
|
|||||||
if(POCO_STATIC)
|
if(POCO_STATIC)
|
||||||
target_compile_definitions(${BII_BLOCK_TARGET} INTERFACE -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
|
target_compile_definitions(${BII_BLOCK_TARGET} INTERFACE -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
|
||||||
set( LIB_MODE STATIC )
|
set( LIB_MODE STATIC )
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building static libraries")
|
message(STATUS "Building static libraries")
|
||||||
|
endif()
|
||||||
else(POCO_STATIC)
|
else(POCO_STATIC)
|
||||||
set( LIB_MODE SHARED )
|
set( LIB_MODE SHARED )
|
||||||
|
if(POCO_VERBOSE_MESSAGES)
|
||||||
message(STATUS "Building dynamic libraries")
|
message(STATUS "Building dynamic libraries")
|
||||||
|
endif()
|
||||||
endif(POCO_STATIC)
|
endif(POCO_STATIC)
|
||||||
|
|
||||||
# OS Detection
|
# OS Detection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user