From 309fbef64a9ba58f852fbae74cd1fb65ad3a8801 Mon Sep 17 00:00:00 2001 From: Synge Todo Date: Wed, 27 Nov 2024 19:25:37 +0900 Subject: [PATCH] cmake: update --- cmake/config-gcc.cmake | 9 +++++++++ cmake/{intel.cmake => config-intel.cmake} | 0 cmake/nanobind.cmake | 2 +- cmake/postfix.cmake | 2 ++ cmake/prefix.cmake | 5 ++++- cmake/pybind11.cmake | 2 +- 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 cmake/config-gcc.cmake rename cmake/{intel.cmake => config-intel.cmake} (100%) diff --git a/cmake/config-gcc.cmake b/cmake/config-gcc.cmake new file mode 100644 index 0000000..c50dc3c --- /dev/null +++ b/cmake/config-gcc.cmake @@ -0,0 +1,9 @@ +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE) +endif(NOT CMAKE_C_COMPILER) +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE) +endif(NOT CMAKE_CXX_COMPILER) +if(NOT CMAKE_Fortran_COMPILER) + set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE) +endif(NOT CMAKE_Fortran_COMPILER) diff --git a/cmake/intel.cmake b/cmake/config-intel.cmake similarity index 100% rename from cmake/intel.cmake rename to cmake/config-intel.cmake diff --git a/cmake/nanobind.cmake b/cmake/nanobind.cmake index fc164e6..e3823d6 100644 --- a/cmake/nanobind.cmake +++ b/cmake/nanobind.cmake @@ -4,6 +4,6 @@ include(FetchContent) FetchContent_Declare( nanobind GIT_REPOSITORY https://github.com/wjakob/nanobind.git - GIT_TAG 784efa2a0358a4dc5432c74f5685ee026e20f2b6 # v2.2.0 + GIT_TAG v2.2.0 ) list(APPEND FetchContents nanobind) diff --git a/cmake/postfix.cmake b/cmake/postfix.cmake index 8b5b2b5..837ad7d 100644 --- a/cmake/postfix.cmake +++ b/cmake/postfix.cmake @@ -13,4 +13,6 @@ if(NOT DEVCORE_POSTFIX_CMAKE_INCLUDED) set(CMAKE_CXX_EXTENSIONS OFF) enable_testing() + + set(DEVCORE_POSTFIX_CMAKE_INCLUDED TRUE) endif(NOT DEVCORE_POSTFIX_CMAKE_INCLUDED) diff --git a/cmake/prefix.cmake b/cmake/prefix.cmake index b520e19..babb038 100644 --- a/cmake/prefix.cmake +++ b/cmake/prefix.cmake @@ -6,7 +6,7 @@ if(NOT DEVCORE_PREFIX_CMAKE_INCLUDED) if(CONFIG) message(STATUS "Loading compiler configration: " ${CONFIG}) - include(cmake/${CONFIG}.cmake) + include(cmake/config-${CONFIG}.cmake) else(CONFIG) if(NOT CMAKE_C_COMPILER) set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE) @@ -18,5 +18,8 @@ if(NOT DEVCORE_PREFIX_CMAKE_INCLUDED) set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE) endif(NOT CMAKE_Fortran_COMPILER) endif(CONFIG) + + set(FETCHCONTENT_UPDATES_DISCONNECTED ON) + set(DEVCORE_PREFIX_CMAKE_INCLUDED TRUE) endif(NOT DEVCORE_PREFIX_CMAKE_INCLUDED) diff --git a/cmake/pybind11.cmake b/cmake/pybind11.cmake index 48c209f..0b5f384 100644 --- a/cmake/pybind11.cmake +++ b/cmake/pybind11.cmake @@ -4,6 +4,6 @@ include(FetchContent) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11.git - GIT_TAG a2e59f0e7065404b44dfe92a28aca47ba1378dc4 # v2.13.6 + GIT_TAG v2.13.6 ) list(APPEND FetchContents pybind11)