Skip to content

Commit

Permalink
fix numpy usage for Windows debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Apr 2, 2019
1 parent 4fe2166 commit 5f4379d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ endif()

set(_target_suffix "__py")

set(_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
if(WIN32 AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE_DEBUG})
endif()

# move custom command into a subdirectory to avoid multiple invocations on Windows
set(_subdir "${CMAKE_CURRENT_BINARY_DIR}/${rosidl_generate_interfaces_TARGET}${_target_suffix}")
file(MAKE_DIRECTORY "${_subdir}")
Expand Down Expand Up @@ -224,13 +229,9 @@ foreach(_typesupport_impl ${_typesupport_impls})
)

set(_extension_compile_flags "")
set(_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(_extension_compile_flags -Wall -Wextra)
endif()
if(WIN32 AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE_DEBUG})
endif()
set_properties("")
if(WIN32)
set_properties("_DEBUG")
Expand Down Expand Up @@ -274,14 +275,15 @@ foreach(_typesupport_impl ${_typesupport_impls})
"rosidl_generator_py"
"${rosidl_generate_interfaces_TARGET}__rosidl_generator_c"
)
set(PYTHON_EXECUTABLE ${_PYTHON_EXECUTABLE})

if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
install(TARGETS ${_target_name}
DESTINATION "${PYTHON_INSTALL_DIR}/${PROJECT_NAME}")
endif()
endforeach()

set(PYTHON_EXECUTABLE ${_PYTHON_EXECUTABLE})

foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
set(_pkg_install_base "${${_pkg_name}_DIR}/../../..")
set(_pkg_python_libname "${_pkg_name}__python")
Expand Down

0 comments on commit 5f4379d

Please sign in to comment.