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" )
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(Poco::CppParser ALIAS CppParser)
set_target_properties(CppParser

View File

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

View File

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

View File

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

View File

@ -19,6 +19,12 @@ else()
)
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(Poco::DataSQLite ALIAS DataSQLite)

View File

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

View File

@ -23,6 +23,12 @@ POCO_SOURCES_AUTO_PLAT( SRCS WIN32
)
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
POCO_MESSAGES( SRCS Logging src/pocomsg.mc)
@ -128,7 +134,7 @@ if(NOT BUILD_SHARED_LIBS)
POCO_STATIC
)
endif()
if(WIN32)
target_compile_definitions(Foundation PUBLIC POCO_NO_AUTOMATIC_LIBS POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE)
target_link_libraries(Foundation PUBLIC iphlpapi)

View File

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

View File

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

View File

@ -6,6 +6,12 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
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(Poco::Net ALIAS Net)
set_target_properties( Net
@ -21,9 +27,9 @@ if(WIN32)
target_link_libraries(Net PUBLIC "iphlpapi.lib")
if(WINCE)
target_link_libraries(Net PUBLIC "ws2.lib")
else()
else()
target_link_libraries(Net PUBLIC "ws2_32.lib")
endif()
endif()
endif(WIN32)
target_include_directories(Net

View File

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

View File

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

View File

@ -113,6 +113,12 @@ POCO_SOURCES( SRCS libpng
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.
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" )
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(Poco::Redis ALIAS Redis)
set_target_properties(Redis

View File

@ -47,6 +47,12 @@ POCO_SOURCES( SRCS 7z
# 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(Poco::SevenZip ALIAS SevenZip)
set_target_properties(SevenZip

View File

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

View File

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

View File

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