Skip to content

Commit

Permalink
iox-eclipse-iceoryx#220 use ICEORYX_CXX_STANDARD for CXX_STANDARD
Browse files Browse the repository at this point in the history
Signed-off-by: Mathias Kraus <[email protected]>
  • Loading branch information
elBoberido committed Nov 23, 2020
1 parent 652f76a commit 0eda296
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
6 changes: 5 additions & 1 deletion iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ add_library(${PROJECT_NAME}
)
add_library(${PROJECT_NAMESPACE}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ endif()

# unittests
add_executable(${PROJECT_PREFIX}_integrationtests ${MODULETESTS_SRC})
set_property(TARGET ${PROJECT_PREFIX}_integrationtests PROPERTY CXX_STANDARD 11)
set_property(TARGET ${PROJECT_PREFIX}_integrationtests PROPERTY CXX_STANDARD ${ICEORYX_CXX_STANDARD})
target_include_directories(${PROJECT_PREFIX}_integrationtests PRIVATE .)
target_compile_options(${PROJECT_PREFIX}_integrationtests PUBLIC -fPIC PRIVATE ${TEST_CXX_FLAGS})
target_link_libraries(${PROJECT_PREFIX}_integrationtests ${TEST_LINK_LIBS})
6 changes: 5 additions & 1 deletion iceoryx_dds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ add_library(iceoryx_dds
)
add_library(${PROJECT_NAMESPACE}::iceoryx_dds ALIAS iceoryx_dds)

target_compile_options(iceoryx_dds PUBLIC -std=c++11)
set_target_properties(iceoryx_utils PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(iceoryx_dds
PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_dds/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif()

# unittests
add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC})
set_property(TARGET ${PROJECT_PREFIX}_moduletests PROPERTY CXX_STANDARD 11)
set_property(TARGET ${PROJECT_PREFIX}_moduletests PROPERTY CXX_STANDARD ${ICEORYX_CXX_STANDARD})
target_include_directories(${PROJECT_PREFIX}_moduletests PRIVATE .)
target_compile_options(${PROJECT_PREFIX}_moduletests PUBLIC -fPIC PRIVATE ${TEST_CXX_FLAGS})
target_link_libraries(${PROJECT_PREFIX}_moduletests ${TEST_LINK_LIBS})
2 changes: 1 addition & 1 deletion iceoryx_utils/testutils/compile_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CompileTest
std::string m_codePrefix;
std::string m_compilerPath = "/usr/bin/g++";
std::string m_includePaths;
std::string m_compilerArguments = " -std=c++11 -xc++ - -o /tmp/funkyDoodle";
std::string m_compilerArguments = " -std=c++14 -xc++ - -o /tmp/funkyDoodle";

std::string m_embeddedFunctionPre = "void UnitTestFunction() {";
std::string m_embeddedFunctionPost = "}; int main() { UnitTestFunction(); }";
Expand Down
26 changes: 17 additions & 9 deletions tools/introspection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@ set(${PROJECT_NAME}_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake
)

add_library(iceoryx_introspection
source/iceoryx_introspection_app.cpp
source/introspection_app.cpp
)
set_property(TARGET iceoryx_introspection PROPERTY CXX_STANDARD 11)
source/iceoryx_introspection_app.cpp
source/introspection_app.cpp
)

add_library(${PROJECT_NAMESPACE}::iceoryx_introspection ALIAS iceoryx_introspection)

set_target_properties(iceoryx_introspection PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)

target_include_directories(iceoryx_introspection
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand All @@ -69,12 +75,14 @@ endif()

target_link_libraries(iceoryx_introspection ${LIB_TINFO})

set_target_properties(iceoryx_introspection
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)

add_executable(iox-introspection-client source/introspection_main.cpp)
set_property(TARGET iox-introspection-client PROPERTY CXX_STANDARD 11)

set_target_properties(iox-introspection-client PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)

target_link_libraries(iox-introspection-client
PRIVATE
Expand Down

0 comments on commit 0eda296

Please sign in to comment.