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

Re-enabling install in CMakeLists.txt

- Was temporarily disabled for conan 2
parent 42a61aef
No related branches found
No related tags found
2 merge requests!61Release 0.3.0,!49Resolve "EXTERN: Adapt to Conan 2"
...@@ -162,97 +162,86 @@ find_package(protobuf) ...@@ -162,97 +162,86 @@ find_package(protobuf)
find_package(Boost) find_package(Boost)
find_package(GTest) find_package(GTest)
# libcaosdb
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
add_library(caosdb_grpc SHARED ${GRPC_GENERATED})
add_library(caosdb SHARED ${libcaosdb_INCL} ${libcaosdb_SRC})
target_link_libraries(caosdb caosdb_grpc
grpc::grpc protobuf::protobuf boost::boost gtest::gtest)
set(LIBCAOSDB caosdb caosdb_grpc)
target_include_directories(caosdb_grpc PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(caosdb_grpc SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
else()
add_library(caosdb add_library(caosdb
SHARED ${libcaosdb_INCL} ${libcaosdb_SRC} ${GRPC_GENERATED}) SHARED ${libcaosdb_INCL} ${libcaosdb_SRC} ${GRPC_GENERATED})
set(LIBCAOSDB caosdb) set(LIBCAOSDB caosdb)
endif()
target_link_libraries(caosdb grpc::grpc protobuf::protobuf boost::boost gtest::gtest) target_link_libraries(caosdb
target_link_libraries(caosdb grpc::grpc protobuf::protobuf) grpc::grpc protobuf::protobuf boost::boost gtest::gtest
stdc++fs
)
target_include_directories(caosdb PUBLIC target_include_directories(caosdb PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include> $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include> $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/src> $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
) )
# if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") target_include_directories(caosdb SYSTEM PUBLIC
# add_library(caosdb_grpc SHARED ${GRPC_GENERATED}) ${CONAN_INCLUDE_DIRS}
# add_library(caosdb SHARED ${libcaosdb_INCL} ${libcaosdb_SRC}) )
# target_link_libraries(caosdb caosdb_grpc)
# set(LIBCAOSDB caosdb caosdb_grpc) # libccaosdb
add_library(ccaosdb SHARED src/ccaosdb.cpp)
# target_include_directories(caosdb_grpc PUBLIC target_link_libraries(ccaosdb
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include> grpc::grpc protobuf::protobuf boost::boost gtest::gtest
# $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include> ${LIBCAOSDB}
stdc++fs
# $<INSTALL_INTERFACE:include> )
# ) target_include_directories(ccaosdb PUBLIC
# target_include_directories(caosdb_grpc SYSTEM PUBLIC $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
# ${CONAN_INCLUDE_DIRS} $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
# ) $<INSTALL_INTERFACE:include>
# else() )
# add_library(caosdb
# SHARED ${libcaosdb_INCL} ${libcaosdb_SRC} ${GRPC_GENERATED})
# set(LIBCAOSDB caosdb) # ccaosdbcli
# endif() add_executable(ccaosdbcli EXCLUDE_FROM_ALL src/ccaosdbcli.c)
# target_link_libraries(caosdb target_include_directories(ccaosdbcli PUBLIC
# ${CONAN_LIBS} $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
# stdc++fs $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
# ) $<INSTALL_INTERFACE:include>
# target_include_directories(caosdb PUBLIC )
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include> target_include_directories(ccaosdbcli SYSTEM PUBLIC
# $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include> ${CONAN_INCLUDE_DIRS}
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/src> )
# $<INSTALL_INTERFACE:include>
# ) target_link_libraries(ccaosdbcli
# target_include_directories(caosdb SYSTEM PUBLIC grpc::grpc protobuf::protobuf boost::boost gtest::gtest
# ${CONAN_INCLUDE_DIRS} ${LIBCAOSDB}
# ) ccaosdb
)
# add_library(ccaosdb SHARED src/ccaosdb.cpp)
# target_link_libraries(ccaosdb add_executable(cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp)
# ${CONAN_LIBS} target_include_directories(cxxcaosdbcli PUBLIC
# ${LIBCAOSDB} $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
# stdc++fs $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
# ) $<INSTALL_INTERFACE:include>
# target_include_directories(ccaosdb PUBLIC )
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include> target_include_directories(cxxcaosdbcli SYSTEM PUBLIC
# $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include> ${CONAN_INCLUDE_DIRS}
# $<INSTALL_INTERFACE:include> )
# ) target_link_libraries(cxxcaosdbcli
# target_include_directories(ccaosdb SYSTEM PUBLIC ${LIBCAOSDB}
# ${CONAN_INCLUDE_DIRS} grpc::grpc protobuf::protobuf boost::boost gtest::gtest
# ) )
# add_executable(ccaosdbcli EXCLUDE_FROM_ALL src/ccaosdbcli.c)
# target_include_directories(ccaosdbcli PUBLIC
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
# $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
# $<INSTALL_INTERFACE:include>
# )
# target_include_directories(ccaosdbcli SYSTEM PUBLIC
# ${CONAN_INCLUDE_DIRS}
# )
# target_link_libraries(ccaosdbcli
# ${CONAN_LIBS}
# ${LIBCAOSDB}
# ccaosdb
# )
# add_executable(cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp)
# target_include_directories(cxxcaosdbcli PUBLIC
# $<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
# $<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
# $<INSTALL_INTERFACE:include>
# )
# target_include_directories(cxxcaosdbcli SYSTEM PUBLIC
# ${CONAN_INCLUDE_DIRS}
# )
# target_link_libraries(cxxcaosdbcli
# ${LIBCAOSDB}
# ${CONAN_LIBS}
# )
...@@ -387,72 +376,72 @@ endif() ...@@ -387,72 +376,72 @@ endif()
# ############ INSTALLATION ##################### # ############ INSTALLATION #####################
# ############################################### # ###############################################
# set(libcaosdb_INCLUDE_DEST "include/caosdb") set(libcaosdb_INCLUDE_DEST "include/caosdb")
# set(libcaosdb_LIB_DEST "lib") set(libcaosdb_LIB_DEST "lib")
# set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local/") set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local/")
# install( install(
# # targets to install # targets to install
# TARGETS ${LIBCAOSDB} ccaosdb TARGETS ${LIBCAOSDB} ccaosdb
# # name of the CMake "export group" containing the targets we want to install # name of the CMake "export group" containing the targets we want to install
# EXPORT caosdbTargets EXPORT caosdbTargets
# # Dynamic, static library and include destination locations after running # Dynamic, static library and include destination locations after running
# # "make install" # "make install"
# LIBRARY DESTINATION ${libcaosdb_LIB_DEST} LIBRARY DESTINATION ${libcaosdb_LIB_DEST}
# ARCHIVE DESTINATION ${libcaosdb_LIB_DEST} ARCHIVE DESTINATION ${libcaosdb_LIB_DEST}
# INCLUDES DESTINATION ${libcaosdb_INCLUDE_DEST} INCLUDES DESTINATION ${libcaosdb_INCLUDE_DEST}
# ) )
# set(libcaosdb_CMAKE_DEST "${libcaosdb_LIB_DEST}/cmake/caosdb") set(libcaosdb_CMAKE_DEST "${libcaosdb_LIB_DEST}/cmake/caosdb")
# install( install(
# # The export we want to save (matches name defined above containing the # The export we want to save (matches name defined above containing the
# # install targets) # install targets)
# EXPORT caosdbTargets EXPORT caosdbTargets
# # CMake file in which to store the export's information # CMake file in which to store the export's information
# FILE caosdbTargets.cmake FILE caosdbTargets.cmake
# # Namespace prepends all targets in the export (when we import later, we # Namespace prepends all targets in the export (when we import later, we
# # will use caosdb::caosdb) # will use caosdb::caosdb)
# NAMESPACE caosdb:: NAMESPACE caosdb::
# # where to place the resulting file (here, we're putting it with the library) # where to place the resulting file (here, we're putting it with the library)
# DESTINATION ${libcaosdb_CMAKE_DEST} DESTINATION ${libcaosdb_CMAKE_DEST}
# ) )
# install(FILES ${libcaosdb_INCL} ${PROJECT_SOURCE_DIR}/include/ccaosdb.h DESTINATION ${libcaosdb_INCLUDE_DEST}) install(FILES ${libcaosdb_INCL} ${PROJECT_SOURCE_DIR}/include/ccaosdb.h DESTINATION ${libcaosdb_INCLUDE_DEST})
# foreach(i RANGE "${len_proto_files}") foreach(i RANGE "${len_proto_files}")
# list(GET PROTO_FILES ${i} next_proto_file) list(GET PROTO_FILES ${i} next_proto_file)
# # strip away the prefix path and the ".proto" suffix # strip away the prefix path and the ".proto" suffix
# string(REPLACE string(REPLACE
# "${PROJECT_SOURCE_DIR}/proto/proto/caosdb/" "${PROJECT_SOURCE_DIR}/proto/proto/caosdb/"
# "" ""
# next_proto_module next_proto_module
# "${next_proto_file}") "${next_proto_file}")
# string(REPLACE string(REPLACE
# "/main.proto" "/main.proto"
# "" ""
# next_proto_module next_proto_module
# "${next_proto_module}") "${next_proto_module}")
# set(next_proto_hdr set(next_proto_hdr
# "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}/main.pb.h") "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}/main.pb.h")
# set(next_grpc_hdr set(next_grpc_hdr
# "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}/main.grpc.pb.h") "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}/main.grpc.pb.h")
# install(FILES ${next_proto_hdr} ${next_grpc_hdr} DESTINATION install(FILES ${next_proto_hdr} ${next_grpc_hdr} DESTINATION
# ${libcaosdb_INCLUDE_DEST}/${next_proto_module}) ${libcaosdb_INCLUDE_DEST}/${next_proto_module})
# endforeach() endforeach()
# install(FILES ${PROJECT_SOURCE_DIR}/caosdbConfig.cmake install(FILES ${PROJECT_SOURCE_DIR}/caosdbConfig.cmake
# DESTINATION ${libcaosdb_CMAKE_DEST}) DESTINATION ${libcaosdb_CMAKE_DEST})
# #set_property(TARGET caosdb PROPERTY VERSION ${libcaosdb_VERSION}) #set_property(TARGET caosdb PROPERTY VERSION ${libcaosdb_VERSION})
# include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
# write_basic_package_version_file( write_basic_package_version_file(
# "${PROJECT_SOURCE_DIR}/caosdbConfigVersion.cmake" "${PROJECT_SOURCE_DIR}/caosdbConfigVersion.cmake"
# VERSION ${libcaosdb_VERSION} VERSION ${libcaosdb_VERSION}
# COMPATIBILITY AnyNewerVersion COMPATIBILITY AnyNewerVersion
# ) )
# install(FILES ${PROJECT_SOURCE_DIR}/caosdbConfigVersion.cmake install(FILES ${PROJECT_SOURCE_DIR}/caosdbConfigVersion.cmake
# DESTINATION ${libcaosdb_CMAKE_DEST}) DESTINATION ${libcaosdb_CMAKE_DEST})
####################################################### #######################################################
### code formatting with clang-format ### code formatting with clang-format
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment