Skip to content

Commit dc0b7d9

Browse files
committed
Simplify Python cmake code
1 parent cc956e9 commit dc0b7d9

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ if(PYTHON_WRAPPERS)
5858
find_package (Python3 COMPONENTS Interpreter Development NumPy)
5959
if(Python3_Interpreter_FOUND)
6060
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE PATH "Python interpreter executable")
61-
set(PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS})
62-
set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
63-
set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS})
61+
set(PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} CACHE PATH "Python include dirs" ADVANCED)
62+
set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE PATH "Python libraries" ADVANCED)
63+
set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS} CACHE PATH "Python NumPy include dirs" ADVANCED)
6464
set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND})
6565
else()
6666
message(FATAL_ERROR "Python interpreter not found")
6767
endif()
6868
find_package(SWIG)
6969
if(PYTHON_LIBRARIES AND SWIG_FOUND AND PYTHON_EXECUTABLE AND PYTHON_NUMPY_FOUND)
70-
SET(PYTHON_INSTDIR ${Python3_SITELIB} CACHE PATH "Installation directory for python module.")
70+
SET(PYTHON_INSTDIR ${Python3_SITELIB} CACHE PATH "Installation directory for python module." ADVANCED)
7171
endif()
7272
endif(PYTHON_WRAPPERS)
7373
IF(USE_CUDA)

src/CMakeLists.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,6 @@ INSTALL(TARGETS spimage
4040
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
4141
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
4242

43-
44-
# Find the python interpreter without calling the findpackage
45-
# FIND_PROGRAM(PYTHON_EXECUTABLE
46-
# NAMES python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5
47-
# PATHS
48-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
49-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
50-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
51-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
52-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
53-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]
54-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]
55-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]
56-
# [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]
57-
# )
58-
59-
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
60-
# all listed variables are TRUE
61-
INCLUDE(FindPackageHandleStandardArgs)
62-
63-
64-
MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
6543
if(SWIG_FOUND AND Python3_Interpreter_FOUND AND PYTHON_NUMPY_FOUND)
6644
FILE(GLOB spimage_headers "${CMAKE_CURRENT_SOURCE_DIR}/../include/spimage/*.h")
6745

0 commit comments

Comments
 (0)