aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/libprotobuf-lite.cmake7
-rw-r--r--cmake/libprotobuf.cmake6
-rw-r--r--cmake/libprotoc.cmake6
-rw-r--r--cmake/protoc.cmake6
4 files changed, 20 insertions, 5 deletions
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 044c08b7..06621cb8 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -48,9 +48,12 @@ set(libprotobuf_lite_includes
${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h
)
+set(libprotobuf_lite_rc_files
+ ${CMAKE_CURRENT_BINARY_DIR}/version.rc
+)
+
add_library(libprotobuf-lite ${protobuf_SHARED_OR_STATIC}
- ${libprotobuf_lite_files} ${libprotobuf_lite_includes}
- ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+ ${libprotobuf_lite_files} ${libprotobuf_lite_includes} ${libprotobuf_lite_rc_files})
target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
if(MSVC AND protobuf_BUILD_SHARED_LIBS)
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index 65d05c19..a1fdf7c0 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -112,8 +112,12 @@ set(libprotobuf_includes
${protobuf_source_dir}/src/google/protobuf/wrappers.pb.h
)
+set(libprotobuf_rc_files
+ ${CMAKE_CURRENT_BINARY_DIR}/version.rc
+)
+
add_library(libprotobuf ${protobuf_SHARED_OR_STATIC}
- ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes})
+ ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes} ${libprotobuf_rc_files})
target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT})
if(protobuf_WITH_ZLIB)
target_link_libraries(libprotobuf ${ZLIB_LIBRARIES})
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index ec6958bc..2d8b2322 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -161,6 +161,10 @@ set(libprotoc_headers
${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.h
)
+set(libprotoc_rc_files
+ ${CMAKE_CURRENT_BINARY_DIR}/version.rc
+)
+
set(js_well_known_types_sources
${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/any.js
${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/struct.js
@@ -174,7 +178,7 @@ add_custom_command(
)
add_library(libprotoc ${protobuf_SHARED_OR_STATIC}
- ${libprotoc_files} ${libprotoc_headers})
+ ${libprotoc_files} ${libprotoc_headers} ${libprotoc_rc_files})
target_link_libraries(libprotoc libprotobuf)
if(MSVC AND protobuf_BUILD_SHARED_LIBS)
target_compile_definitions(libprotoc
diff --git a/cmake/protoc.cmake b/cmake/protoc.cmake
index 13537665..9bf6f5a9 100644
--- a/cmake/protoc.cmake
+++ b/cmake/protoc.cmake
@@ -2,7 +2,11 @@ set(protoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/main.cc
)
-add_executable(protoc ${protoc_files} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+set(protoc_rc_files
+ ${CMAKE_CURRENT_BINARY_DIR}/version.rc
+)
+
+add_executable(protoc ${protoc_files} ${protoc_rc_files})
target_link_libraries(protoc libprotobuf libprotoc)
add_executable(protobuf::protoc ALIAS protoc)