Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require CMake>=3.22 #2508

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

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"; };

Check warning on line 75 in models/model_calvetti/model_calvetti.h

View check run for this annotation

Codecov / codecov/patch

models/model_calvetti/model_calvetti.h#L75

Added line #L75 was not covered by tests

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 @@

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"; };

Check warning on line 75 in models/model_dirac/model_dirac.h

View check run for this annotation

Codecov / codecov/patch

models/model_dirac/model_dirac.h#L75

Added line #L75 was not covered by tests

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 @@

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"; };

Check warning on line 89 in models/model_events/model_events.h

View check run for this annotation

Codecov / codecov/patch

models/model_events/model_events.h#L89

Added line #L89 was not covered by tests

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 @@

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"; };

Check warning on line 78 in models/model_jakstat_adjoint/model_jakstat_adjoint.h

View check run for this annotation

Codecov / codecov/patch

models/model_jakstat_adjoint/model_jakstat_adjoint.h#L78

Added line #L78 was not covered by tests

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 @@

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"; };

Check warning on line 78 in models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h

View check run for this annotation

Codecov / codecov/patch

models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h#L78

Added line #L78 was not covered by tests

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 @@

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"; };

Check warning on line 78 in models/model_nested_events/model_nested_events.h

View check run for this annotation

Codecov / codecov/patch

models/model_nested_events/model_nested_events.h#L78

Added line #L78 was not covered by tests

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
Loading