|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +find_package(python_cmake_module REQUIRED) |
| 16 | +find_package(PythonExtra REQUIRED) |
15 | 17 | find_package(rmw REQUIRED)
|
16 | 18 | find_package(rosidl_runtime_c REQUIRED)
|
17 | 19 | find_package(rosidl_typesupport_c REQUIRED)
|
18 | 20 | find_package(rosidl_typesupport_interface REQUIRED)
|
19 | 21 |
|
20 |
| -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) |
21 |
| -if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug") |
22 |
| - get_filename_component(_python_executable_dir "${Python3_EXECUTABLE}" DIRECTORY) |
23 |
| - get_filename_component(_python_executable_name "${Python3_EXECUTABLE}" NAME_WE) |
24 |
| - get_filename_component(_python_executable_ext "${Python3_EXECUTABLE}" EXT) |
25 |
| - set(_python_executable_debug "${_python_executable_dir}/${_python_executable_name}_d${_python_executable_ext}") |
26 |
| - if(EXISTS "${_python_executable_debug}") |
27 |
| - set(Python3_EXECUTABLE "${_python_executable_debug}") |
28 |
| - else() |
29 |
| - message(FATAL_ERROR "${_python_executable_debug} doesn't exist") |
30 |
| - endif() |
31 |
| -endif() |
32 |
| -find_package(Python3 REQUIRED COMPONENTS NumPy) |
| 22 | +get_target_property(Python3_EXECUTABLE PythonExtra::Interpreter LOCATION) |
| 23 | +find_package(Python3 REQUIRED COMPONENTS Interpreter Development NumPy) |
33 | 24 |
|
34 | 25 | # Get a list of typesupport implementations from valid rmw implementations.
|
35 | 26 | rosidl_generator_py_get_typesupports(_typesupport_impls)
|
@@ -146,7 +137,7 @@ set_property(
|
146 | 137 | ${_generated_extension_files} ${_generated_py_files} ${_generated_c_files}
|
147 | 138 | PROPERTY GENERATED 1)
|
148 | 139 |
|
149 |
| -set(_target_name_lib "${rosidl_generate_interfaces_TARGET}__python") |
| 140 | +set(_target_name_lib "${rosidl_generate_interfaces_TARGET}__rosidl_generator_py") |
150 | 141 | add_library(${_target_name_lib} SHARED ${_generated_c_files})
|
151 | 142 | target_link_libraries(${_target_name_lib} PRIVATE
|
152 | 143 | ${rosidl_generate_interfaces_TARGET}__rosidl_generator_c)
|
|
0 commit comments