Skip to content
Snippets Groups Projects
Commit ff93845d authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

WIP: Fix boost components to be compatible with both vcpkg and conan

parent c168bec6
No related branches found
No related tags found
2 merge requests!61Release 0.3.0,!53Add vcpkg support
Pipeline #53855 failed
......@@ -79,6 +79,8 @@ set(PROJECT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
add_subdirectory(src)
add_subdirectory(include)
add_subdirectory(doc)
add_subdirectory(proto)
####################################################################
### CODE GENERATION (WITH GRPC)
......@@ -87,29 +89,29 @@ add_subdirectory(doc)
# TODO: Replace this with the protobuf_generate_cpp function
# Protobuf/Grpc source files
set(PROTO_FILES
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto
)
# # Protobuf/Grpc source files
# set(PROTO_FILES
# ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto
# ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto
# )
IF (BUILD_ACM)
list(APPEND PROTO_FILES
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/acm/v1alpha1/main.proto
)
ENDIF()
# IF (BUILD_ACM)
# list(APPEND PROTO_FILES
# ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/acm/v1alpha1/main.proto
# )
# ENDIF()
find_package(protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto)
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto)
message(STATUS "PROTO_FILES: ${PROTO_FILES}")
message(STATUS "PROTO_SRCS: ${PROTO_SRCS}")
message(STATUS "PROTO_HDRS: ${PROTO_HDRS}")
# find_package(protobuf REQUIRED)
# include_directories(${Protobuf_INCLUDE_DIRS})
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
# # protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
# # protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto)
# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto)
# message(STATUS "PROTO_FILES: ${PROTO_FILES}")
# message(STATUS "PROTO_SRCS: ${PROTO_SRCS}")
# message(STATUS "PROTO_HDRS: ${PROTO_HDRS}")
# set(PROTO_PATH ${PROJECT_SOURCE_DIR}/proto/proto)
......@@ -184,12 +186,20 @@ find_package(gRPC CONFIG REQUIRED)
# find_package(protobuf CONFIG REQUIRED)
# boost
find_package(boost_smart_ptr CONFIG REQUIRED)
find_package(boost_filesystem CONFIG REQUIRED)
find_package(boost_json CONFIG REQUIRED)
find_package(boost_log CONFIG REQUIRED)
find_package(boost_thread CONFIG REQUIRED)
find_package(boost_beast CONFIG REQUIRED)
find_package(Boost REQUIRED)
# find_package(boost_smart_ptr CONFIG REQUIRED)
# find_package(boost_filesystem CONFIG REQUIRED)
# find_package(boost_json CONFIG REQUIRED)
# find_package(boost_log CONFIG REQUIRED)
# find_package(boost_thread CONFIG REQUIRED)
# find_package(boost_beast CONFIG REQUIRED)
find_package(Boost COMPONENTS json REQUIRED)
find_package(Boost COMPONENTS filesystem REQUIRED)
find_package(Boost COMPONENTS log REQUIRED)
find_package(Boost COMPONENTS thread REQUIRED)
find_package(Boost COMPONENTS system REQUIRED)
# find_package(Boost COMPONENTS smart_ptr REQUIRED)
find_package(Boost COMPONENTS beast REQUIRED)
find_package(GTest REQUIRED)
......@@ -197,7 +207,7 @@ find_package(GTest REQUIRED)
set(dependencies
gRPC::gpr gRPC::grpc gRPC::grpc++ protobuf::libprotoc protobuf::libprotobuf
Boost::beast Boost::smart_ptr Boost::filesystem Boost::json Boost::log Boost::thread)
Boost::filesystem Boost::json Boost::log Boost::thread)
# print include directories for debugging
message(DEBUG "CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment