Skip to content

Commit

Permalink
iox-eclipse-iceoryx#433 cleanup endif() in cmake
Browse files Browse the repository at this point in the history
Signed-off-by: Dietrich Krönke <[email protected]>
  • Loading branch information
dkroenke committed Dec 22, 2020
1 parent ed13d34 commit f5a7587
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion cmake/cpptoml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if(WIN32)
set(CREATE_PATH_COMMAND mkdir)
else()
set(CREATE_PATH_COMMAND mkdir -p)
endif(WIN32)
endif()

# set download config, source and build paths
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/cpptoml/download)
Expand Down
2 changes: 1 addition & 1 deletion cmake/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ if(BUILD_TEST)
list(APPEND CMAKE_PREFIX_PATH ${INSTALL_DIR})
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE INTERNAL "" FORCE)

endif(BUILD_TEST)
endif()
2 changes: 1 addition & 1 deletion iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE ${ICEORYX_WARNINGS} ${ICEORYX_SAN
#
if(BUILD_TEST)
add_subdirectory(test)
endif(BUILD_TEST)
endif()

#
########## export library ##########
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_dds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(USE_CYCLONE_DDS)
message(INFO " Using CycloneDDS stack")
find_package(CycloneDDS CONFIG REQUIRED)
find_package(CycloneDDS-CXX CONFIG REQUIRED)
endif(USE_CYCLONE_DDS)
endif()

#
########## build building-block library ##########
Expand Down Expand Up @@ -145,7 +145,7 @@ set_target_properties(iox-gw-iceoryx2dds iox-gw-dds2iceoryx iceoryx_dds
#
if(BUILD_TEST)
add_subdirectory(test)
endif(BUILD_TEST)
endif()

#
########## export library ##########
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/ice_multi_publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh
CXX_STANDARD)
if(NOT ICEORYX_CXX_STANDARD)
include(IceoryxPlatform)
endif(NOT ICEORYX_CXX_STANDARD)
endif()

add_executable(iox-multi-publisher ./ice_multi_publisher.cpp)
target_link_libraries(iox-multi-publisher iceoryx_posh::iceoryx_posh)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/icedelivery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ find_package(iceoryx_posh CONFIG REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(iox-ex-publisher-typed ./iox_publisher_typed.cpp)
target_link_libraries(iox-ex-publisher-typed
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/icedelivery_on_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ find_package(iceoryx_binding_c CONFIG REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(iox-c-publisher ./ice_c_publisher.c)
set_source_files_properties(./ice_c_publisher.c PROPERTIES LANGUAGE C)
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_examples/iceperf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ find_package(iceoryx_binding_c CONFIG REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(iceperf-laurel iceperf_laurel.cpp base.cpp example_common.cpp iceoryx.cpp iceoryx_c.cpp uds.cpp mq.cpp)

Expand All @@ -34,7 +34,7 @@ target_compile_options(iceperf-laurel PRIVATE ${ICEORYX_WARNINGS} ${ICEORYX_SANI

if(CMAKE_SYSTEM_NAME MATCHES QNX)
target_link_libraries(iceperf-laurel socket)
endif(CMAKE_SYSTEM_NAME MATCHES QNX)
endif()

add_executable(iceperf-hardy iceperf_hardy.cpp base.cpp example_common.cpp iceoryx.cpp iceoryx_c.cpp uds.cpp mq.cpp)

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/singleprocess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ find_package(cpptoml REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(single_process ./single_process.cpp)
target_link_libraries(single_process
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/waitset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ find_package(iceoryx_posh CONFIG REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(iox-ex-waitset-publisher ./ice_waitset_publisher.cpp)
target_link_libraries(iox-ex-waitset-publisher
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_examples/waitset_on_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(iceoryx_binding_c CONFIG REQUIRED)
get_target_property(ICEORYX_CXX_STANDARD iceoryx_posh::iceoryx_posh CXX_STANDARD)
if ( NOT ICEORYX_CXX_STANDARD )
include(IceoryxPlatform)
endif ( NOT ICEORYX_CXX_STANDARD )
endif ()

add_executable(iox-ex-c-waitset-publisher ./ice_c_waitset_publisher.c)
target_link_libraries(iox-ex-c-waitset-publisher
Expand Down
12 changes: 6 additions & 6 deletions iceoryx_meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/tests.cmake)
# ===== Dependencies
if(TOML_CONFIG)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/cpptoml/ ${CMAKE_BINARY_DIR}/dependencies/cpptoml/prebuild)
endif(TOML_CONFIG)
endif()

# ===== Core
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_utils ${CMAKE_BINARY_DIR}/utils)
Expand All @@ -35,18 +35,18 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_posh ${CMAKE_BINARY_DIR}
# ===== Extras
if(INTROSPECTION)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../tools/introspection ${CMAKE_BINARY_DIR}/iceoryx_introspection)
endif(INTROSPECTION)
endif()

# ===== Gateways
if(DDS_GATEWAY)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/cyclonedds ${CMAKE_BINARY_DIR}/dependencies/cyclonedds/prebuild)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_dds ${CMAKE_BINARY_DIR}/iceoryx_dds)
endif(DDS_GATEWAY)
endif()

# ===== Language binding for C
if(BINDING_C)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_binding_c ${CMAKE_BINARY_DIR}/iceoryx_binding_c)
endif(BINDING_C)
endif()

# ===== Examples
if(EXAMPLES)
Expand All @@ -55,11 +55,11 @@ if(EXAMPLES)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/icedelivery_on_c ${CMAKE_BINARY_DIR}/iceoryx_examples/icedelivery_on_c)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/waitset_on_c ${CMAKE_BINARY_DIR}/iceoryx_examples/waitset_on_c)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/iceperf ${CMAKE_BINARY_DIR}/iceoryx_examples/iceperf)
endif(BINDING_C)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/waitset ${CMAKE_BINARY_DIR}/iceoryx_examples/waitset)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/singleprocess ${CMAKE_BINARY_DIR}/iceoryx_examples/singleprocess)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../iceoryx_examples/ice_multi_publisher ${CMAKE_BINARY_DIR}/iceoryx_examples/ice_multi_publisher)
endif(EXAMPLES)
endif()

message("")
message(" Build Properties")
Expand Down
10 changes: 5 additions & 5 deletions iceoryx_meta/build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ if(BUILD_ALL)
set(INTROSPECTION ON)
set(BINDING_C ON)
set(DDS_GATEWAY ON)
endif(BUILD_ALL)
endif()

if(COVERAGE)
set(BUILD_TEST ON)
endif(COVERAGE)
endif()

if(SANITIZE)
set(BUILD_TEST ON)
endif(SANITIZE)
endif()

if(BUILD_TEST)
set(ROUDI_ENVIRONMENT ON)
set(BINDING_C ON)
endif(BUILD_TEST)
endif()

if(EXAMPLES)
set(BINDING_C ON)
endif(EXAMPLES)
endif()

message("")
message(" Configured Options")
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_meta/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ if (BUILD_TEST)
### possible place for more extensions
if (DDS_GATEWAY)
list(APPEND COMPONENTS "dds_gateway")
endif(DDS_GATEWAY)
endif()
if (BINDING_C)
list(APPEND COMPONENTS "binding_c")
endif(BINDING_C)
endif()

### create test targets without Timing tests
foreach(cmp IN ITEMS ${COMPONENTS})
Expand Down Expand Up @@ -72,4 +72,4 @@ if (BUILD_TEST)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
endif(BUILD_TEST)
endif()
16 changes: 8 additions & 8 deletions iceoryx_posh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ if(CLANG_TIDY)
set(PERFORM_CLANG_TIDY "${CLANG_TIDY_EXE}")
else(CLANG_TIDY_EXE)
message(WARNING "clang-tidy activated but unable to find clang-tidy executable")
endif(CLANG_TIDY_EXE)
endif(CLANG_TIDY)
endif()
endif()

#
########## set variables for library export ##########
Expand Down Expand Up @@ -235,7 +235,7 @@ if(PERFORM_CLANG_TIDY)
set_target_properties(
iceoryx_posh_roudi PROPERTIES CXX_CLANG_TIDY "${PERFORM_CLANG_TIDY}"
)
endif(PERFORM_CLANG_TIDY)
endif()

