From 990f7825b598dec92ad1aa7ffac568b514091838 Mon Sep 17 00:00:00 2001 From: Brice Gros Date: Fri, 18 Oct 2019 15:35:02 +0200 Subject: [PATCH] Fix path to DLLVersion.rc and enable to skip Foundation; Fix Foundation samples referencing useless libs --- CMakeLists.txt | 5 ++++- CppParser/CMakeLists.txt | 4 ++-- Crypto/CMakeLists.txt | 4 ++-- Data/CMakeLists.txt | 4 ++-- Data/MySQL/CMakeLists.txt | 4 ++-- Data/ODBC/CMakeLists.txt | 4 ++-- Data/PostgreSQL/CMakeLists.txt | 4 ++-- Data/SQLite/CMakeLists.txt | 4 ++-- Encodings/CMakeLists.txt | 4 ++-- Foundation/CMakeLists.txt | 4 ++-- Foundation/samples/StringTokenizer/CMakeLists.txt | 2 +- Foundation/samples/URI/CMakeLists.txt | 2 +- JSON/CMakeLists.txt | 4 ++-- JWT/CMakeLists.txt | 4 ++-- MongoDB/CMakeLists.txt | 4 ++-- Net/CMakeLists.txt | 4 ++-- NetSSL_OpenSSL/CMakeLists.txt | 4 ++-- NetSSL_Win/CMakeLists.txt | 4 ++-- NetSSL_Win/CMakeLists.txt.rej | 12 ++++++++++++ PDF/CMakeLists.txt | 4 ++-- Redis/CMakeLists.txt | 4 ++-- SevenZip/CMakeLists.txt | 4 ++-- Util/CMakeLists.txt | 4 ++-- XML/CMakeLists.txt | 4 ++-- Zip/CMakeLists.txt | 4 ++-- 25 files changed, 60 insertions(+), 45 deletions(-) create mode 100644 NetSSL_Win/CMakeLists.txt.rej diff --git a/CMakeLists.txt b/CMakeLists.txt index b4cc506d6..34671a810 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,7 @@ else() endif() # Allow enabling and disabling components +option(ENABLE_FOUNDATION "Enable Foundation, required for all components except CppUnit" ON) option(ENABLE_ENCODINGS "Enable Encodings" ON) option(ENABLE_ENCODINGS_COMPILER "Enable Encodings Compiler" OFF) option(ENABLE_XML "Enable XML" ON) @@ -308,7 +309,9 @@ if(ENABLE_JWT) set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE) endif() -add_subdirectory(Foundation) +if(ENABLE_FOUNDATION) + add_subdirectory(Foundation) +endif() if(ENABLE_ENCODINGS) add_subdirectory(Encodings) list(APPEND Poco_COMPONENTS "Encodings") diff --git a/CppParser/CMakeLists.txt b/CppParser/CMakeLists.txt index 1899c922f..697b200a3 100644 --- a/CppParser/CMakeLists.txt +++ b/CppParser/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(CppParser ${SRCS}) diff --git a/Crypto/CMakeLists.txt b/Crypto/CMakeLists.txt index 8ebb6c0e1..a6055fdbc 100644 --- a/Crypto/CMakeLists.txt +++ b/Crypto/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Crypto ${SRCS} ) diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index 884a7d4a3..7c5320d29 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -13,8 +13,8 @@ endif() # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Data ${SRCS} ) diff --git a/Data/MySQL/CMakeLists.txt b/Data/MySQL/CMakeLists.txt index 7c6a4eccb..7e1b947c1 100644 --- a/Data/MySQL/CMakeLists.txt +++ b/Data/MySQL/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( MYSQL_SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND MYSQL_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND MYSQL_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(DataMySQL ${MYSQL_SRCS} ) diff --git a/Data/ODBC/CMakeLists.txt b/Data/ODBC/CMakeLists.txt index d2bd93644..89b033e02 100644 --- a/Data/ODBC/CMakeLists.txt +++ b/Data/ODBC/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( ODBC_SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND ODBC_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND ODBC_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(DataODBC ${ODBC_SRCS}) diff --git a/Data/PostgreSQL/CMakeLists.txt b/Data/PostgreSQL/CMakeLists.txt index eb68ce07c..3c647b30a 100644 --- a/Data/PostgreSQL/CMakeLists.txt +++ b/Data/PostgreSQL/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( POSTGRESQL_SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND POSTGRESQL_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND POSTGRESQL_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(DataPostgreSQL ${POSTGRESQL_SRCS} ) diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt index 6dae8deeb..fcce2e0d6 100644 --- a/Data/SQLite/CMakeLists.txt +++ b/Data/SQLite/CMakeLists.txt @@ -21,8 +21,8 @@ endif() # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SQLITE_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SQLITE_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(DataSQLite ${SQLITE_SRCS} ) diff --git a/Encodings/CMakeLists.txt b/Encodings/CMakeLists.txt index d1181f254..a167f4f6b 100644 --- a/Encodings/CMakeLists.txt +++ b/Encodings/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS( SRCS Encodings ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Encodings ${SRCS} ) diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index 779e626ab..af39d1691 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -25,8 +25,8 @@ endif() # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() # Messages diff --git a/Foundation/samples/StringTokenizer/CMakeLists.txt b/Foundation/samples/StringTokenizer/CMakeLists.txt index f0905ecf5..e66c23e4b 100644 --- a/Foundation/samples/StringTokenizer/CMakeLists.txt +++ b/Foundation/samples/StringTokenizer/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(StringTokenizer src/StringTokenizer.cpp) -target_link_libraries(StringTokenizer PUBLIC Poco::JSON Poco::XML Poco::Foundation) +target_link_libraries(StringTokenizer PUBLIC Poco::Foundation) diff --git a/Foundation/samples/URI/CMakeLists.txt b/Foundation/samples/URI/CMakeLists.txt index 05aef6df4..e31d42ff0 100644 --- a/Foundation/samples/URI/CMakeLists.txt +++ b/Foundation/samples/URI/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(URI src/URI.cpp) -target_link_libraries(URI PUBLIC Poco::JSON Poco::XML Poco::Foundation ) +target_link_libraries(URI PUBLIC Poco::Foundation ) diff --git a/JSON/CMakeLists.txt b/JSON/CMakeLists.txt index 9f2cf32b2..015c99065 100644 --- a/JSON/CMakeLists.txt +++ b/JSON/CMakeLists.txt @@ -9,8 +9,8 @@ POCO_SOURCES(SRCS pdjson src/pdjson.c) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(JSON ${SRCS} ) diff --git a/JWT/CMakeLists.txt b/JWT/CMakeLists.txt index c0c7f5e85..88c29d310 100644 --- a/JWT/CMakeLists.txt +++ b/JWT/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(JWT ${SRCS} ) diff --git a/MongoDB/CMakeLists.txt b/MongoDB/CMakeLists.txt index 61134df30..7ece84e55 100644 --- a/MongoDB/CMakeLists.txt +++ b/MongoDB/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(MongoDB ${SRCS} ) diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index 56cddc3fa..dcafb2d0e 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Net ${SRCS} ) diff --git a/NetSSL_OpenSSL/CMakeLists.txt b/NetSSL_OpenSSL/CMakeLists.txt index 040e227de..f0881d6dd 100644 --- a/NetSSL_OpenSSL/CMakeLists.txt +++ b/NetSSL_OpenSSL/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(NetSSL ${SRCS} ) diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt index d1b2c3019..78f58d1c6 100644 --- a/NetSSL_Win/CMakeLists.txt +++ b/NetSSL_Win/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(NetSSLWin ${SRCS}) diff --git a/NetSSL_Win/CMakeLists.txt.rej b/NetSSL_Win/CMakeLists.txt.rej new file mode 100644 index 000000000..2505ced1c --- /dev/null +++ b/NetSSL_Win/CMakeLists.txt.rej @@ -0,0 +1,12 @@ +diff a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt (rejected hunks) +@@ -11,8 +11,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) + + # Version Resource + if(MSVC AND NOT POCO_STATIC) +- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) +- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) ++ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) ++ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + endif() + + add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) diff --git a/PDF/CMakeLists.txt b/PDF/CMakeLists.txt index c00117d83..bd96a4a15 100644 --- a/PDF/CMakeLists.txt +++ b/PDF/CMakeLists.txt @@ -115,8 +115,8 @@ POCO_SOURCES( SRCS libpng # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() #TODO: Can we put this with the below includes? PRIVAT eg. diff --git a/Redis/CMakeLists.txt b/Redis/CMakeLists.txt index 03b76ddc5..63ace885f 100644 --- a/Redis/CMakeLists.txt +++ b/Redis/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Redis ${SRCS} ) diff --git a/SevenZip/CMakeLists.txt b/SevenZip/CMakeLists.txt index 4e9a3d6ee..0eeded660 100644 --- a/SevenZip/CMakeLists.txt +++ b/SevenZip/CMakeLists.txt @@ -49,8 +49,8 @@ POCO_SOURCES( SRCS 7z # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(SevenZip ${SRCS} ) diff --git a/Util/CMakeLists.txt b/Util/CMakeLists.txt index 9f818f4cf..ffe5048e3 100644 --- a/Util/CMakeLists.txt +++ b/Util/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() POCO_SOURCES_AUTO_PLAT( SRCS WIN32 diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt index 01569c12a..5e1c80df9 100644 --- a/XML/CMakeLists.txt +++ b/XML/CMakeLists.txt @@ -13,8 +13,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() # If POCO_UNBUNDLED is enabled we try to find the required packages diff --git a/Zip/CMakeLists.txt b/Zip/CMakeLists.txt index 64d3b12ba..d8cd1b056 100644 --- a/Zip/CMakeLists.txt +++ b/Zip/CMakeLists.txt @@ -8,8 +8,8 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # Version Resource if(MSVC AND NOT POCO_STATIC) - source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) - list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) endif() add_library(Zip ${SRCS} )