Skip to content

Commit

Permalink
include version resource in DLLs built with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Jun 24, 2019
1 parent 65e3742 commit 545b7d7
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ApacheConnector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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( "${LIBNAME}" SHARED ${SRCS} )
set_target_properties( "${LIBNAME}"
PROPERTIES
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Release 1.9.1 (2019-06-24)
- Upgraded bundled SQLite to version 3.28.0
- Added project/solution files for Visual Studio 2019
- Fixed Visual Studio project files (version information from DLLVersion.rc not included in DLLs)
- Include version resource in DLLs built with CMake
- fixed GH #2220: Encoding/DoubleByteEncoding.cpp fails to compile with VS2008 and _DEBUG
- fixed GH #2243: DLLVersion.rc is excluded from build, missing detail information in properties of *.dll
- fixed GH #2277: SQLite null pointer dereference occurs when exception is being thrown
- fixed GH #2313: PollSet behaves differently on windows
- fixed GH #2316: cmake can't find MySQL and ODBC libraries
Expand Down
6 changes: 6 additions & 0 deletions CppParser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions CppUnit/WinTestRunner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G})
file(GLOB_RECURSE HDRS_G "src/*.h" )
POCO_HEADERS_AUTO( WIN_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()

# TODO: Is this flag always required?
add_definitions("-D_AFXDLL")
#TODO: Use instead of the flag above: find_package(MFC)
Expand Down
6 changes: 5 additions & 1 deletion Crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G})

#add_definitions(-D_USRDLL)
# 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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
Expand Down
6 changes: 6 additions & 0 deletions Data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 (NOT POCO_STATIC)
add_definitions(-DTHREADSAFE)
endif (NOT POCO_STATIC)
Expand Down
6 changes: 6 additions & 0 deletions Data/MySQL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc)
endif()

add_definitions(-DTHREADSAFE -DNO_TCL)

add_library( "${LIBNAME}" ${LIB_MODE} ${MYSQL_SRCS} )
Expand Down
6 changes: 6 additions & 0 deletions Data/ODBC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc)
endif()

add_definitions( ${ODBC_CFLAGS} -DTHREADSAFE)

add_library( "${LIBNAME}" ${LIB_MODE} ${ODBC_SRCS} )
Expand Down
6 changes: 6 additions & 0 deletions Data/SQLite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ POCO_SOURCES_AUTO( SQLITE_SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SQLITE_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)
find_package(SQLite3)
set(DATASQLITELIBS ${SQLITE3_LIBRARIES})
Expand Down
6 changes: 6 additions & 0 deletions Encodings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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)

Expand Down
6 changes: 6 additions & 0 deletions JSON/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if(WIN32)
SET_SOURCE_FILES_PROPERTIES(src/pdjson.c PROPERTIES LANGUAGE CXX)
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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions MongoDB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
10 changes: 8 additions & 2 deletions Net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ 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()

# Windows and WindowsCE need additional libraries
if(WIN32)
if(WINCE)
set(SYSLIBS ${SYSLIBS} "ws2.lib" "iphlpapi.lib")
else()
else()
set(SYSLIBS ${SYSLIBS} "ws2_32.lib" "iphlpapi.lib")
endif()
endif()
endif(WIN32)

add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
Expand Down
6 changes: 6 additions & 0 deletions NetSSL_OpenSSL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions NetSSL_Win/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions PDF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,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

Expand Down
6 changes: 6 additions & 0 deletions Redis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions SevenZip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down
6 changes: 6 additions & 0 deletions Util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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
Expand Down
6 changes: 6 additions & 0 deletions XML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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)
Expand Down
6 changes: 6 additions & 0 deletions Zip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
Expand Down

0 comments on commit 545b7d7

Please sign in to comment.