File tree 3 files changed +28
-6
lines changed
3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,7 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
368
368
UPDATE_COMMAND ""
369
369
CMAKE_CACHE_ARGS
370
370
-D${PROJECT_NAME} _SUPERBUILD:BOOL =0
371
+ -DSKBUILD_SCRIPTS_DIR:PATH =${SKBUILD_SCRIPTS_DIR}
371
372
-DBUILD_CMAKE_FROM_SOURCE:BOOL =${BUILD_CMAKE_FROM_SOURCE}
372
373
-DCMAKE_INSTALL_PREFIX:PATH =${CMAKE_INSTALL_PREFIX}
373
374
${${PROJECT_NAME} _CMAKE_CACHE_ARG}
@@ -448,5 +449,12 @@ include\(\"${CMakeProject_BINARY_DIR}/cmake_install.cmake\")
448
449
endif ()
449
450
install (${type} ${file} DESTINATION "${relative_directory} " ${_permissions} )
450
451
endforeach ()
452
+
453
+ # Prepare entry points
454
+ foreach (program IN ITEMS cmake ctest cpack ccmake)
455
+ configure_file (scripts/entry-point.py.in "${CMAKE_CURRENT_BINARY_DIR} /bin/${program} " )
456
+ message (STATUS "INSTALLING TO: ${SKBUILD_SCRIPTS_DIR} " )
457
+ install (PROGRAMS "${CMAKE_CURRENT_BINARY_DIR} /bin/${program} " DESTINATION "${SKBUILD_SCRIPTS_DIR} " )
458
+ endforeach ()
451
459
endif ()
452
460
endif ()
Original file line number Diff line number Diff line change @@ -38,12 +38,6 @@ Source = "https://github.com/scikit-build/cmake-python-distributions"
38
38
"Mailing list" = " https://groups.google.com/forum/#!forum/scikit-build"
39
39
"Bug Tracker" = " https://github.com/scikit-build/cmake-python-distributions/issues"
40
40
41
- [project .scripts ]
42
- ccmake = " cmake:ccmake"
43
- cmake = " cmake:cmake"
44
- cpack = " cmake:cpack"
45
- ctest = " cmake:ctest"
46
-
47
41
48
42
[dependency-groups ]
49
43
test = [
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ import os
3
+ import sys
4
+ import sysconfig
5
+
6
+ # Scripts can be broken by pip's build isolation hacks
7
+ # See: https://github.com/pypa/pip/blob/102d8187a1f5a4cd5de7a549fd8a9af34e89a54f/src/pip/_internal/build_env.py#L87
8
+ pl = sysconfig .get_paths ()['platlib' ]
9
+ if pl not in sys .path :
10
+ sys .path .append (pl )
11
+
12
+ from cmake import ${program }
13
+
14
+ if __name__ == '__main__' :
15
+ if sys .argv [0 ].endswith ('-script.pyw' ):
16
+ sys .argv [0 ] = sys .argv [0 ][: - 11 ]
17
+ elif sys .argv [0 ].endswith ('.exe' ):
18
+ sys .argv [0 ] = sys .argv [0 ][: - 4 ]
19
+
20
+ sys .exit (${program }())
You can’t perform that action at this time.
0 commit comments