aboutsummaryrefslogtreecommitdiff
path: root/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-20 13:37:38 -0700
committerGitHub <noreply@github.com>2018-08-20 13:37:38 -0700
commit5d38db4d514d41f8e1caceb2e20c2a6dfbc736b3 (patch)
tree6ade1f2bc31308c4c11116e4edd5a6fe02fc2638 /cmake/CMakeLists.txt
parent859405a62b5058c0352dc608a7fd887f29f48afe (diff)
parentd2c35ce4cb6ff767712a879f6bfad9d50ada577d (diff)
downloadprotobuf-5d38db4d514d41f8e1caceb2e20c2a6dfbc736b3.tar.gz
protobuf-5d38db4d514d41f8e1caceb2e20c2a6dfbc736b3.tar.bz2
protobuf-5d38db4d514d41f8e1caceb2e20c2a6dfbc736b3.zip
Merge pull request #5048 from jozefizso/fix/4579_backport_for_3.6.x3.6.x
Include version information in Windows binaries (backport #4579 for 3.6.x)
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r--cmake/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 02174e96..ada9dc25 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -166,12 +166,23 @@ if (MSVC)
add_definitions(/bigobj)
string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR})
string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR})
+ string(REPLACE "." "," protobuf_RC_FILEVERSION "${protobuf_VERSION}")
configure_file(extract_includes.bat.in extract_includes.bat)
# Suppress linker warnings about files with no symbols defined.
set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)
+
+ # Configure Resource Compiler
+ enable_language(RC)
+ # use English language (0x409) in resource compiler
+ set(rc_flags "/l0x409")
+ # fix rc.exe invocations because of usage of add_definitions()
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_flags} <DEFINES> /fo<OBJECT> <SOURCE>")
+
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
endif (MSVC)
+
get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH)
include_directories(