@@ -14,28 +14,8 @@ endif()
1414include (CheckLibraryExists )
1515
1616find_package (ament_cmake REQUIRED )
17- find_package (ament_cmake_python REQUIRED )
1817find_package (ament_cmake_ros_core REQUIRED )
1918
20- # By default, without the settings below, find_package(Python3) will attempt
21- # to find the newest python version it can, and additionally will find the
22- # most specific version. For instance, on a system that has
23- # /usr/bin/python3.10, /usr/bin/python3.11, and /usr/bin/python3, it will find
24- # /usr/bin/python3.11, even if /usr/bin/python3 points to /usr/bin/python3.10.
25- # The behavior we want is to prefer the "system" installed version unless the
26- # user specifically tells us othewise through the Python3_EXECUTABLE hint.
27- # Setting CMP0094 to NEW means that the search will stop after the first
28- # python version is found. Setting Python3_FIND_UNVERSIONED_NAMES means that
29- # the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that
30- # latter functionality is only available in CMake 3.20 or later, so we need
31- # at least that version.
32- cmake_policy (SET CMP0094 NEW )
33- set (Python3_FIND_UNVERSIONED_NAMES FIRST)
34-
35- find_package (Python3 REQUIRED COMPONENTS Interpreter )
36-
37- ament_python_install_package (${PROJECT_NAME } )
38-
3919if (UNIX AND NOT APPLE )
4020 include (cmake/check_c_compiler_uses_glibc.cmake )
4121 check_c_compiler_uses_glibc (USES_GLIBC )
@@ -99,46 +79,11 @@ set_source_files_properties(
9979 ${rcutils_sources}
10080 PROPERTIES language "C" )
10181
102- # "watch" template/inputs for changes
103- configure_file (
104- "resource/logging_macros.h.em"
105- "logging_macros.h.em.watch"
106- COPYONLY )
107- configure_file (
108- "rcutils/logging.py"
109- "logging.py.watch"
110- COPYONLY )
111- # generate header with logging macros
112- set (rcutils_module_path ${CMAKE_CURRENT_SOURCE_DIR } )
113- set (python_code
114- "import em" # implicitly added ; between python statements due to CMake list
115- "\
116- em.invoke( \
117- [ \
118- '-o', 'include/rcutils/logging_macros.h', \
119- '-D', 'rcutils_module_path=\" ${rcutils_module_path} \" ', \
120- '${CMAKE_CURRENT_SOURCE_DIR } /resource/logging_macros.h.em' \
121- ] \
122- )" )
123- string (REPLACE ";" "$<SEMICOLON >" python_code "${python_code} " )
124- add_custom_command (OUTPUT include /rcutils/logging_macros.h
125- COMMAND ${CMAKE_COMMAND } -E make_directory "include/rcutils"
126- COMMAND Python3::Interpreter ARGS -c "${python_code} "
127- DEPENDS
128- "${CMAKE_CURRENT_BINARY_DIR } /logging_macros.h.em.watch"
129- "${CMAKE_CURRENT_BINARY_DIR } /logging.py.watch"
130- COMMENT "Expanding logging_macros.h.em"
131- VERBATIM
132- )
133- list (APPEND rcutils_sources
134- include /rcutils/logging_macros.h)
135-
13682add_library (
13783 ${PROJECT_NAME }
13884 ${rcutils_sources} )
13985target_include_directories (${PROJECT_NAME } PUBLIC
14086 "$<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } /include >"
141- "$<BUILD_INTERFACE :${CMAKE_CURRENT_BINARY_DIR } /include >"
14287 "$<INSTALL_INTERFACE :include /${PROJECT_NAME } >" )
14388
14489# Causes the visibility macros to use dllexport rather than dllimport,
@@ -166,7 +111,6 @@ if(BUILD_TESTING)
166111
167112 find_package (ament_cmake_gmock REQUIRED )
168113 find_package (ament_cmake_gtest REQUIRED )
169- find_package (ament_cmake_pytest REQUIRED )
170114 find_package (ament_lint_auto REQUIRED )
171115 # cppcheck 1.90 doesn't understand some of the syntax in remove_noexcept.hpp
172116 # Since we already have cppcheck disabled on Linux, just disable it completely
@@ -185,27 +129,6 @@ if(BUILD_TESTING)
185129 ament_export_link_flags ("-latomic" )
186130 endif ()
187131
188- if (ament_cmake_cppcheck_FOUND)
189- ament_cppcheck (
190- TESTNAME "cppcheck_logging_macros"
191- "${CMAKE_CURRENT_BINARY_DIR } /include/rcutils/logging_macros.h" )
192- endif ()
193- if (ament_cmake_cpplint_FOUND)
194- ament_cpplint (
195- TESTNAME "cpplint_logging_macros"
196- # the generated code might contain longer lines for templated types
197- MAX_LINE_LENGTH 999
198- ROOT "${CMAKE_CURRENT_BINARY_DIR } /include"
199- "${CMAKE_CURRENT_BINARY_DIR } /include/rcutils/logging_macros.h" )
200- endif ()
201- if (ament_cmake_uncrustify_FOUND)
202- ament_uncrustify (
203- TESTNAME "uncrustify_logging_macros"
204- # the generated code might contain longer lines for templated types
205- MAX_LINE_LENGTH 0
206- "${CMAKE_CURRENT_BINARY_DIR } /include/rcutils/logging_macros.h" )
207- endif ()
208-
209132 find_package (mimick_vendor REQUIRED )
210133
211134 find_package (osrf_testing_tools_cpp REQUIRED )
@@ -629,5 +552,5 @@ ament_export_dependencies(ament_cmake)
629552ament_package ()
630553
631554install (
632- DIRECTORY include/ ${ CMAKE_CURRENT_BINARY_DIR } /include/
555+ DIRECTORY include/
633556 DESTINATION include/${PROJECT_NAME } )
0 commit comments