Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1287 Include doc dir for cmake linter, adjust doc…
Browse files Browse the repository at this point in the history
… example to new cmake api

Signed-off-by: Christian Eltzschig <me@elchris.org>
  • Loading branch information
elfenpiff committed May 31, 2022
1 parent 83617d3 commit 984fa20
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 49 deletions.
62 changes: 17 additions & 45 deletions doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,18 @@ include(IceoryxPlatform)
#
########## lib ##########
#
add_library(iceoryx_component
source/example_module/example_base_class.cpp
iox_add_library(
TARGET iceoryx_component
NAMESPACE iceoryx_component
PRIVATE_INCLUDES source/example_module
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/generated/iceoryx/include
INSTALL_INTERFACE include/${PREFIX}
PRIVATE_LIBS ${CMAKE_THREAD_LIBS_INIT}
FILES
source/example_module/example_base_class.cpp
)

add_library(iceoryx_component::iceoryx_component ALIAS iceoryx_component)

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

target_include_directories(iceoryx_component
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated/iceoryx/include>
$<INSTALL_INTERFACE:include/${PREFIX}>
PRIVATE
source/example_module
)
target_link_libraries(iceoryx_component
PRIVATE
${ICEORYX_SANITIZER_FLAGS}
${CMAKE_THREAD_LIBS_INIT}
)

target_compile_options(iceoryx_component PRIVATE ${ICEORYX_WARNINGS} ${ICEORYX_SANITIZER_FLAGS})


#
########## test ##########
#
Expand All @@ -66,27 +48,17 @@ set(PROJECT_PREFIX "iceoryx_component")

file(GLOB_RECURSE MODULETESTS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/test/moduletests/*.cpp")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_PREFIX}/test)

set(TEST_LINK_LIBS
GTest::gtest
GTest::gmock
iceoryx_component::iceoryx_component
)

if(LINUX)
set(TEST_LINK_LIBS ${TEST_LINK_LIBS} dl )
endif()

# unittests
add_executable(${PROJECT_PREFIX}_moduletests ${MODULETESTS_SRC})
target_include_directories(${PROJECT_PREFIX}_moduletests PRIVATE . source/example_module)
# TODO: fix conversion warnings
target_compile_options(${PROJECT_PREFIX}_moduletests PRIVATE ${TEST_CXX_FLAGS})
target_link_libraries(${PROJECT_PREFIX}_moduletests ${TEST_LINK_LIBS})
set_target_properties(${PROJECT_PREFIX}_moduletests PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD ${ICEORYX_CXX_STANDARD}
POSITION_INDEPENDENT_CODE ON
iox_add_executable(
TARGET ${PROJECT_PREFIX}_moduletests
INCLUDE_DIRECTORIES .
source/example_module
FILES ${MODULETESTS_SRC}
LIBS ${TEST_LINK_LIBS}
LIBS_LINUX dl
)

4 changes: 2 additions & 2 deletions iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ iox_make_unique_includedir()
########## build building-block library ##########
#
iox_add_library(
TARGET iceoryx_binding_c
NAMESPACE iceoryx_binding_c
TARGET ${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}
PROJECT_PREFIX ${PREFIX}
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/generated/iceoryx/include
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/cmake/IceoryxPackageHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Macro(iox_add_executable)
iox_set_file_language( FILES ${IOX_FILES} )
endif()

target_compile_options(${IOX_TARGET} ${IOX_WARNINGS} ${ICEORYX_SANITIZER})
target_compile_options(${IOX_TARGET} ${IOX_WARNINGS} ${ICEORYX_SANITIZER_FLAGS})

if ( IOX_STACK_SIZE )
if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/cmake-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ performCmakeLinting()
NUMBER_OF_FILES=$(find $ICEORYX_ROOT_PATH -type f -name "CMakeLists.txt" | grep -v ${ICEORYX_ROOT_PATH}/build | grep -v ${ICEORYX_ROOT_PATH}/.github | grep -v ${ICEORYX_ROOT_PATH}/.git | wc -l)

CURRENT_FILE=0
for FILE in $(find $ICEORYX_ROOT_PATH -type f -iname "CMakeLists.txt" | grep -v ${ICEORYX_ROOT_PATH}/build | grep -v ${ICEORYX_ROOT_PATH}/.github | grep -v ${ICEORYX_ROOT_PATH}/.git | grep -v ${ICEORYX_ROOT_PATH}/doc)
for FILE in $(find $ICEORYX_ROOT_PATH -type f -iname "CMakeLists.txt" | grep -v ${ICEORYX_ROOT_PATH}/build | grep -v ${ICEORYX_ROOT_PATH}/.github | grep -v ${ICEORYX_ROOT_PATH}/.git)
do
let CURRENT_FILE=$CURRENT_FILE+1
echo -e "[$CURRENT_FILE/$NUMBER_OF_FILES] $FILE"
Expand Down

0 comments on commit 984fa20

Please sign in to comment.