File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.12.4 )
2
+ # when increasing the minium required version, consider updating in examples as well
2
3
3
4
file (STRINGS "version.txt" __CPP_BINDGEN_VERSION )
4
5
project (cpp_bindgen VERSION ${__CPP_BINDGEN_VERSION} LANGUAGES CXX )
Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.12.4 ) # TODO replace with generated version
1
+ cmake_minimum_required (VERSION 3.12.4 )
2
2
project (simple_example LANGUAGES CXX C Fortran )
3
3
4
4
# 1) find installed c_bindings version
@@ -10,4 +10,3 @@ cpp_bindgen_add_library(simple SOURCES simple.cpp)
10
10
# 3) link the library to a fortran executable
11
11
add_executable (driver driver.f90 )
12
12
target_link_libraries (driver simple_fortran )
13
-
Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.12.4 ) # TODO replace with generated version
1
+ cmake_minimum_required (VERSION 3.12.4 )
2
2
project (simple_example_with_fetch_content LANGUAGES CXX Fortran )
3
3
4
4
# 1) fetch cpp_bindgen from the repository
5
- # TODO: use FetchContent_MakeAvailable() once we require CMake 3.14+
6
5
include (FetchContent )
7
6
FetchContent_Declare (
8
7
cpp_bindgen
@@ -12,7 +11,7 @@ FetchContent_Declare(
12
11
# GIT_REPOSITORY https://github.com/GridTools/cpp_bindgen.git
13
12
# GIT_TAG master # consider replacing master by a tagged version
14
13
)
15
- # FetchContent_MakeAvailable(cpp_bindgen) for CMake >= 3.14
14
+ # FetchContent_MakeAvailable(cpp_bindgen) for CMake >= 3.14, otherwise:
16
15
FetchContent_GetProperties (cpp_bindgen )
17
16
if (NOT c_bindings_POPULATED )
18
17
FetchContent_Populate (cpp_bindgen )
@@ -25,4 +24,3 @@ cpp_bindgen_add_library(simple SOURCES simple.cpp)
25
24
# 3) link the generated library to a fortran executable
26
25
add_executable (driver driver.f90 )
27
26
target_link_libraries (driver simple_fortran )
28
-
You can’t perform that action at this time.
0 commit comments