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

Commit

Permalink
More tweaks to cmake commands
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 12, 2023
1 parent f52a520 commit bb3be44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ FILE(READ "version.txt" VERSION)
PROJECT(${SKBUILD_PROJECT_NAME} LANGUAGES C Fortran VERSION ${VERSION})

# Use the old method to get Python packages, as that's what scikit-build uses
CMAKE_POLICY(SET CMP0148 OLD)
IF (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
CMAKE_POLICY(SET CMP0148 OLD)
ENDIF ()

# Add our local modules to the module path
FILE(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" LOCAL_MODULE_PATH)
Expand Down Expand Up @@ -103,10 +105,12 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(SWIFTEST_LIBRARY swiftest)

# The source for the SWIFTEST binary and have it placed in the bin folder
ADD_SUBDIRECTORY(${SRC} ${BIN})

ADD_SUBDIRECTORY(${SRC} ${CMAKE_INSTALL_BINDIR})

ADD_SUBDIRECTORY(${PY})


# Add a distclean target to the Makefile
ADD_CUSTOM_TARGET(distclean
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_SOURCE_DIR}/distclean.cmake"
Expand Down
5 changes: 3 additions & 2 deletions swiftest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ IF(USE_OPENMP OR USE_SIMD)
SET_PROPERTY(TARGET ${SWIFTEST_BINDINGS} APPEND_STRING PROPERTY LINK_FLAGS "${OpenMP_Fortran_FLAGS} ")
ENDIF()
PYTHON_EXTENSION_MODULE(${SWIFTEST_BINDINGS})
TARGET_INCLUDE_DIRECTORIES(${SWIFTEST_BINDINGS} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${MOD} ${NETCDF_INCLUDE_DIR})
INSTALL(TARGETS ${SWIFTEST_BINDINGS} LIBRARY DESTINATION swiftest)
TARGET_INCLUDE_DIRECTORIES(${SWIFTEST_BINDINGS} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_INSTALL_INCLUDEDIR} ${NETCDF_INCLUDE_DIR})

INSTALL(TARGETS ${SWIFTEST_BINDINGS} LIBRARY DESTINATION ${PY})

0 comments on commit bb3be44

Please sign in to comment.