Skip to content

Commit

Permalink
iox-eclipse-iceoryx#32 adjust CMakeLists.txt to be able to use cmake 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jun 25, 2020
1 parent 1dea2bc commit 3185030
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 52 deletions.
2 changes: 1 addition & 1 deletion cmake/cpptoml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
62 changes: 14 additions & 48 deletions iceoryx_meta/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_dds_gateway ${CMAKE_BINARY_DIR}/iceoryx_dds_gateway)
endif(dds)
2 changes: 1 addition & 1 deletion iceoryx_posh/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_utils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3185030

Please sign in to comment.