diff options
author | Sander Vrijders <[email protected]> | 2016-07-26 13:37:45 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-07-26 14:37:20 +0200 |
commit | 3b1f3f57587bdb2b99934417033b24739fc0182d (patch) | |
tree | 5a823bd04ccd276b69c7faa17c517f8819cb6dd9 | |
parent | bee74baa8fa8ffa71dbb659496bc88df3e8ce6a5 (diff) | |
download | ouroboros-3b1f3f57587bdb2b99934417033b24739fc0182d.tar.gz ouroboros-3b1f3f57587bdb2b99934417033b24739fc0182d.zip |
build: Fix wrong inclusion
The protobuf include directory was not being correctly handed to the
compiler when building. Now the include directory is added
project-wide. And the protobuf package is searched for only once.
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/FindProtobufC.cmake | 2 | ||||
-rw-r--r-- | src/ipcpd/shim-eth-llc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/ipcpd/shim-udp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/lib/CMakeLists.txt | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7404eeb4..1918165c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,9 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) set(LOG_DIR "var/log/ouroboros") install(DIRECTORY DESTINATION ${LOG_DIR}) +find_package(ProtobufC REQUIRED) +include_directories(${PROTOBUF_C_INCLUDE_DIRS}) + add_subdirectory(src) add_subdirectory(include) diff --git a/cmake/FindProtobufC.cmake b/cmake/FindProtobufC.cmake index bfa50110..8c1f23db 100644 --- a/cmake/FindProtobufC.cmake +++ b/cmake/FindProtobufC.cmake @@ -70,3 +70,5 @@ mark_as_advanced(PROTOBUF_PROTOC_C_EXECUTABLE) find_package(PackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ProtobufC DEFAULT_MSG PROTOBUF_C_LIBRARY PROTOBUF_C_INCLUDE_DIR PROTOBUF_PROTOC_C_EXECUTABLE) + +set(PROTOBUF_C_INCLUDE_DIRS ${PROTOBUF_C_INCLUDE_DIR}) diff --git a/src/ipcpd/shim-eth-llc/CMakeLists.txt b/src/ipcpd/shim-eth-llc/CMakeLists.txt index a3f96735..bd9add74 100644 --- a/src/ipcpd/shim-eth-llc/CMakeLists.txt +++ b/src/ipcpd/shim-eth-llc/CMakeLists.txt @@ -12,8 +12,6 @@ include_directories(${CURRENT_BINARY_PARENT_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) -find_package(ProtobufC REQUIRED) -include_directories(${PROTOBUF_INCLUDE_DIRS}) protobuf_generate_c(SHIM_ETH_LLC_PROTO_SRCS SHIM_ETH_LLC_PROTO_HDRS shim_eth_llc_messages.proto) diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/shim-udp/CMakeLists.txt index 6430661c..71f9e1d1 100644 --- a/src/ipcpd/shim-udp/CMakeLists.txt +++ b/src/ipcpd/shim-udp/CMakeLists.txt @@ -12,8 +12,6 @@ include_directories(${CURRENT_BINARY_PARENT_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) -find_package(ProtobufC REQUIRED) -include_directories(${PROTOBUF_INCLUDE_DIRS}) protobuf_generate_c(SHIM_UDP_PROTO_SRCS SHIM_UDP_PROTO_HDRS shim_udp_messages.proto) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index a440f7be..5e16c7e2 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) -find_package(ProtobufC REQUIRED) -include_directories(${PROTOBUF_INCLUDE_DIRS}) protobuf_generate_c(IRM_PROTO_SRCS IRM_PROTO_HDRS irmd_messages.proto) protobuf_generate_c(IPCP_PROTO_SRCS IPCP_PROTO_HDRS ipcpd_messages.proto) protobuf_generate_c(DIF_CONFIG_PROTO_SRCS DIF_CONFIG_PROTO_HDRS |