Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
keroe committed Sep 13, 2022
1 parent b05cac0 commit 38460c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/mrt_cmake_modules-macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -841,15 +841,18 @@ function(mrt_add_library libname)
endif()
endif()
# generate the header library when testing
if(MRT_ADD_LIBRARY_INCLUDES AND CATKIN_ENABLE_TESTING AND NOT MRT_ADD_LIBARY_NO_HEADER_TESTING AND NOT MRT_NO_HEADER_TESTING)
if(MRT_ADD_LIBRARY_INCLUDES
AND CATKIN_ENABLE_TESTING
AND NOT MRT_ADD_LIBARY_NO_HEADER_TESTING
AND NOT MRT_NO_HEADER_TESTING)
list(LENGTH ${PROJECT_NAME}_GENERATED_LIBRARIES _num) # to estimate how often mrt_add_library was called
set(_header_target ${PROJECT_NAME}-${LIBRARY_NAME}-header-test-${_num})
set(_cpp_file ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/header_test_${_num}.cpp)
set(_content "")
message(STATUS "Adding header compile test with ${MRT_ADD_LIBRARY_INCLUDES}")
foreach(_file ${MRT_ADD_LIBRARY_INCLUDES})
list(APPEND _content "#include \"${_file}\"\n")
message(STATUS ${_content})
message(STATUS ${_content})
endforeach()
list(APPEND _content "int main(){}\n")
file(WRITE ${_cpp_file} ${_content})
Expand Down

0 comments on commit 38460c7

Please sign in to comment.