Skip to content
Snippets Groups Projects
Verified Commit 078ad20c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: conan

parent b4807aad
Branches
Tags
No related merge requests found
Pipeline #9531 failed
......@@ -69,12 +69,12 @@ set_target_properties(caosdb PROPERTIES
CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY}"
CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
)
#add_executable(caosdbcli src/caosdbcli.cpp)
#set_target_properties(caosdbcli PROPERTIES
#CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY}"
#CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
#)
#target_link_libraries(caosdbcli caosdb caosdb_info_v1alpha1 ${CONAN_LIBS})
add_executable(caosdbcli src/caosdbcli.cpp)
set_target_properties(caosdbcli PROPERTIES
CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY}"
CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
)
target_link_libraries(caosdbcli caosdb)
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
# supress warnings during build of gtest
......@@ -89,8 +89,8 @@ endif()
## CODE GENERATION
#option(GRPC_FETCHCONTENT "Fetch and build GRPC from the sources" OFF)
#include(FetchGRPC)
option(GRPC_FETCHCONTENT "Fetch and build GRPC from the sources" OFF)
include(FetchGRPC)
#
# Protobuf/Grpc source files
......@@ -109,11 +109,11 @@ set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${hw_hdrs_path}/mai
set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${hw_hdrs_path}/main.grpc.pb.h")
add_custom_command(
OUTPUT "${hw_proto_srcs}" "${hw_proto_hdrs}" "${hw_grpc_srcs}" "${hw_grpc_hdrs}"
COMMAND ${CMAKE_BINARY_DIR}/build_tools/protoc
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}/include"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}/include"
-I "${PROTO_PATH}"
--plugin=protoc-gen-grpc="${CMAKE_BINARY_DIR}/build_tools/grpc_cpp_plugin"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${PROTO_FILES}"
DEPENDS "${PROTO_FILES}")
......@@ -126,7 +126,9 @@ add_library(caosdb_info_v1alpha1
${hw_proto_srcs}
${hw_proto_hdrs})
target_link_libraries(caosdb_info_v1alpha1
${CONAN_LIBS})
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
target_include_directories(caosdb_info_v1alpha1 PUBLIC
# headers to include when building from source
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
......@@ -135,8 +137,10 @@ target_include_directories(caosdb_info_v1alpha1 PUBLIC
)
target_link_libraries(caosdb
caosdb_info_v1alpha1
${CONAN_LIBS})
caosdb_info_v1alpha1
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
###############################################
......@@ -193,7 +197,7 @@ install(
TARGETS
caosdb
caosdb_info_v1alpha1
#${CONAN_LIBS_GRPC}
${_GRPC_DEPS}
# name of the CMake "export group" containing the targets we want to install
EXPORT caosdbTargets
# Dynamic, static library and include destination locations after running
......
[requires]
boost/1.76.0
grpc/1.38.0
[generators]
cmake
[imports]
bin, protoc* -> ./build_tools
bin, grpc_cpp_plugin* -> ./build_tools
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment