Skip to content

Commit f0f9d66

Browse files
change protoc output directory
1 parent e5105be commit f0f9d66

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ build
22
CMakeUserPresets.json
33
out
44
.vscode
5-
.vs
5+
.vs
6+
.qodo

protoc-plugin/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ add_compile_options(${HPP_PROTO_COMPILE_OPTIONS})
33
add_executable(protoc-gen-hpp hpp_gen.cpp)
44
add_executable(hpp_proto::protoc-gen-hpp ALIAS protoc-gen-hpp)
55
target_link_libraries(protoc-gen-hpp PRIVATE hpp_proto::libhpp_proto fmt::fmt)
6+
7+
set_target_properties(protoc-gen-hpp
8+
PROPERTIES
9+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../bin"
10+
)
611
install(TARGETS protoc-gen-hpp EXPORT hpp_proto-targets)
712

813
if(MSVC)

tests/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ else()
157157
target_include_directories(any_test_lib SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../include)
158158
protobuf_generate_hpp(
159159
TARGET any_test_lib
160-
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" "${Protobuf_INCLUDE_DIRS}")
160+
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
161161
target_link_libraries(any_test_lib INTERFACE well_known_types)
162162

163163
add_library(non_owning_any_lib INTERFACE
@@ -177,7 +177,7 @@ else()
177177
target_include_directories(non_owning_any_test_lib SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
178178
protobuf_generate_hpp(
179179
TARGET non_owning_any_test_lib
180-
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" "${Protobuf_INCLUDE_DIRS}"
180+
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
181181
PROTOC_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/non_owning"
182182
PLUGIN_OPTIONS "non_owning,root_namespace=non_owning,top_directory=non_owning")
183183

third-parties.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ elseif(HPP_PROTO_PROTOC STREQUAL "compile")
7979
"EXCLUDE_FROM_ALL"
8080
${system_package}
8181
)
82+
set_target_properties(protoc
83+
PROPERTIES
84+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
85+
)
8286
add_executable(protobuf::protoc ALIAS protoc)
8387
set(Protobuf_INCLUDE_DIRS ${protobuf_SOURCE_DIR}/src)
8488
else()

tutorial/non_owning/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ target_include_directories(non_owning_any_demo INTERFACE ${CMAKE_CURRENT_BINARY_
4040
target_link_libraries(non_owning_any_demo INTERFACE non_owning_any)
4141
protobuf_generate_hpp(
4242
TARGET non_owning_any_demo
43-
IMPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/.. ${Protobuf_INCLUDE_DIRS}
43+
IMPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..
4444
PROTOS ../any_demo.proto
4545
PLUGIN_OPTIONS non_owning)
4646

tutorial/regular/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ target_include_directories(any_demo INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
3131
target_link_libraries(any_demo INTERFACE hpp_proto::well_known_types)
3232
protobuf_generate_hpp(
3333
TARGET any_demo
34-
IMPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/.. ${Protobuf_INCLUDE_DIRS})
34+
IMPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..)
3535

3636
add_executable(tutorial_any tutorial_any.cpp)
3737
target_link_libraries(tutorial_any PRIVATE any_demo addressbook_proto3)

0 commit comments

Comments
 (0)