Skip to content

Commit

Permalink
add independent flag for better control
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelab committed Feb 22, 2024
1 parent b66e442 commit 1df6299
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,14 @@ if(ENABLE_PYTHON AND Python_FOUND)
message(STATUS " development libraries: NOT found!")
endif(Python_Development_FOUND)

# install in CMAKE_INSTALL_PREFIX if it is provided, or in the globably Python_SITELIB otherwise
set(Python_INSTALL_PACKAGE_DIR "")
if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(Python_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}")
elseif()

# use Python_INSTALL_PACKAGE_DIR if provided; otherwise, install in Python_SITELIB
if(NOT DEFINED Python_INSTALL_PACKAGE_DIR)
set(Python_INSTALL_PACKAGE_DIR "${Python_SITELIB}")
endif(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif(NOT DEFINED Python_INSTALL_PACKAGE_DIR)
message(STATUS " package install directory: ${Python_INSTALL_PACKAGE_DIR}")


# look for NumPy
if(Python_NumPy_FOUND)
set(CMAKE_SWIG_FLAGS -DWITHNUMPY ${CRP})
Expand Down Expand Up @@ -531,7 +530,6 @@ if(ENABLE_PYTHON AND Python_FOUND)
target_link_libraries(crpropa-swig crpropa ${Python_LIBRARIES} ${Python_LIBRARY})
add_dependencies(crpropa-swig crpropa-swig-wrapper)


install(DIRECTORY "${CMAKE_SOURCE_DIR}/python/crpropa" DESTINATION "${Python_INSTALL_PACKAGE_DIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/crpropa.py" DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa")
install(TARGETS crpropa-swig LIBRARY DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa")
Expand Down

0 comments on commit 1df6299

Please sign in to comment.