Skip to content

Commit

Permalink
got rid of cmake module files
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Oct 28, 2023
1 parent 2e0ff11 commit 17afd7d
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 2,319 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION "3.14")
project(Photochem LANGUAGES Fortran C VERSION "0.4.2")
cmake_policy(SET CMP0148 OLD)
project(Photochem LANGUAGES Fortran C VERSION "0.4.3")

include(FortranCInterface)
FortranCInterface_VERIFY()
Expand All @@ -18,6 +19,7 @@ include(cmake/CPM.cmake)
# options
option(SKBUILD "Should be ON of being build by skbuild,
and OFF of being build by regular cmake" OFF)
message(STATUS "The project is built using scikit-build: ${SKBUILD}")

option(BUILD_EXECUTABLES "if ON, then will build the
Fortran executables" ON)
Expand All @@ -36,10 +38,18 @@ add_subdirectory(src)
add_subdirectory(tests)

if (BUILD_PYTHON_PHOTOCHEM)
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if (NOT SKBUILD)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
if (NOT DEFINED SKBUILD_CMAKE_MODULE_DIR)
# Here, we try to find scikit-build cmake modules
find_package(Python COMPONENTS Development)
set(SKBUILD_CMAKE_MODULE_DIR "${Python_LIBRARY_DIRS}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/skbuild/resources/cmake")
endif()
if (EXISTS ${SKBUILD_CMAKE_MODULE_DIR})
message(STATUS "Scikit-build CMake modules: ${SKBUILD_CMAKE_MODULE_DIR}")
else()
message(FATAL_ERROR "Failed to find scikit-build CMake modules in directory: ${SKBUILD_CMAKE_MODULE_DIR}")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SKBUILD_CMAKE_MODULE_DIR})
endif()

find_package(PythonExtensions REQUIRED)
Expand Down
82 changes: 0 additions & 82 deletions cmake/FindCython.cmake

This file was deleted.

123 changes: 0 additions & 123 deletions cmake/FindF2PY.cmake

This file was deleted.

106 changes: 0 additions & 106 deletions cmake/FindNumPy.cmake

This file was deleted.

Loading

0 comments on commit 17afd7d

Please sign in to comment.