Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed the location of the CYthon binding file upon install
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 13, 2024
1 parent d3d5037 commit 7920d41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,27 @@ ELSE()
OPTION(USE_SIMD "Use SIMD vectorization" ON)
OPTION(BUILD_SHARED_LIBS "Build using shared libraries" ON)

# Define the paths to the source code and python files
SET(SRC "${CMAKE_SOURCE_DIR}/src")
SET(PY "${CMAKE_SOURCE_DIR}/swiftest")

# Make sure paths are correct for Unix or Windows style
FILE(TO_CMAKE_PATH ${SRC} SRC)
FILE(TO_CMAKE_PATH ${PY} PY)

INCLUDE(GNUInstallDirs)
IF (SKBUILD)
SET(INSTALL_BINDIR ${SKBUILD_SCRIPTS_DIR})
SET(INSTALL_BINDIR ${SKBUILD_SCRIPTS_DIR})
SET(INSTALL_LIBDIR ${SKBUILD_DATA_DIR}/lib)
SET(INSTALL_INCLUDEDIR ${SKBUILD_HEADERS_DIR})
SET(INSTALL_PYPROJ ${SKBUILD_PLATLIB_DIR}/${SKBUILD_PROJECT_NAME})
IF (APPLE)
SET(CMAKE_INSTALL_RPATH "@loader_path")
ELSEIF (LINUX)
SET(CMAKE_INSTALL_RPATH $ORIGIN)
ENDIF ()
ELSE ()
SET(INSTALL_PYPROJ ${PY})
SET(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
SET(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
SET(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
Expand Down Expand Up @@ -89,9 +99,6 @@ ELSE()
FIND_PACKAGE(Python COMPONENTS Interpreter Development.Module REQUIRED)


SET(SRC "${CMAKE_SOURCE_DIR}/src")
SET(PY "${CMAKE_SOURCE_DIR}/swiftest")

#####################################
# Tell how to install this executable
#####################################
Expand All @@ -103,11 +110,6 @@ ELSE()
SET(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Path for install")
ENDIF()


# Make sure paths are correct for Unix or Windows style
FILE(TO_CMAKE_PATH ${SRC} SRC)
FILE(TO_CMAKE_PATH ${PY} PY)

# Set the name of the swiftest library
SET(SWIFTEST_LIBRARY ${SKBUILD_PROJECT_NAME})

Expand Down
2 changes: 1 addition & 1 deletion swiftest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ ENDIF ()
TARGET_INCLUDE_DIRECTORIES(${SWIFTEST_BINDINGS} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

# Define the install locations
INSTALL(TARGETS ${SWIFTEST_BINDINGS} LIBRARY DESTINATION ${INSTALL_LIBDIR})
INSTALL(TARGETS ${SWIFTEST_BINDINGS} LIBRARY DESTINATION ${INSTALL_PYPROJ})

0 comments on commit 7920d41

Please sign in to comment.