diff --git a/cmake/cpptoml/CMakeLists.txt b/cmake/cpptoml/CMakeLists.txt index 56eacfadaf..ec19702324 100644 --- a/cmake/cpptoml/CMakeLists.txt +++ b/cmake/cpptoml/CMakeLists.txt @@ -5,7 +5,7 @@ project(cpptoml-build CXX) set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/cpptoml-download) set(SOURCE_DIR ${CMAKE_BINARY_DIR}/cpptoml-src) set(BUILD_DIR ${CMAKE_BINARY_DIR}/cpptoml-build) -set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) +set(INSTALL_DIR ${CMAKE_BINARY_DIR}/build_dependencies) # Download and unpack cpptoml at configure time configure_file(cpptoml.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt) diff --git a/cmake/googletest/CMakeLists.txt b/cmake/googletest/CMakeLists.txt index e260f6495f..ad08ecec31 100644 --- a/cmake/googletest/CMakeLists.txt +++ b/cmake/googletest/CMakeLists.txt @@ -10,7 +10,7 @@ if(test) set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/googletest-download) set(SOURCE_DIR ${CMAKE_BINARY_DIR}/googletest-src) set(BUILD_DIR ${CMAKE_BINARY_DIR}/googletest-build) - set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) + set(INSTALL_DIR ${CMAKE_BINARY_DIR}/build_dependencies) # Download and unpack googletest at configure time configure_file(googletest.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt) diff --git a/iceoryx_meta/CMakeLists.txt b/iceoryx_meta/CMakeLists.txt index 9d61d60776..f3452af853 100644 --- a/iceoryx_meta/CMakeLists.txt +++ b/iceoryx_meta/CMakeLists.txt @@ -1,71 +1,37 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.5) file (STRINGS "../VERSION" iceoryx_VERSION) project(iceoryx VERSION ${iceoryx_VERSION}) -#uncomment this as soon the ExternalProject install path issue is solved -#if(test) -# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/googletest ${CMAKE_BINARY_DIR}/gtest) -#endif(test) - +option(TOML_CONFIG "activates or deactivates TOML support - without TOML RouDi will not be build" ON) +option(test "Build tests" ON) option(examples "build with iceoryx examples" ON) option(introspection "builds the introspection client which requires the ncurses library with an activated terminfo feature" OFF) option(diagnostic "enables allmost all compiler warnings" OFF) option(dds "enables dds support by compiling the iceoryx dds gateway" OFF) -include(FetchContent) +if(TOML_CONFIG) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/cpptoml/ ${CMAKE_BINARY_DIR}/cpptoml) +endif(TOML_CONFIG) if (diagnostic) add_compile_options(-Wall -W -Wextra -pedantic) endif(diagnostic) -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) if(test) -FetchContent_Declare( - GOOGLETEST - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.10.0 -) -FetchContent_GetProperties(GOOGLETEST) -if (NOT googletest_POPULATED) - message(STATUS "updating: googletest" ) - FetchContent_Populate(GOOGLETEST) - add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) - set(GTest_FOUND true) - add_library(GTest::gtest ALIAS gtest) - add_library(GTest::gmock ALIAS gmock) -endif(NOT googletest_POPULATED) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/googletest ${CMAKE_BINARY_DIR}/googletest) endif(test) -# must be additionally defined here, otherwise TOML_CONFIG is on default off -# and the module is loaded only after the second cmake -Bbuild -Hiceoryx_meta command call -option(TOML_CONFIG "activates or deactivates TOML support - without TOML RouDi will not be build" ON) - -if (TOML_CONFIG ) - FetchContent_Declare( - CPPTOML - GIT_REPOSITORY https://github.com/skystrife/cpptoml - GIT_TAG v0.1.1 - ) - FetchContent_GetProperties(CPPTOML) - if (NOT cpptoml_POPULATED) - message(STATUS "updating: cpptoml" ) - FetchContent_Populate(CPPTOML) - add_subdirectory(${cpptoml_SOURCE_DIR} ${cpptoml_BINARY_DIR}) - set(cpptoml_FOUND true) - endif(NOT cpptoml_POPULATED) -endif(TOML_CONFIG) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_utils ${CMAKE_BINARY_DIR}/iceoryx_utils ) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_posh ${CMAKE_BINARY_DIR}/iceoryx_posh ) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_utils ${CMAKE_BINARY_DIR}/iceoryx_utils) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_posh ${CMAKE_BINARY_DIR}/iceoryx_posh) if (examples) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/icedelivery ${CMAKE_BINARY_DIR}/examples/icedelivery ) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/iceperf ${CMAKE_BINARY_DIR}/examples/iceperf ) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/icedelivery ${CMAKE_BINARY_DIR}/examples/icedelivery) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/iceperf ${CMAKE_BINARY_DIR}/examples/iceperf) endif(examples) if(introspection) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../tools/introspection ${CMAKE_BINARY_DIR}/tools/introspection ) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../tools/introspection ${CMAKE_BINARY_DIR}/tools/introspection) endif(introspection) if(dds) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_dds_gateway ${CMAKE_BINARY_DIR}/iceoryx_dds_gateway ) -endif(dds) \ No newline at end of file + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_dds_gateway ${CMAKE_BINARY_DIR}/iceoryx_dds_gateway) +endif(dds) diff --git a/iceoryx_posh/test/CMakeLists.txt b/iceoryx_posh/test/CMakeLists.txt index acf6a80de1..5603bf1986 100644 --- a/iceoryx_posh/test/CMakeLists.txt +++ b/iceoryx_posh/test/CMakeLists.txt @@ -8,7 +8,7 @@ if(test AND NOT GTest_FOUND) find_package(GTest CONFIG REQUIRED) endif(test AND NOT GTest_FOUND) -set(PROJECT_PREFIX "posh") +set(PROJECT_PREFIX "iceoryx_posh") file(GLOB_RECURSE MODULETESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/moduletests/*.cpp") file(GLOB_RECURSE INTEGRATIONTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/integrationtests/*.cpp") diff --git a/iceoryx_utils/test/CMakeLists.txt b/iceoryx_utils/test/CMakeLists.txt index 07256dc022..93c1ec890b 100644 --- a/iceoryx_utils/test/CMakeLists.txt +++ b/iceoryx_utils/test/CMakeLists.txt @@ -8,7 +8,7 @@ if(test AND NOT GTest_FOUND) find_package(GTest CONFIG REQUIRED) endif(test AND NOT GTest_FOUND) -set(PROJECT_PREFIX "utils") +set(PROJECT_PREFIX "iceoryx_utils") file(GLOB_RECURSE MODULETESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/moduletests/*.cpp") file(GLOB_RECURSE INTEGRATIONTESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/integrationtests/*.cpp")