diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-05-14 13:47:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 13:47:28 -0700 |
commit | ac34bf8f5935b46119750b50f0c84f8fa7211479 (patch) | |
tree | 5f41d785a1e655f7678ba701ae18209a75ae6d94 /cmake/CMakeLists.txt | |
parent | 394866c00241b44eb2936b6b1e275b36576ea806 (diff) | |
parent | 8233d46207a8f857c8b5735b0b6468721d8e70f1 (diff) |
Merge pull request #4579 from jozefizso/dev/3380_version_info
Include version information in Windows binaries #3380
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r-- | cmake/CMakeLists.txt | 11 |
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( |