From 8a9e8ead35619ec0324adaa5a4759817af4082e5 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 3 Sep 2020 15:03:00 -0400 Subject: [PATCH] [cmake] Remove hashbang from cp_rs python script, do not install it --- bin/CMakeLists.txt | 2 +- bin/{cp_rs.in => cp_rs.py} | 2 -- cmake/Cpp2PyConfig.cmake.in | 3 --- cpp2py/CMakeLists.txt | 2 +- cpp2rst/CMakeLists.txt | 2 +- 5 files changed, 3 insertions(+), 8 deletions(-) rename bin/{cp_rs.in => cp_rs.py} (97%) mode change 100755 => 100644 diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 0f8e8de..6e0f609 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,4 +1,4 @@ -set(scripts c++2py c++2rst c++2cxx cp_rs) +set(scripts c++2py c++2rst c++2cxx) foreach(script ${scripts}) configure_file(${script}.in ${script} @ONLY) diff --git a/bin/cp_rs.in b/bin/cp_rs.py old mode 100755 new mode 100644 similarity index 97% rename from bin/cp_rs.in rename to bin/cp_rs.py index 0011cbb..391e132 --- a/bin/cp_rs.in +++ b/bin/cp_rs.py @@ -1,5 +1,3 @@ -#!@PYTHON_EXECUTABLE@ - # Acts as cp -rs on Linux # Workaround for the absence of this option on OS X # Usage cp_rs SRC DEST diff --git a/cmake/Cpp2PyConfig.cmake.in b/cmake/Cpp2PyConfig.cmake.in index 28d2a2f..9d85f42 100644 --- a/cmake/Cpp2PyConfig.cmake.in +++ b/cmake/Cpp2PyConfig.cmake.in @@ -41,9 +41,6 @@ set_property(TARGET c++2rst PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/b add_executable(c++2cxx IMPORTED GLOBAL) set_property(TARGET c++2cxx PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/bin/c++2cxx") -add_executable(cp_rs IMPORTED GLOBAL) -set_property(TARGET cp_rs PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/bin/cp_rs") - # include the exported targets of this project include(@CMAKE_INSTALL_PREFIX@/lib/cmake/Cpp2Py/Cpp2PyTargets.cmake) diff --git a/cpp2py/CMakeLists.txt b/cpp2py/CMakeLists.txt index dce4fa8..e91ab7a 100644 --- a/cpp2py/CMakeLists.txt +++ b/cpp2py/CMakeLists.txt @@ -7,7 +7,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${DEST} FILES_MATCHING # Link all files with relevant extensions into binary tree # This allows us to get a working cpp2py Setup already after the build stage -execute_process(COMMAND ${PROJECT_BINARY_DIR}/bin/cp_rs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} "py cxx rst") +execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bin/cp_rs.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} "py cxx rst") ################################################################################### # diff --git a/cpp2rst/CMakeLists.txt b/cpp2rst/CMakeLists.txt index 11db0a0..21de63d 100644 --- a/cpp2rst/CMakeLists.txt +++ b/cpp2rst/CMakeLists.txt @@ -4,4 +4,4 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${DEST} FILES_MATCHING # Link all files with relevant extensions into binary tree # This allows us to get a working cpp2py Setup already after the build stage -execute_process(COMMAND ${PROJECT_BINARY_DIR}/bin/cp_rs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} "py") +execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bin/cp_rs.py ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} "py")