From 7a8e6b7fcee6aee0a84eb269208a553d41917565 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Wed, 25 Apr 2018 16:51:28 -0700 Subject: [PATCH 01/13] Always append 'd' suffix to Debug libraries --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7891bbe..0d47533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ function(get_poco) -DENABLE_UTIL:BOOL=OFF -DENABLE_XML:BOOL=OFF -DENABLE_ZIP:BOOL=OFF + -DCMAKE_Debug_POSTFIX=d -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} ${extra_cmake_args} -Wno-dev From 1ef7ce05ceb065d96765d0373094ae88b1320874 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 26 Apr 2018 07:41:28 -0700 Subject: [PATCH 02/13] ALL CAPS CONFIG --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d47533..a648c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ function(get_poco) -DENABLE_UTIL:BOOL=OFF -DENABLE_XML:BOOL=OFF -DENABLE_ZIP:BOOL=OFF - -DCMAKE_Debug_POSTFIX=d + -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} ${extra_cmake_args} -Wno-dev From 690047ca120f80e667a959f96e875ad49e506534 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 27 Apr 2018 09:29:30 -0700 Subject: [PATCH 03/13] dbg trace --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a648c1c..370326c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ function(get_poco) -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} ${extra_cmake_args} -Wno-dev + --trace ) # The external project will install to the build folder, but we'll install that on make install. From cb9048c02553771cfe2bd144f3b3dad1fdd01538 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 27 Apr 2018 09:52:31 -0700 Subject: [PATCH 04/13] Set build type before ExternalProject --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 370326c..8e6153e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,13 @@ function(get_poco) endif() endif() include(ExternalProject) + + set (_POCO_VENDOR_PARENT_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + if(MSVC) + # When using visual studio ExternalProject_Add builds using the parent project's build type + set(CMAKE_BUILD_TYPE ${get_poco_BUILD_TYPE}) + endif() + ExternalProject_Add(poco-1.7.7-${get_poco_BUILD_TYPE} URL https://github.com/pocoproject/poco/archive/poco-1.7.7-release.tar.gz URL_MD5 247b97b545715dc38c8619e412fbcd96 @@ -80,9 +87,13 @@ function(get_poco) -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} ${extra_cmake_args} -Wno-dev - --trace ) + if(MSVC) + # Restore the build type + set (CMAKE_BUILD_TYPE ${_POCO_VENDOR_PARENT_BUILD_TYPE}) + endif() + # The external project will install to the build folder, but we'll install that on make install. install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE}/ DESTINATION ${CMAKE_INSTALL_PREFIX}) From 624f26a9f5908a5fed0536075a66979a62fb4e64 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 27 Apr 2018 11:13:50 -0700 Subject: [PATCH 05/13] Explicitly set build command to get desired config --- CMakeLists.txt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e6153e..7a1aca0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,11 +59,8 @@ function(get_poco) endif() include(ExternalProject) - set (_POCO_VENDOR_PARENT_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - if(MSVC) - # When using visual studio ExternalProject_Add builds using the parent project's build type - set(CMAKE_BUILD_TYPE ${get_poco_BUILD_TYPE}) - endif() + # Set build command explicitly because ExternalProject uses parent project config type when using visual studio + set(poco_build_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE}) ExternalProject_Add(poco-1.7.7-${get_poco_BUILD_TYPE} URL https://github.com/pocoproject/poco/archive/poco-1.7.7-release.tar.gz @@ -87,13 +84,9 @@ function(get_poco) -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} ${extra_cmake_args} -Wno-dev + BUILD_COMMAND ${poco_build_command} ) - if(MSVC) - # Restore the build type - set (CMAKE_BUILD_TYPE ${_POCO_VENDOR_PARENT_BUILD_TYPE}) - endif() - # The external project will install to the build folder, but we'll install that on make install. install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE}/ DESTINATION ${CMAKE_INSTALL_PREFIX}) From d6b7f1b507d84fcaa2141cec23e05c7e3c0e1108 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 27 Apr 2018 12:04:40 -0700 Subject: [PATCH 06/13] Install right files for config --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a1aca0..ed67170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,8 +59,9 @@ function(get_poco) endif() include(ExternalProject) - # Set build command explicitly because ExternalProject uses parent project config type when using visual studio + # Set build/install commands explicitly because ExternalProject uses parent project config type when using visual studio set(poco_build_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE}) + set(poco_install_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE} --target install) ExternalProject_Add(poco-1.7.7-${get_poco_BUILD_TYPE} URL https://github.com/pocoproject/poco/archive/poco-1.7.7-release.tar.gz @@ -85,6 +86,7 @@ function(get_poco) ${extra_cmake_args} -Wno-dev BUILD_COMMAND ${poco_build_command} + INSTALL_COMMAND ${poco_install_command} ) # The external project will install to the build folder, but we'll install that on make install. From b388431339d5a2af2abee5c942d68d1e0c893bea Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 1 May 2018 08:36:09 -0700 Subject: [PATCH 07/13] Combine build/install into single step --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed67170..49daf17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,9 +59,11 @@ function(get_poco) endif() include(ExternalProject) - # Set build/install commands explicitly because ExternalProject uses parent project config type when using visual studio - set(poco_build_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE}) - set(poco_install_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE} --target install) + # If build command is not set then ExternalProject uses parent project config type when using visual studio + set(poco_build_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE} --target install) + # Clear install command because build command is doing installation. + # When build/install steps are separate ExternalProject uses the wrong visual studio build tools version + set(poco_install_command "") ExternalProject_Add(poco-1.7.7-${get_poco_BUILD_TYPE} URL https://github.com/pocoproject/poco/archive/poco-1.7.7-release.tar.gz From ffa5a33a686e6a3beb89a90e47f90acfc496231b Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 4 May 2018 13:33:40 -0700 Subject: [PATCH 08/13] Use poco 1.8.0.1 --- CMakeLists.txt | 60 ++------ cmake/Modules/FindPoco.cmake | 231 ----------------------------- poco_vendorConfig-version.cmake.in | 13 -- poco_vendorConfig.cmake.in | 3 - 4 files changed, 16 insertions(+), 291 deletions(-) delete mode 100644 cmake/Modules/FindPoco.cmake delete mode 100644 poco_vendorConfig-version.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 49daf17..db4fe82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,25 +1,14 @@ cmake_minimum_required(VERSION 2.8.3) +cmake_policy(SET CMP0048 NEW) -project(poco_vendor) +project(poco_vendor VERSION "1.0.0") -set(PACKAGE_VERSION "1.0.0") - -list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") find_package(Poco COMPONENTS Foundation) - -function(get_poco) - set(options) - set(oneValueArgs BUILD_TYPE) - set(multiValueArgs) - cmake_parse_arguments(get_poco "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - +if(NOT Poco_FOUND) # If Poco was not found, download and build from source - set(extra_cmake_args) - if(DEFINED get_poco_BUILD_TYPE) - list(APPEND extra_cmake_args -DCMAKE_BUILD_TYPE=${get_poco_BUILD_TYPE}) - else() - set(get_poco_BUILD_TYPE "None") + if(DEFINED CMAKE_BUILD_TYPE) + list(APPEND extra_cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) endif() if(WIN32) list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=/wd4244 /wd4530 /wd4577") @@ -59,15 +48,9 @@ function(get_poco) endif() include(ExternalProject) - # If build command is not set then ExternalProject uses parent project config type when using visual studio - set(poco_build_command ${CMAKE_COMMAND} --build . --config ${get_poco_BUILD_TYPE} --target install) - # Clear install command because build command is doing installation. - # When build/install steps are separate ExternalProject uses the wrong visual studio build tools version - set(poco_install_command "") - - ExternalProject_Add(poco-1.7.7-${get_poco_BUILD_TYPE} - URL https://github.com/pocoproject/poco/archive/poco-1.7.7-release.tar.gz - URL_MD5 247b97b545715dc38c8619e412fbcd96 + ExternalProject_Add(poco-1.8.0.1-release + URL https://github.com/pocoproject/poco/archive/poco-1.8.0.1-release.tar.gz + URL_MD5 07aa03d7976d0dbc141d95821c104c10 TIMEOUT 600 CMAKE_ARGS -DENABLE_CPPUNIT:BOOL=OFF @@ -83,36 +66,25 @@ function(get_poco) -DENABLE_UTIL:BOOL=OFF -DENABLE_XML:BOOL=OFF -DENABLE_ZIP:BOOL=OFF - -DCMAKE_DEBUG_POSTFIX=d - -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/poco_external_project_install ${extra_cmake_args} -Wno-dev - BUILD_COMMAND ${poco_build_command} - INSTALL_COMMAND ${poco_install_command} ) # The external project will install to the build folder, but we'll install that on make install. - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/poco_install_${get_poco_BUILD_TYPE}/ + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/poco_external_project_install/ DESTINATION ${CMAKE_INSTALL_PREFIX}) -endfunction() - -if(NOT Poco_FOUND) - # Always build a debug and a release version of poco - if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - get_poco(BUILD_TYPE Release) - else() - get_poco(BUILD_TYPE Debug) - endif() - - get_poco(BUILD_TYPE ${CMAKE_BUILD_TYPE}) +else() + message(STATUS "Found Poco ${Poco_VERSION}") endif() configure_file(poco_vendorConfig.cmake.in "${PROJECT_BINARY_DIR}/poco_vendorConfig.cmake" @ONLY) -configure_file(poco_vendorConfig-version.cmake.in - "${PROJECT_BINARY_DIR}/poco_vendorConfig-version.cmake" @ONLY) -install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME}) +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/poco_vendorConfig-version.cmake" + COMPATIBILITY AnyNewerVersion) install(FILES "${PROJECT_BINARY_DIR}/poco_vendorConfig.cmake" diff --git a/cmake/Modules/FindPoco.cmake b/cmake/Modules/FindPoco.cmake deleted file mode 100644 index d66d59f..0000000 --- a/cmake/Modules/FindPoco.cmake +++ /dev/null @@ -1,231 +0,0 @@ -# - Find the Poco includes and libraries. -# The following variables are set if Poco is found. If Poco is not -# found, Poco_FOUND is set to false. -# Poco_FOUND - True when the Poco include directory is found. -# Poco_INCLUDE_DIRS - the path to where the poco include files are. -# Poco_LIBRARY_DIR - The path to where the poco library files are. -# Poco_BINARY_DIRS - The path to where the poco dlls are. -# Poco_LIBRARIES - list of all libs from requested components. - -# ---------------------------------------------------------------------------- -# If you have installed Poco in a non-standard location. -# Then you have three options. -# In the following comments, it is assumed that -# points to the root directory of the include directory of Poco. e.g -# If you have put poco in C:\development\Poco then is -# "C:/development/Poco" and in this directory there will be two -# directories called "include" and "lib". -# 1) After CMake runs, set Poco_INCLUDE_DIR to /poco<-version> -# 2) Use CMAKE_INCLUDE_PATH to set a path to /poco<-version>. This will allow find_path() -# to locate Poco_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. -# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") -# 3) Set an environment variable called ${POCO_ROOT} that points to the root of where you have -# installed Poco, e.g. . It is assumed that there is at least a subdirectory called -# Foundation/include/Poco in this path. -# -# Note: -# 1) If you are just using the poco headers, then you do not need to use -# Poco_LIBRARY_DIR in your CMakeLists.txt file. -# 2) If Poco has not been installed, then when setting Poco_LIBRARY_DIR -# the script will look for /lib first and, if this fails, then for /stage/lib. -# -# Usage: -# In your CMakeLists.txt file do something like this: -# ... -# # Poco -# find_package(Poco REQUIRED COMPONENTS XML Net Data...) -# ... -# include_directories(${Poco_INCLUDE_DIRS}) -# link_directories(${Poco_LIBRARY_DIR}) -# -# In Windows, we make the assumption that, if the Poco files are installed, the default directory -# will be C:\poco or C:\Program Files\Poco or C:\Programme\Poco. - -message(STATUS "Searching for Poco library...") - -set(POCO_INCLUDE_PATH_DESCRIPTION - "top-level directory containing the poco include directories. E.g /usr/local/include/ or c:\\poco\\include\\poco-1.3.2") -set(POCO_INCLUDE_DIR_MESSAGE - "Set the Poco_INCLUDE_DIR cmake cache entry to the ${POCO_INCLUDE_PATH_DESCRIPTION}") -set(POCO_LIBRARY_PATH_DESCRIPTION "top-level directory containing the poco libraries.") -set(POCO_LIBRARY_DIR_MESSAGE - "Set the Poco_LIBRARY_DIR cmake cache entry to the ${POCO_LIBRARY_PATH_DESCRIPTION}") - -set(POCO_DIR_SEARCH $ENV{POCO_ROOT}) -if(POCO_DIR_SEARCH) - file(TO_CMAKE_PATH ${POCO_DIR_SEARCH} POCO_DIR_SEARCH) -endif() - -if(WIN32) - set(POCO_DIR_SEARCH - ${POCO_DIR_SEARCH} - "C:/poco" - "D:/poco" - "C:/Program Files/poco" - "D:/Program Files/poco" - ) -endif() - -# Add in some path suffixes. These will have to be updated whenever a new Poco version comes out. -set(SUFFIX_FOR_INCLUDE_PATH - poco-1.3.2 - poco-1.3.3 - poco-1.3.4 - poco-1.3.5 - poco-1.3.6 -) - -set(SUFFIX_FOR_LIBRARY_PATH - poco-1.3.2/lib - poco-1.3.2/lib/Linux/i686 - poco-1.3.2/lib/Linux/x86_64 - poco-1.3.3/lib - poco-1.3.3/lib/Linux/i686 - poco-1.3.3/lib/Linux/x86_64 - poco-1.3.4/lib - poco-1.3.4/lib/Linux/i686 - poco-1.3.4/lib/Linux/x86_64 - poco-1.3.5/lib - poco-1.3.5/lib/Linux/i686 - poco-1.3.5/lib/Linux/x86_64 - poco-1.3.6/lib - poco-1.3.6/lib/Linux/i686 - poco-1.3.6/lib/Linux/x86_64 - lib - lib/Linux/i686 - lib/Linux/x86_64 -) - -# -# Look for an installation. -# -find_path(Poco_INCLUDE_DIR - NAMES Foundation/include/Poco/SharedLibrary.h - PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS - # Look in other places. - ${POCO_DIR_SEARCH} - # Help the user find it if we cannot. - DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}" -) - -if(NOT Poco_INCLUDE_DIR) - -# Look for standard unix include paths - find_path(Poco_INCLUDE_DIR Poco/Poco.h DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}") - -endif() - -# Assume we didn't find it. -set(Poco_FOUND 0) - -# check if found Poco version is at least version 1.4.1p1 -# since older versions don't use recursive mutexes (on Linux) -if(Poco_INCLUDE_DIR) - find_file( - Poco_VERSION_FILE NAMES "Version.h" - PATHS "${Poco_INCLUDE_DIR}" - PATH_SUFFIXES "Poco" "Foundation/include/Poco" - DOC "Path of Poco/Version.h file" - NO_DEFAULT_PATH - ) - if(NOT Poco_VERSION_FILE) - message(STATUS "Found Poco version (< 1.4.0) is too old, building from source instead") - unset(Poco_INCLUDE_DIR CACHE) - else() - file( - STRINGS "${Poco_VERSION_FILE}" Poco_VERSION_DEFINE - REGEX "#define POCO_VERSION 0x[0-9]+") - if(NOT Poco_VERSION_DEFINE) - message(FATAL_ERROR "Failed to find '#define POCO_VERSION 0x...' in '${Poco_VERSION_FILE}'") - endif() - string(SUBSTRING "${Poco_VERSION_DEFINE}" 21 -1 Poco_VERSION_OCT) - if("${Poco_VERSION_OCT}" STRLESS "0x01040101") - # Poco is too old, build from source instead - message(STATUS "Found Poco version ${Poco_VERSION_OCT} is too old, building from source instead") - unset(Poco_INCLUDE_DIR CACHE) - endif() - endif() -endif() - -# Now try to get the include and library path. -if(Poco_INCLUDE_DIR) - if(EXISTS "${Poco_INCLUDE_DIR}/Foundation/include/Poco/SharedLibrary.h") - set(Poco_INCLUDE_DIRS - ${Poco_INCLUDE_DIR}/CppUnit/include - ${Poco_INCLUDE_DIR}/Foundation/include - ${Poco_INCLUDE_DIR}/Net/include - ${Poco_INCLUDE_DIR}/Util/include - ${Poco_INCLUDE_DIR}/XML/include - ) - set(Poco_FOUND TRUE) - elseif(EXISTS "${Poco_INCLUDE_DIR}/Poco/Poco.h") - set(Poco_INCLUDE_DIRS ${Poco_INCLUDE_DIR}) - set(Poco_FOUND TRUE) - endif() - - if(NOT Poco_LIBRARY_DIR) - find_library(Poco_FOUNDATION_LIB - NAMES PocoFoundation PocoFoundationd PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH} PATHS - # Look in other places. - ${Poco_INCLUDE_DIR} - ${POCO_DIR_SEARCH} - # Help the user find it if we cannot. - DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION}" - ) - set(Poco_LIBRARY_DIR "" CACHE PATH POCO_LIBARARY_PATH_DESCRIPTION) - get_filename_component(Poco_LIBRARY_DIR ${Poco_FOUNDATION_LIB} PATH) - set(Poco_LIBRARIES "") - set(Comp_List "") - if(Poco_LIBRARY_DIR AND Poco_FOUNDATION_LIB) - # Look for the poco binary path. - set(Poco_BINARY_DIR ${Poco_INCLUDE_DIR}) - if(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin") - set(Poco_BINARY_DIRS ${Poco_BINARY_DIR}/bin) - endif() - endif() - if(Poco_FOUNDATION_LIB) - if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - set(DBG "d") - else() - set(DBG "") - endif() - set(Comp_List "Foundation${DBG}") - foreach(COMPONENT ${Poco_FIND_COMPONENTS}) - find_library(LIB${COMPONENT} "Poco${COMPONENT}${DBG}" Poco_LIBRARY_DIR) - if(LIB${COMPONENT}) - list(APPEND Poco_LIBRARIES "${LIB${COMPONENT}}") - list(APPEND Comp_List "${COMPONENT}${DBG}") - else() - message(STATUS " Poco found, but missing component 'Poco${COMPONENT}${DBG}'...") - message(STATUS " This can happen when poco is found in release, but debug is required.") - message(STATUS " It could also be that debug is found, but release is required.") - set(Poco_FOUND FALSE) - endif() - endforeach() - list(REMOVE_DUPLICATES Comp_List) - endif() - endif() -endif() - -if(NOT Poco_FOUND) - if(Poco_FIND_QUIETLY) - message(STATUS "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") - elseif(Poco_FIND_REQUIRED) - message(FATAL_ERROR "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") - endif() -else() - message(STATUS " Found Poco!") - set(COMPONENT_STR "components found:") - foreach(comp ${Comp_List}) - set(COMPONENT_STR "${COMPONENT_STR}, ${comp}") - endforeach() - string(REPLACE ":," ":" COMPONENT_LSTR ${COMPONENT_STR}) - message(STATUS "${COMPONENT_LSTR}.") -endif() - -# I added this in to add "libdl" on non-Windows systems. -# Technically dl is only neded if the "Foundation" component is used, -# but i doesn't hurt to add it in anyway -if(Poco_FOUND AND NOT WIN32) - list(APPEND Poco_LIBRARIES "dl") -endif() diff --git a/poco_vendorConfig-version.cmake.in b/poco_vendorConfig-version.cmake.in deleted file mode 100644 index 53f0fef..0000000 --- a/poco_vendorConfig-version.cmake.in +++ /dev/null @@ -1,13 +0,0 @@ -set(PACKAGE_VERSION @PACKAGE_VERSION@) - -set(PACKAGE_VERSION_EXACT False) -set(PACKAGE_VERSION_COMPATIBLE False) - -if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT True) - set(PACKAGE_VERSION_COMPATIBLE True) -endif() - -if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE True) -endif() diff --git a/poco_vendorConfig.cmake.in b/poco_vendorConfig.cmake.in index ad1eede..ad6afce 100644 --- a/poco_vendorConfig.cmake.in +++ b/poco_vendorConfig.cmake.in @@ -8,6 +8,3 @@ set(_@PROJECT_NAME@_CONFIG_INCLUDED TRUE) if(NOT @PROJECT_NAME@_FIND_QUIETLY) message(STATUS "Found @PROJECT_NAME@: @PACKAGE_VERSION@ (${@PROJECT_NAME@_DIR})") endif() - -# add the local Modules directory to the modules path, so FindPoco.cmake is considered. -list(INSERT CMAKE_MODULE_PATH 0 "${@PROJECT_NAME@_DIR}/Modules") From 26e0877de1c15241acda43f9f8c9f3aa99eb413e Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Fri, 4 May 2018 14:17:45 -0700 Subject: [PATCH 09/13] Check if poco exists quietly --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db4fe82..767c262 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_policy(SET CMP0048 NEW) project(poco_vendor VERSION "1.0.0") -find_package(Poco COMPONENTS Foundation) +find_package(Poco COMPONENTS Foundation QUIET) if(NOT Poco_FOUND) # If Poco was not found, download and build from source From 54f4e8c1380073adf2079fbb08293d55bcd140c9 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 10 May 2018 07:59:07 -0700 Subject: [PATCH 10/13] Find poco > 1.6.1 --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 767c262..462c9b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.5) cmake_policy(SET CMP0048 NEW) - project(poco_vendor VERSION "1.0.0") -find_package(Poco COMPONENTS Foundation QUIET) +# Can work with poco 1.4.1p1 (earliest to use recursive mutexes on Linux) +# 1.6.1 is the first version to ship with PocoConfigVersion.cmake +find_package(Poco "1.6.1" COMPONENTS Foundation QUIET) if(NOT Poco_FOUND) # If Poco was not found, download and build from source From b70d08e994a4cff0887ed48a0e08948e1f0e4612 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 10 May 2018 08:10:20 -0700 Subject: [PATCH 11/13] Remove unused variable ENABLE_CPPUNIT --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 462c9b9..5c68886 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,6 @@ if(NOT Poco_FOUND) URL_MD5 07aa03d7976d0dbc141d95821c104c10 TIMEOUT 600 CMAKE_ARGS - -DENABLE_CPPUNIT:BOOL=OFF -DENABLE_CRYPTO:BOOL=OFF -DENABLE_DATA:BOOL=OFF -DENABLE_JSON:BOOL=OFF From 0cfdd5cbc0c4120d95e3d1ddbce03f3336a938e5 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 10 May 2018 15:53:48 -0700 Subject: [PATCH 12/13] Use CMAKE_CXX_STANDARD --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c68886..dca5a0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ if(NOT Poco_FOUND) list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=/wd4244 /wd4530 /wd4577") else() list(APPEND extra_cmake_args "-DCMAKE_C_FLAGS=-Wno-shift-negative-value") - list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=-std=c++14") + list(APPEND extra_cmake_args "-DCMAKE_CXX_STANDARD=14") if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT ANDROID) list(APPEND extra_cmake_args "-DPOCO_UNBUNDLED:BOOL=ON") endif() From fc22ae07c84a969b563310a040ddbf6637976efe Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 10 May 2018 15:56:38 -0700 Subject: [PATCH 13/13] Remove unnecessary policy call --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dca5a0a..dd09c7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.5) -cmake_policy(SET CMP0048 NEW) project(poco_vendor VERSION "1.0.0") # Can work with poco 1.4.1p1 (earliest to use recursive mutexes on Linux)