target_include_directories(iceoryx_posh_roudi PRIVATE
source/runtime
Expand Down Expand Up @@ -333,9 +333,9 @@ if(TOML_CONFIG)
set_target_properties(
iox-roudi PROPERTIES CXX_CLANG_TIDY "${PERFORM_CLANG_TIDY}"
)
endif(PERFORM_CLANG_TIDY)
endif()

endif(TOML_CONFIG)
endif()

if(ROUDI_ENVIRONMENT OR BUILD_TEST)
#
Expand Down Expand Up @@ -367,14 +367,14 @@ if(ROUDI_ENVIRONMENT OR BUILD_TEST)

target_compile_options(iceoryx_posh_roudi_environment PRIVATE ${ICEORYX_WARNINGS})

endif(ROUDI_ENVIRONMENT OR BUILD_TEST)
endif()

#
########## exporting library ##########
#
if(TOML_CONFIG)
set(ROUDI_EXPORT iox-roudi)
endif(TOML_CONFIG)
endif()

setup_install_directories_and_export_package(
TARGETS iceoryx_posh iceoryx_posh_roudi iceoryx_posh_config iceoryx_posh_gateway ${ROUDI_EXPORT}
Expand All @@ -389,4 +389,4 @@ install(

if(BUILD_TEST)
add_subdirectory(test)
endif(BUILD_TEST)
endif()
2 changes: 1 addition & 1 deletion iceoryx_posh/cmake/iceoryx_posh_deployment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if(ONE_TO_MANY_ONLY)
message("[i] Using 1:n communication only!")
set(IOX_COMMUNICATION_POLICY OneToManyPolicy)
endif(ONE_TO_MANY_ONLY)
endif()

if(NOT IOX_COMMUNICATION_POLICY)
set(IOX_COMMUNICATION_POLICY ManyToManyPolicy)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/cmake/install_help_and_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ if(TOML_CONFIG)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/etc/iceoryx/roudi_config_example.toml
DESTINATION etc/
COMPONENT dev)
endif(TOML_CONFIG)
endif()
18 changes: 9 additions & 9 deletions iceoryx_utils/cmake/IceoryxPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(UNIX AND NOT APPLE)
elseif(CMAKE_SYSTEM_NAME MATCHES QNX)
set(QNX true)
endif()
endif(UNIX AND NOT APPLE)
endif()

if(LINUX)
set(ICEORYX_CXX_STANDARD 14)
Expand All @@ -29,7 +29,7 @@ elseif(WIN32)
set(ICEORYX_CXX_STANDARD 14)
elseif(APPLE)
set(ICEORYX_CXX_STANDARD 17)
endif(LINUX)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(ICEORYX_WARNINGS PRIVATE ${ICEORYX_WARNINGS} /W1)
Expand All @@ -47,8 +47,8 @@ if(BUILD_STRICT)
set(ICEORYX_WARNINGS ${ICEORYX_WARNINGS} -Werror)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(ICEORYX_WARNINGS ${ICEORYX_WARNINGS} -Werror)
endif ()
endif(BUILD_STRICT)
endif()
endif()

function(iox_create_asan_compile_time_blacklist BLACKLIST_FILE_PATH)
# Suppressing Errors in Recompiled Code (Blacklist)
Expand Down Expand Up @@ -107,7 +107,7 @@ if(SANITIZE)

# unset local variables , to avoid polluting global space
unset(ICEORYX_SANITIZER_BLACKLIST_FILE )
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
endif()

iox_create_asan_runtime_blacklist(${CMAKE_BINARY_DIR}/sanitizer_blacklist/asan_runtime.txt)
iox_create_lsan_runtime_blacklist(${CMAKE_BINARY_DIR}/sanitizer_blacklist/lsan_runtime.txt)
Expand All @@ -129,15 +129,15 @@ if(SANITIZE)
unset(ICEORYX_SANITIZER_BLACKLIST)
unset(ICEORYX_SANITIZER_COMMON_FLAGS)
unset(ICEORYX_ADDRESS_SANITIZER_FLAGS)
else(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
else()
message( FATAL_ERROR "You need to run sanitize with gcc/clang compiler." )
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
endif(SANITIZE)
endif()
endif()

if(COVERAGE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(ICEORYX_SANITIZER_FLAGS -fprofile-arcs -ftest-coverage CACHE INTERNAL "")
else(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message( FATAL_ERROR "You need to run gcov with gcc compiler." )
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif(COVERAGE)
endif()

0 comments on commit f5a7587

Please sign in to comment.