From 3f57b47a7d18e56cb3b2926a30f572bd23e66bf7 Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Thu, 6 Feb 2020 13:34:58 -0800 Subject: [PATCH] [Windows][noetic-devel] Generate executables without extension name. (#1061) * generate exe without extension name. * use NAME_WE to be compatible with CMake<3.14. * Fixed the wrong reference. --- cmake/platform/windows.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/platform/windows.cmake b/cmake/platform/windows.cmake index f962b3086..ca8d77cd6 100644 --- a/cmake/platform/windows.cmake +++ b/cmake/platform/windows.cmake @@ -130,9 +130,12 @@ function(add_python_executable) endif() if(WIN32) + get_filename_component(WRAPPER_NAME + "${ARG_SCRIPT_NAME}" + NAME_WE) set( WRAPPER_SOURCE - "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/add_python_executable/${ARG_TARGET_NAME}/${ARG_SCRIPT_NAME}.cpp") + "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/add_python_executable/${ARG_TARGET_NAME}/${WRAPPER_NAME}.cpp") configure_file( "${catkin_EXTRAS_DIR}/templates/python_win32_wrapper.cpp.in" "${WRAPPER_SOURCE}" @@ -140,10 +143,10 @@ function(add_python_executable) add_executable(${ARG_TARGET_NAME} "${WRAPPER_SOURCE}") - # The actual file name of the executable built on Windows will be ${ARG_SCRIPT_NAME}.exe according to OUTPUT_NAME + # The actual file name of the executable built on Windows will be ${WRAPPER_NAME}.exe according to OUTPUT_NAME set_target_properties( ${ARG_TARGET_NAME} PROPERTIES - OUTPUT_NAME "${ARG_SCRIPT_NAME}" + OUTPUT_NAME "${WRAPPER_NAME}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/windows_wrappers/${ARG_TARGET_NAME}") install(