Skip to content

Commit

Permalink
Require CMake>=3.22 (#2508)
Browse files Browse the repository at this point in the history
* cmake_minimum_required(VERSION 3.22) as in sundials

* regenerate

* ..
  • Loading branch information
dweindl authored Sep 27, 2024
1 parent 823b6bd commit 9a81ad1
Show file tree
Hide file tree
Showing 33 changed files with 195 additions and 109 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# Build AMICI library
#
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.22)
# When updating the policy version, please also update it in
# src/CMakeLists.template.cmake
cmake_policy(VERSION 3.15...3.30)
cmake_policy(VERSION 3.22...3.30)

project(amici)

Expand Down
14 changes: 6 additions & 8 deletions models/model_calvetti/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_calvetti)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_calvetti/model_calvetti.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_calvetti_h
#define _amici_model_calvetti_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -72,7 +72,7 @@ class Model_model_calvetti : public amici::Model_DAE {

amici::Model* clone() const override { return new Model_model_calvetti(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) override {
JSparse_model_calvetti(JSparse, t, x, p, k, h, cj, dx, w, dwdx);
Expand Down
11 changes: 11 additions & 0 deletions models/model_calvetti/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)


if(DEFINED ENV{SWIG})
set(SWIG_EXECUTABLE $ENV{SWIG})
Expand Down
14 changes: 6 additions & 8 deletions models/model_dirac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_dirac)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_dirac/model_dirac.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_dirac_h
#define _amici_model_dirac_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -72,7 +72,7 @@ class Model_model_dirac : public amici::Model_ODE {

amici::Model* clone() const override { return new Model_model_dirac(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
JSparse_model_dirac(JSparse, t, x, p, k, h, w, dwdx);
Expand Down
11 changes: 11 additions & 0 deletions models/model_dirac/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)


if(DEFINED ENV{SWIG})
set(SWIG_EXECUTABLE $ENV{SWIG})
Expand Down
14 changes: 6 additions & 8 deletions models/model_events/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_events)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_events/model_events.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_events_h
#define _amici_model_events_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -86,7 +86,7 @@ class Model_model_events : public amici::Model_ODE {

amici::Model* clone() const override { return new Model_model_events(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
JSparse_model_events(JSparse, t, x, p, k, h, w, dwdx);
Expand Down
11 changes: 11 additions & 0 deletions models/model_events/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)


if(DEFINED ENV{SWIG})
set(SWIG_EXECUTABLE $ENV{SWIG})
Expand Down
14 changes: 6 additions & 8 deletions models/model_jakstat_adjoint/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_jakstat_adjoint)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_jakstat_adjoint/model_jakstat_adjoint.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_jakstat_adjoint_h
#define _amici_model_jakstat_adjoint_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -75,7 +75,7 @@ class Model_model_jakstat_adjoint : public amici::Model_ODE {

amici::Model* clone() const override { return new Model_model_jakstat_adjoint(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
JSparse_model_jakstat_adjoint(JSparse, t, x, p, k, h, w, dwdx);
Expand Down
11 changes: 11 additions & 0 deletions models/model_jakstat_adjoint/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)


if(DEFINED ENV{SWIG})
set(SWIG_EXECUTABLE $ENV{SWIG})
Expand Down
14 changes: 6 additions & 8 deletions models/model_jakstat_adjoint_o2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_jakstat_adjoint_o2)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_jakstat_adjoint_o2_h
#define _amici_model_jakstat_adjoint_o2_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -75,7 +75,7 @@ class Model_model_jakstat_adjoint_o2 : public amici::Model_ODE {

amici::Model* clone() const override { return new Model_model_jakstat_adjoint_o2(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
JSparse_model_jakstat_adjoint_o2(JSparse, t, x, p, k, h, w, dwdx);
Expand Down
11 changes: 11 additions & 0 deletions models/model_jakstat_adjoint_o2/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)


if(DEFINED ENV{SWIG})
set(SWIG_EXECUTABLE $ENV{SWIG})
Expand Down
14 changes: 6 additions & 8 deletions models/model_nested_events/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.30)

project(model_nested_events)

Expand Down Expand Up @@ -38,6 +33,10 @@ endif()
find_package(Amici REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release;
MAP_IMPORTED_CONFIG_RELEASE Release
MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;)

# Debug build?
if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
Expand All @@ -47,7 +46,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}")
else()
add_compile_options(-O0 -g)
endif()
set(CMAKE_BUILD_TYPE "Debug")
endif()

# coverage options
Expand Down
4 changes: 2 additions & 2 deletions models/model_nested_events/model_nested_events.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_nested_events_h
#define _amici_model_nested_events_h
/* Generated by amiwrap (R2017b) 8b324bca5b796a93094195d22a023e5f8e945ef1 */
/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -75,7 +75,7 @@ class Model_model_nested_events : public amici::Model_ODE {

amici::Model* clone() const override { return new Model_model_nested_events(*this); };

std::string getAmiciCommit() const override { return "8b324bca5b796a93094195d22a023e5f8e945ef1"; };
std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; };

void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
JSparse_model_nested_events(JSparse, t, x, p, k, h, w, dwdx);
Expand Down
Loading

0 comments on commit 9a81ad1

Please sign in to comment.