Skip to content

Commit

Permalink
Merge pull request #105 from jfpanisset/cmake_python into dev
Browse files Browse the repository at this point in the history
* jfpanisset/cmake_python:
  Remove CMake conditionals and make FindPython REQUIRED
  Retain backwards compatibility
  Update CMake Python detection

Signed-off-by: David Aguilar <[email protected]>
  • Loading branch information
davvid committed Mar 2, 2024
2 parents 0764994 + c07f329 commit c044c3b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ set(OpenGL_GL_PREFERENCE GLVND)
find_package(Threads REQUIRED)
find_package(GLUT REQUIRED)
find_package(OpenGL REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(ZLIB)
if (ZLIB_FOUND)
add_definitions(-DPARTIO_USE_ZLIB)
Expand Down
2 changes: 1 addition & 1 deletion src/py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ target_include_directories(
)
target_link_libraries(partio_mod PRIVATE ${PYTHON_LIBRARIES} partio)

set(PYTHON_DEST "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" )
set(PYTHON_DEST "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" )

install(TARGETS partio_mod DESTINATION ${PYTHON_DEST})
install(FILES partio.i DESTINATION ${CMAKE_INSTALL_DATADIR}/swig)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else()
endforeach(item)

foreach(item testpartjson testpartio)
add_test(NAME ${item} COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_CURRENT_SOURCE_DIR}/${item}.py)
add_test(NAME ${item} COMMAND ${Python_EXECUTABLE} -B ${CMAKE_CURRENT_SOURCE_DIR}/${item}.py)
install(PROGRAMS ${item}.py DESTINATION ${CMAKE_INSTALL_PARTIO_TESTDIR} RENAME ${item})
endforeach(item)
endif()
2 changes: 1 addition & 1 deletion src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ install(PROGRAMS partedit.py DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME partedit
install(PROGRAMS partjson.py DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME partjson)
install(PROGRAMS partinspect.py DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME partinspect)

set(PYTHON_DEST "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" )
set(PYTHON_DEST "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" )
install(FILES partedit.py partjson.py partinspect.py DESTINATION ${PYTHON_DEST})

0 comments on commit c044c3b

Please sign in to comment.