From e6c7ae27cd8f6afcd31882d0c03306d7551113b9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 29 May 2019 12:14:42 -0400 Subject: [PATCH] Add support for distributing ccmake executable See https://github.com/scikit-build/cmake-python-distributions/issues/66 --- CMakeLists.txt | 18 ------------------ pyproject.toml | 1 + src/cmake/__init__.py | 4 ++++ 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 241b1172..02b617aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,24 +288,6 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\ set(CMAKEPROJECT_BUILD_LAST_STEP "build") - find_program(STRIP_EXECUTABLE strip) - if(STRIP_EXECUTABLE) - - set(cmake_executable "${CMakeProject_BINARY_DIR}/bin/cmake") - set(cpack_executable "${CMakeProject_BINARY_DIR}/bin/cpack") - set(ctest_executable "${CMakeProject_BINARY_DIR}/bin/ctest") - - ExternalProject_Add_Step(CMakeProject-build strip_executables - DEPENDEES ${CMAKEPROJECT_BUILD_LAST_STEP} - COMMENT "Stripping CMake executables" - COMMAND ${STRIP_EXECUTABLE} ${cmake_executable} - COMMAND ${STRIP_EXECUTABLE} ${cpack_executable} - COMMAND ${STRIP_EXECUTABLE} ${ctest_executable} - USES_TERMINAL 1 - ) - set(CMAKEPROJECT_BUILD_LAST_STEP "strip_executables") - endif() - if(RUN_CMAKE_TEST) include(ProcessorCount) ProcessorCount(NB_CPU) diff --git a/pyproject.toml b/pyproject.toml index 11f644ff..aa2177cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,7 @@ test = [ ] [project.scripts] +ccmake = "cmake:ccmake" cmake = "cmake:cmake" cpack = "cmake:cpack" ctest = "cmake:ctest" diff --git a/src/cmake/__init__.py b/src/cmake/__init__.py index 03086c9a..98b1e709 100644 --- a/src/cmake/__init__.py +++ b/src/cmake/__init__.py @@ -52,6 +52,10 @@ def _program_exit(name: str, *args: str) -> NoReturn: os.execl(os.path.join(CMAKE_BIN_DIR, name), name, *args) +def ccmake() -> NoReturn: + _program_exit('ccmake', *sys.argv[1:]) + + def cmake() -> NoReturn: _program_exit('cmake', *sys.argv[1:])