Skip to content

Add support for distributing ccmake executable #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
BUILD_ALWAYS 1
${_cmake_args}
CMAKE_CACHE_ARGS
-DBUILD_CursesDialog:BOOL=OFF
-DBUILD_CursesDialog:BOOL=ON
-DCMAKE_USE_OPENSSL:BOOL=ON
-DBUILD_TESTING:BOOL=ON
-DCMake_INSTALL_DEPENDENCIES:BOOL=ON
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test = [
]

[project.scripts]
ccmake = "cmake:ccmake"
cmake = "cmake:cmake"
cpack = "cmake:cpack"
ctest = "cmake:ctest"
Expand Down
4 changes: 4 additions & 0 deletions src/cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:])

Expand Down
Loading