diff --git a/CMakeLists.txt b/CMakeLists.txt index 26de3c71e4f8eede01368fa4913c2c02ced2d169..ba6f058881623355b145876c3b277e1a32fb1f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/conanfile.txt b/conanfile.txt index b5d9a09828a19470c33b7220d0bb340535405e4f..9c597bcf8b3904a5bbbb868e1dba38cc758a2006 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,10 +1,5 @@ [requires] boost/1.76.0 -grpc/1.38.0 [generators] cmake - -[imports] -bin, protoc* -> ./build_tools -bin, grpc_cpp_plugin* -> ./build_tools