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

Revert CMakeLists.txt but use but use ${Protobuf_PROTOC_EXECUTABLE}

parent ff93845d
No related branches found
No related tags found
2 merge requests!61Release 0.3.0,!53Add vcpkg support
Pipeline #53981 passed
Pipeline: caosdb-julialib

#53984

    Pipeline: CaosDB Octave library

    #53983

      Pipeline: caosdb-cppinttest

      #53982

        This commit is part of merge request !53. Comments created here will be created in the context of that merge request.
        ...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
        cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
        set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
        CACHE STRING "Vcpkg toolchain file")
        set(libcaosdb_VERSION 0.3.0) set(libcaosdb_VERSION 0.3.0)
        set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0) set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0)
        set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 9) set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 9)
        ...@@ -79,95 +76,76 @@ set(PROJECT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include") ...@@ -79,95 +76,76 @@ set(PROJECT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
        add_subdirectory(src) add_subdirectory(src)
        add_subdirectory(include) add_subdirectory(include)
        add_subdirectory(doc) add_subdirectory(doc)
        add_subdirectory(proto)
        #################################################################### ####################################################################
        ### CODE GENERATION (WITH GRPC) ### CODE GENERATION (WITH GRPC)
        #################################################################### ####################################################################
        # TODO: Replace this with the protobuf_generate_cpp function find_package(Protobuf CONFIG REQUIRED)
        # # 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) # Protobuf/Grpc source files
        # list(APPEND PROTO_FILES set(PROTO_FILES
        # ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/acm/v1alpha1/main.proto ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto
        # ) ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto
        # ENDIF() )
        # find_package(protobuf REQUIRED) IF (BUILD_ACM)
        # include_directories(${Protobuf_INCLUDE_DIRS}) list(APPEND PROTO_FILES
        # include_directories(${CMAKE_CURRENT_BINARY_DIR}) ${PROJECT_SOURCE_DIR}/proto/proto/caosdb/acm/v1alpha1/main.proto
        # # 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) ENDIF()
        # 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) set(PROTO_PATH ${PROJECT_SOURCE_DIR}/proto/proto)
        set(_PROTOBUF_PROTOC ${Protobuf_PROTOC_EXECUTABLE})
        # compiler binaries # compiler binaries
        IF (WIN32)
        set(_GRPC_CPP_PLUGIN_EXECUTABLE "${CMAKE_BINARY_DIR}/build_tools/grpc_cpp_plugin.exe")
        ELSE()
        set(_GRPC_CPP_PLUGIN_EXECUTABLE "${CMAKE_BINARY_DIR}/build_tools/grpc_cpp_plugin")
        ENDIF()
        # Generated sources
        list(LENGTH PROTO_FILES len_proto_files)
        # IF (WIN32) math(EXPR len_proto_files "${len_proto_files} - 1")
        # set(_PROTOBUF_PROTOC "${CMAKE_BINARY_DIR}/build_tools/protoc.exe") foreach(i RANGE "${len_proto_files}")
        # set(_GRPC_CPP_PLUGIN_EXECUTABLE "${CMAKE_BINARY_DIR}/build_tools/grpc_cpp_plugin.exe") list(GET PROTO_FILES ${i} next_proto_file)
        # ELSE()
        # set(_PROTOBUF_PROTOC "${CMAKE_BINARY_DIR}/build_tools/protoc") # strip away the prefix path and the ".proto" suffix
        # set(_GRPC_CPP_PLUGIN_EXECUTABLE "${CMAKE_BINARY_DIR}/build_tools/grpc_cpp_plugin") string(REPLACE
        # ENDIF() "${PROJECT_SOURCE_DIR}/proto/proto/caosdb/"
        ""
        # # Generated sources next_proto_module
        # list(LENGTH PROTO_FILES len_proto_files) "${next_proto_file}")
        # math(EXPR len_proto_files "${len_proto_files} - 1") string(REPLACE
        # foreach(i RANGE "${len_proto_files}") ".proto"
        # list(GET PROTO_FILES ${i} next_proto_file) ""
        next_proto_module
        # # strip away the prefix path and the ".proto" suffix "${next_proto_module}")
        # string(REPLACE set(next_proto_src
        # "${PROJECT_SOURCE_DIR}/proto/proto/caosdb/" "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.pb.cc")
        # "" set(next_proto_hdr
        # next_proto_module "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.pb.h")
        # "${next_proto_file}") set(next_grpc_src
        # string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.grpc.pb.cc")
        # ".proto" set(next_grpc_hdr
        # "" "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.grpc.pb.h")
        # next_proto_module list(APPEND GRPC_GENERATED_HEADERS "${next_proto_hdr}" "${next_grpc_hdr}")
        # "${next_proto_module}") list(APPEND GRPC_GENERATED_SOURCES "${next_proto_src}" "${next_grpc_src}")
        # set(next_proto_src endforeach()
        # "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.pb.cc")
        # set(next_proto_hdr set(GRPC_GENERATED
        # "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.pb.h") ${GRPC_GENERATED_SOURCES}
        # set(next_grpc_src ${GRPC_GENERATED_HEADERS})
        # "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.grpc.pb.cc") add_custom_command(
        # set(next_grpc_hdr OUTPUT ${GRPC_GENERATED}
        # "${CMAKE_CURRENT_BINARY_DIR}/include/caosdb/${next_proto_module}.grpc.pb.h") COMMAND ${_PROTOBUF_PROTOC}
        # list(APPEND GRPC_GENERATED_HEADERS "${next_proto_hdr}" "${next_grpc_hdr}") ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}/include"
        # list(APPEND GRPC_GENERATED_SOURCES "${next_proto_src}" "${next_grpc_src}") --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/include"
        # endforeach() -I "${PROTO_PATH}"
        --plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
        # set(GRPC_GENERATED ${PROTO_FILES}
        # ${GRPC_GENERATED_SOURCES} DEPENDS ${PROTO_FILES})
        # ${GRPC_GENERATED_HEADERS})
        # add_custom_command(
        # OUTPUT ${GRPC_GENERATED}
        # 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="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
        # ${PROTO_FILES}
        # DEPENDS ${PROTO_FILES})
        # show generated files # show generated files
        message(DEBUG "GRPC_GENERATED: ${GRPC_GENERATED}") message(DEBUG "GRPC_GENERATED: ${GRPC_GENERATED}")
        ...@@ -183,32 +161,9 @@ message(DEBUG "GRPC_GENERATED: ${GRPC_GENERATED}") ...@@ -183,32 +161,9 @@ message(DEBUG "GRPC_GENERATED: ${GRPC_GENERATED}")
        ############################################################################### ###############################################################################
        find_package(gRPC CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED)
        # find_package(protobuf CONFIG REQUIRED)
        # boost
        find_package(Boost 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) find_package(GTest REQUIRED)
        set(dependencies
        gRPC::gpr gRPC::grpc gRPC::grpc++ protobuf::libprotoc protobuf::libprotobuf
        Boost::filesystem Boost::json Boost::log Boost::thread)
        # print include directories for debugging # print include directories for debugging
        message(DEBUG "CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") message(DEBUG "CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}")
        message(DEBUG "PROTOBUF_INCLUDE_DIRS: ${PROTOBUF_INCLUDE_DIRS}") message(DEBUG "PROTOBUF_INCLUDE_DIRS: ${PROTOBUF_INCLUDE_DIRS}")
        ...@@ -242,7 +197,7 @@ else() ...@@ -242,7 +197,7 @@ else()
        add_library(caosdb add_library(caosdb
        SHARED ${libcaosdb_INCL} ${libcaosdb_SRC} ${GRPC_GENERATED}) SHARED ${libcaosdb_INCL} ${libcaosdb_SRC} ${GRPC_GENERATED})
        target_link_libraries(caosdb target_link_libraries(caosdb
        ${dependencies} grpc::grpc protobuf::protobuf boost::boost
        stdc++fs stdc++fs
        ) )
        set(LIBCAOSDB caosdb) set(LIBCAOSDB caosdb)
        ...@@ -259,54 +214,54 @@ target_include_directories(caosdb PUBLIC ...@@ -259,54 +214,54 @@ target_include_directories(caosdb PUBLIC
        # # libccaosdb # libccaosdb
        # # ---------- # ----------
        # add_library(ccaosdb SHARED src/ccaosdb.cpp) add_library(ccaosdb SHARED src/ccaosdb.cpp)
        # target_link_libraries(ccaosdb target_link_libraries(ccaosdb
        # dependencies grpc::grpc protobuf::protobuf boost::boost
        # ${LIBCAOSDB} ${LIBCAOSDB}
        # stdc++fs stdc++fs
        # ) )
        # target_include_directories(ccaosdb PUBLIC target_include_directories(ccaosdb 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>
        # $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
        # ) )
        # # ccaosdbcli # ccaosdbcli
        # # ---------- # ----------
        # add_executable(ccaosdbcli EXCLUDE_FROM_ALL src/ccaosdbcli.c) add_executable(ccaosdbcli EXCLUDE_FROM_ALL src/ccaosdbcli.c)
        # target_include_directories(ccaosdbcli PUBLIC target_include_directories(ccaosdbcli 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>
        # $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
        # ) )
        # target_include_directories(ccaosdbcli SYSTEM PUBLIC target_include_directories(ccaosdbcli SYSTEM PUBLIC
        # ${CONAN_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS}
        # ) )
        # target_link_libraries(ccaosdbcli target_link_libraries(ccaosdbcli
        # dependencies grpc::grpc protobuf::protobuf boost::boost
        # ${LIBCAOSDB} ${LIBCAOSDB}
        # ccaosdb ccaosdb
        # ) )
        # # cxxcaosdbcli # cxxcaosdbcli
        # # ------------ # ------------
        # add_executable(cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp) add_executable(cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp)
        # target_include_directories(cxxcaosdbcli PUBLIC target_include_directories(cxxcaosdbcli 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>
        # $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
        # ) )
        # target_include_directories(cxxcaosdbcli SYSTEM PUBLIC target_include_directories(cxxcaosdbcli SYSTEM PUBLIC
        # ${CONAN_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS}
        # ) )
        # target_link_libraries(cxxcaosdbcli target_link_libraries(cxxcaosdbcli
        # ${LIBCAOSDB} ${LIBCAOSDB}
        # dependencies grpc::grpc protobuf::protobuf boost::boost
        # ) )
        ...@@ -314,213 +269,213 @@ target_include_directories(caosdb PUBLIC ...@@ -314,213 +269,213 @@ target_include_directories(caosdb PUBLIC
        ### LINTING with CLANG-TIDY and INCLUDE-WHAT-YOU-USE ### LINTING with CLANG-TIDY and INCLUDE-WHAT-YOU-USE
        ####################################################### #######################################################
        # include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
        # include(CheckCCompilerFlag) include(CheckCCompilerFlag)
        # function(add_compiler_flag flag) function(add_compiler_flag flag)
        # string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" cxx_present) string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" cxx_present)
        # if(cxx_present EQUAL -1) if(cxx_present EQUAL -1)
        # check_cxx_compiler_flag("${flag}" flag_supported) check_cxx_compiler_flag("${flag}" flag_supported)
        # if(flag_supported) if(flag_supported)
        # set(PEDANTIC_CMAKE_CXX_FLAGS "${PEDANTIC_CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE) set(PEDANTIC_CMAKE_CXX_FLAGS "${PEDANTIC_CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
        # endif() endif()
        # unset(flag_supported CACHE) unset(flag_supported CACHE)
        # endif() endif()
        # unset(cxx_present CACHE) unset(cxx_present CACHE)
        # string(FIND "${CMAKE_C_FLAGS}" "${flag}" c_present) string(FIND "${CMAKE_C_FLAGS}" "${flag}" c_present)
        # if(c_present EQUAL -1) if(c_present EQUAL -1)
        # check_cxx_compiler_flag("${flag}" flag_supported) check_cxx_compiler_flag("${flag}" flag_supported)
        # if(flag_supported) if(flag_supported)
        # set(PEDANTIC_CMAKE_C_FLAGS "${PEDANTIC_CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE) set(PEDANTIC_CMAKE_C_FLAGS "${PEDANTIC_CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
        # endif() endif()
        # unset(flag_supported CACHE) unset(flag_supported CACHE)
        # endif() endif()
        # unset(c_present CACHE) unset(c_present CACHE)
        # endfunction() endfunction()
        # option(LINTING "Enable linting with clang-tidy and iwyu when in non-Debug build-type" OFF) option(LINTING "Enable linting with clang-tidy and iwyu when in non-Debug build-type" OFF)
        # if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" OR LINTING) if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" OR LINTING)
        # set(_LINTING ON) set(_LINTING ON)
        # endif() endif()
        # option(SKIP_LINTING "Skip linting even when in Debug build-type" OFF) option(SKIP_LINTING "Skip linting even when in Debug build-type" OFF)
        # if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND SKIP_LINTING) if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND SKIP_LINTING)
        # message(WARNING "Skipping linting due to SKIP_LINTING option") message(WARNING "Skipping linting due to SKIP_LINTING option")
        # set(_LINTING OFF) set(_LINTING OFF)
        # endif() endif()
        # if(_LINTING) if(_LINTING)
        # ### set paranoid compiler flags ### set paranoid compiler flags
        # add_compiler_flag("-Wall") add_compiler_flag("-Wall")
        # add_compiler_flag("-Wextra") add_compiler_flag("-Wextra")
        # add_compiler_flag("-pedantic") add_compiler_flag("-pedantic")
        # # add_compiler_flag("-Werror") # removed until issue #71 is resolved # add_compiler_flag("-Werror") # removed until issue #71 is resolved
        # message(STATUS "PEDANTIC_CMAKE_CXX_FLAGS: [${PEDANTIC_CMAKE_CXX_FLAGS}]") message(STATUS "PEDANTIC_CMAKE_CXX_FLAGS: [${PEDANTIC_CMAKE_CXX_FLAGS}]")
        # set(TARGET_CAOSDB_COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS} ${PEDANTIC_CMAKE_CXX_FLAGS}") set(TARGET_CAOSDB_COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS} ${PEDANTIC_CMAKE_CXX_FLAGS}")
        # set(TARGET_CCAOSDB_COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS} ${PEDANTIC_CMAKE_C_FLAGS}") set(TARGET_CCAOSDB_COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS} ${PEDANTIC_CMAKE_C_FLAGS}")
        # set(TARGET_CXXCAOSDBCLI_COMPILE_FLAGS "${TARGET_CXXCAOSDBCLI_COMPILE_FLAGS} ${PEDANTIC_CMAKE_CXX_FLAGS}") set(TARGET_CXXCAOSDBCLI_COMPILE_FLAGS "${TARGET_CXXCAOSDBCLI_COMPILE_FLAGS} ${PEDANTIC_CMAKE_CXX_FLAGS}")
        # set(TARGET_CCAOSDBCLI_COMPILE_FLAGS "${TARGET_CCAOSDBCLI_COMPILE_FLAGS} ${PEDANTIC_CMAKE_C_FLAGS}") set(TARGET_CCAOSDBCLI_COMPILE_FLAGS "${TARGET_CCAOSDBCLI_COMPILE_FLAGS} ${PEDANTIC_CMAKE_C_FLAGS}")
        # set_target_properties(caosdb PROPERTIES set_target_properties(caosdb PROPERTIES
        # COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS}") COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS}")
        # set_target_properties(ccaosdb PROPERTIES set_target_properties(ccaosdb PROPERTIES
        # COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS}") COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS}")
        # set_target_properties(cxxcaosdbcli PROPERTIES set_target_properties(cxxcaosdbcli PROPERTIES
        # COMPILE_FLAGS "${TARGET_CXXCAOSDBCLI_COMPILE_FLAGS}") COMPILE_FLAGS "${TARGET_CXXCAOSDBCLI_COMPILE_FLAGS}")
        # set_target_properties(ccaosdbcli PROPERTIES set_target_properties(ccaosdbcli PROPERTIES
        # COMPILE_FLAGS "${TARGET_CCAOSDBCLI_COMPILE_FLAGS}") COMPILE_FLAGS "${TARGET_CCAOSDBCLI_COMPILE_FLAGS}")
        # find_program(iwyu find_program(iwyu
        # NAMES include-what-you-use iwyu NAMES include-what-you-use iwyu
        # PATHS ${CMAKE_SOURCE_DIR}/tools/include-what-you-use/${iwyu_os}/bin) PATHS ${CMAKE_SOURCE_DIR}/tools/include-what-you-use/${iwyu_os}/bin)
        # if(NOT iwyu) if(NOT iwyu)
        # message(WARNING "include-what-you-use: Not found") message(WARNING "include-what-you-use: Not found")
        # else() else()
        # message(STATUS "include-what-you-use: ${iwyu}") message(STATUS "include-what-you-use: ${iwyu}")
        # set(_CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${iwyu} set(_CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${iwyu}
        # "-Xiwyu" "--cxx17ns" "-Xiwyu" "--no_fwd_decls") "-Xiwyu" "--cxx17ns" "-Xiwyu" "--no_fwd_decls")
        # set_target_properties(caosdb PROPERTIES set_target_properties(caosdb PROPERTIES
        # CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}" CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
        # ) )
        # set_target_properties(cxxcaosdbcli PROPERTIES set_target_properties(cxxcaosdbcli PROPERTIES
        # CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}" CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
        # ) )
        # set_target_properties(ccaosdbcli PROPERTIES set_target_properties(ccaosdbcli PROPERTIES
        # C_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}" C_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}"
        # ) )
        # endif() endif()
        # find_program(clang_tidy NAMES clang-tidy clang-tidy-11) find_program(clang_tidy NAMES clang-tidy clang-tidy-11)
        # if(NOT clang_tidy) if(NOT clang_tidy)
        # message(WARNING "clang-tidy: Not found") message(WARNING "clang-tidy: Not found")
        # else() else()
        # message(STATUS "clang-tidy: ${clang_tidy}") message(STATUS "clang-tidy: ${clang_tidy}")
        # set(_CMAKE_CXX_CLANG_TIDY_CHECKS set(_CMAKE_CXX_CLANG_TIDY_CHECKS
        # "--checks=*,-fuchsia-*,-llvmlibc-*,-readability-convert-member-functions-to-static,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-else-after-return,-readability-else-after-return,-modernize-use-trailing-return-type,-bugprone-branch-clone,-altera-*,-misc-include-cleaner,-readability-identifier-*,-llvm-include-order,-misc-const-correctness") "--checks=*,-fuchsia-*,-llvmlibc-*,-readability-convert-member-functions-to-static,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-else-after-return,-readability-else-after-return,-modernize-use-trailing-return-type,-bugprone-branch-clone,-altera-*,-misc-include-cleaner,-readability-identifier-*,-llvm-include-order,-misc-const-correctness")
        # set(_CMAKE_C_CLANG_TIDY_CHECKS "${_CMAKE_CXX_CLANG_TIDY_CHECKS}") set(_CMAKE_C_CLANG_TIDY_CHECKS "${_CMAKE_CXX_CLANG_TIDY_CHECKS}")
        # set(_CMAKE_CXX_CLANG_TIDY "${clang_tidy}" set(_CMAKE_CXX_CLANG_TIDY "${clang_tidy}"
        # "--header-filter=caosdb/.*[^\(\.pb\.h\)]$") "--header-filter=caosdb/.*[^\(\.pb\.h\)]$")
        # # "--warnings-as-errors=*") # "--warnings-as-errors=*")
        # set(_CMAKE_C_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY}") set(_CMAKE_C_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY}")
        # option(AUTO_FIX_LINTING "Append --fix option to clang-tidy" OFF) option(AUTO_FIX_LINTING "Append --fix option to clang-tidy" OFF)
        # if(AUTO_FIX_LINTING) if(AUTO_FIX_LINTING)
        # set(_CMAKE_CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};--fix") set(_CMAKE_CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};--fix")
        # endif() endif()
        # message(STATUS "Using clang-tidy with message(STATUS "Using clang-tidy with
        # '${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}'") '${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}'")
        # set_target_properties(caosdb PROPERTIES set_target_properties(caosdb PROPERTIES
        # CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}" CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}"
        # ) )
        # set_target_properties(cxxcaosdbcli PROPERTIES set_target_properties(cxxcaosdbcli PROPERTIES
        # CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}" CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}"
        # ) )
        # set_target_properties(ccaosdb PROPERTIES set_target_properties(ccaosdb PROPERTIES
        # C_CLANG_TIDY "${_CMAKE_C_CLANG_TIDY};${_CMAKE_C_CLANG_TIDY_CHECKS}" C_CLANG_TIDY "${_CMAKE_C_CLANG_TIDY};${_CMAKE_C_CLANG_TIDY_CHECKS}"
        # ) )
        # set_target_properties(ccaosdbcli PROPERTIES set_target_properties(ccaosdbcli PROPERTIES
        # C_CLANG_TIDY "${_CMAKE_C_CLANG_TIDY};${_CMAKE_C_CLANG_TIDY_CHECKS}" C_CLANG_TIDY "${_CMAKE_C_CLANG_TIDY};${_CMAKE_C_CLANG_TIDY_CHECKS}"
        # ) )
        # endif() endif()
        # endif() endif()
        # ####################################################### #######################################################
        # ### UNIT TEST ### UNIT TEST
        # ####################################################### #######################################################
        # if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
        # enable_testing() enable_testing()
        # add_subdirectory(test) add_subdirectory(test)
        # endif() 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
        # ####################################################### #######################################################
        # option(AUTOFORMATTING "call clang-format at configure time" ON) option(AUTOFORMATTING "call clang-format at configure time" ON)
        # if(AUTOFORMATTING AND NOT SKIP_LINTING) if(AUTOFORMATTING AND NOT SKIP_LINTING)
        # find_program(clang_format NAMES clang-format-11 clang-format) find_program(clang_format NAMES clang-format-11 clang-format)
        # file(GLOB format_test_sources test/*.cpp test/*.h test/*.h.in) file(GLOB format_test_sources test/*.cpp test/*.h test/*.h.in)
        # execute_process(COMMAND ${clang_format} -i --verbose ${libcaosdb_INCL} execute_process(COMMAND ${clang_format} -i --verbose ${libcaosdb_INCL}
        # ${libcaosdb_SRC} ${libcaosdb_TEST_SRC} ${libcaosdb_SRC} ${libcaosdb_TEST_SRC}
        # ${PROJECT_SOURCE_DIR}/src/cxxcaosdbcli.cpp ${PROJECT_SOURCE_DIR}/src/cxxcaosdbcli.cpp
        # ${PROJECT_SOURCE_DIR}/src/ccaosdbcli.c ${PROJECT_SOURCE_DIR}/src/ccaosdbcli.c
        # ${PROJECT_SOURCE_DIR}/src/ccaosdb.cpp ${PROJECT_SOURCE_DIR}/src/ccaosdb.cpp
        # ${PROJECT_SOURCE_DIR}/include/ccaosdb.h ${PROJECT_SOURCE_DIR}/include/ccaosdb.h
        # ${format_test_sources} ${format_test_sources}
        # WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
        # endif() endif()
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment