include version resource in DLLs built with CMake

This commit is contained in:
Günter Obiltschnig 2019-06-24 15:39:06 +02:00
parent 472684e13c
commit 9a8ab0858f
20 changed files with 122 additions and 3 deletions

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(CppParser ${SRCS}) add_library(CppParser ${SRCS})
add_library(Poco::CppParser ALIAS CppParser) add_library(Poco::CppParser ALIAS CppParser)
set_target_properties(CppParser set_target_properties(CppParser

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(Crypto ${SRCS} ) add_library(Crypto ${SRCS} )
add_library(Poco::Crypto ALIAS Crypto) add_library(Poco::Crypto ALIAS Crypto)
set_target_properties(Crypto set_target_properties(Crypto

View File

@ -11,6 +11,11 @@ if(MSVC AND NOT(MSVC_VERSION LESS 1400))
PROPERTIES COMPILE_FLAGS "/bigobj") PROPERTIES COMPILE_FLAGS "/bigobj")
endif() 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)
endif()
add_library(Data ${SRCS} ) add_library(Data ${SRCS} )
add_library(Poco::Data ALIAS Data) add_library(Poco::Data ALIAS Data)

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( MYSQL_SRCS ${HDRS_G}) 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)
endif()
add_library(DataMySQL ${MYSQL_SRCS} ) add_library(DataMySQL ${MYSQL_SRCS} )
add_library(Poco::DataMySQL ALIAS DataMySQL) add_library(Poco::DataMySQL ALIAS DataMySQL)
set_target_properties(DataMySQL set_target_properties(DataMySQL

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( ODBC_SRCS ${HDRS_G}) 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)
endif()
add_library(DataODBC ${ODBC_SRCS}) add_library(DataODBC ${ODBC_SRCS})
add_library(Poco::DataODBC ALIAS DataODBC) add_library(Poco::DataODBC ALIAS DataODBC)
set_target_properties(DataODBC set_target_properties(DataODBC

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( POSTGRESQL_SRCS ${HDRS_G}) 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)
endif()
add_library(DataPostgreSQL ${POSTGRESQL_SRCS} ) add_library(DataPostgreSQL ${POSTGRESQL_SRCS} )
add_library(Poco::DataPostgreSQL ALIAS DataPostgreSQL) add_library(Poco::DataPostgreSQL ALIAS DataPostgreSQL)
set_target_properties(DataPostgreSQL set_target_properties(DataPostgreSQL

View File

@ -19,6 +19,12 @@ else()
) )
endif() 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)
endif()
add_library(DataSQLite ${SQLITE_SRCS} ) add_library(DataSQLite ${SQLITE_SRCS} )
add_library(Poco::DataSQLite ALIAS DataSQLite) add_library(Poco::DataSQLite ALIAS DataSQLite)

View File

@ -6,6 +6,12 @@ POCO_SOURCES( SRCS Encodings ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS( SRCS Encodings ${HDRS_G}) 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)
endif()
add_library(Encodings ${SRCS} ) add_library(Encodings ${SRCS} )
add_library(Poco::Encodings ALIAS Encodings) add_library(Poco::Encodings ALIAS Encodings)
set_target_properties(Encodings set_target_properties(Encodings

View File

@ -23,6 +23,12 @@ POCO_SOURCES_AUTO_PLAT( SRCS WIN32
) )
endif() 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)
endif()
# Messages # Messages
POCO_MESSAGES( SRCS Logging src/pocomsg.mc) POCO_MESSAGES( SRCS Logging src/pocomsg.mc)

View File

@ -7,6 +7,12 @@ file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) POCO_HEADERS_AUTO( SRCS ${HDRS_G})
POCO_SOURCES(SRCS pdjson src/pdjson.c) 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)
endif()
add_library(JSON ${SRCS} ) add_library(JSON ${SRCS} )
add_library(Poco::JSON ALIAS JSON) add_library(Poco::JSON ALIAS JSON)
set_target_properties(JSON set_target_properties(JSON

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(MongoDB ${SRCS} ) add_library(MongoDB ${SRCS} )
add_library(Poco::MongoDB ALIAS MongoDB) add_library(Poco::MongoDB ALIAS MongoDB)
set_target_properties(MongoDB set_target_properties(MongoDB

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(Net ${SRCS} ) add_library(Net ${SRCS} )
add_library(Poco::Net ALIAS Net) add_library(Poco::Net ALIAS Net)
set_target_properties( Net set_target_properties( Net

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(NetSSL ${SRCS} ) add_library(NetSSL ${SRCS} )
add_library(Poco::NetSSL ALIAS NetSSL) add_library(Poco::NetSSL ALIAS NetSSL)
set_target_properties( NetSSL set_target_properties( NetSSL

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(NetSSLWin ${SRCS}) add_library(NetSSLWin ${SRCS})
add_library(Poco::NetSSLWin ALIAS NetSSLWin) add_library(Poco::NetSSLWin ALIAS NetSSLWin)
set_target_properties(NetSSLWin set_target_properties(NetSSLWin

View File

@ -113,6 +113,12 @@ POCO_SOURCES( SRCS libpng
src/pngwutil.c src/pngwutil.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)
endif()
#TODO: Can we put this with the below includes? PRIVAT eg. #TODO: Can we put this with the below includes? PRIVAT eg.
include_directories( "include/Poco/PDF" ) # zip src include_directories( "include/Poco/PDF" ) # zip src

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(Redis ${SRCS} ) add_library(Redis ${SRCS} )
add_library(Poco::Redis ALIAS Redis) add_library(Poco::Redis ALIAS Redis)
set_target_properties(Redis set_target_properties(Redis

View File

@ -47,6 +47,12 @@ POCO_SOURCES( SRCS 7z
# src/XzIn.c # src/XzIn.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)
endif()
add_library(SevenZip ${SRCS} ) add_library(SevenZip ${SRCS} )
add_library(Poco::SevenZip ALIAS SevenZip) add_library(Poco::SevenZip ALIAS SevenZip)
set_target_properties(SevenZip set_target_properties(SevenZip

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
POCO_SOURCES_AUTO_PLAT( SRCS WIN32 POCO_SOURCES_AUTO_PLAT( SRCS WIN32
src/WinRegistryConfiguration.cpp src/WinRegistryConfiguration.cpp
src/WinRegistryKey.cpp src/WinRegistryKey.cpp

View File

@ -11,6 +11,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
# If POCO_UNBUNDLED is enabled we try to find the required packages # If POCO_UNBUNDLED is enabled we try to find the required packages
# The configuration will fail if the packages are not found # The configuration will fail if the packages are not found
if (POCO_UNBUNDLED) if (POCO_UNBUNDLED)

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" ) file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G}) 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)
endif()
add_library(Zip ${SRCS} ) add_library(Zip ${SRCS} )
add_library(Poco::Zip ALIAS Zip) add_library(Poco::Zip ALIAS Zip)
set_target_properties( Zip set_target_properties( Zip