-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
148c5d2
commit b3563ae
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) | ||
|
||
project(test_downstream LANGUAGES Fortran) | ||
|
||
find_package(fesom REQUIRED) | ||
|
||
message("fesom found: ${fesom_DIR}") | ||
message("fesom_VERSION: ${fesom_VERSION}") | ||
message("fesom_HAVE_OPENMP: ${fesom_HAVE_OPENMP}") | ||
message("fesom_HAVE_IFS_INTERFACE: ${fesom_HAVE_IFS_INTERFACE}") | ||
|
||
if(NOT TARGET fesom) | ||
message(FATAL_ERROR "fesom was installed wrongly: fesom target not found") | ||
endif() | ||
|
||
if (ASSERT_FESOM_DIR) | ||
if (NOT fesom_DIR MATCHES "${ASSERT_FESOM_DIR}") | ||
message(FATAL_ERROR "fesom was not found in expected location ${ASSERT_FESOM_DIR}") | ||
endif() | ||
endif() | ||
|
||
if (DEFINED ASSERT_HAVE_IFS_INTERFACE) | ||
if (ASSERT_HAVE_IFS_INTERFACE AND NOT fesom_HAVE_IFS_INTERFACE) | ||
message(FATAL_ERROR "fesom was installed wrongly: fesom_HAVE_IFS_INTERFACE=${fesom_HAVE_IFS_INTERFACE}") | ||
elseif (NOT ASSERT_HAVE_IFS_INTERFACE AND fesom_HAVE_IFS_INTERFACE) | ||
message(FATAL_ERROR "fesom was installed wrongly: fesom_HAVE_IFS_INTERFACE=${fesom_HAVE_IFS_INTERFACE}") | ||
endif() | ||
endif() | ||
|
||
get_target_property(target_type fesom TYPE) | ||
if( NOT target_type MATCHES "STATIC_LIBRARY|SHARED_LIBRARY") | ||
message(FATAL_ERROR "fesom target's TYPE is expected to be STATIC_LIBRARY or SHARED_LIBRARY. Actual TYPE: ${target_type}") | ||
endif () | ||
|
||
add_executable( main main.F90 ) | ||
target_link_libraries( main fesom ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
This dummy project can be used to test if fesom was installed and can be found correctly in downstream CMake projects | ||
|
||
Example use: | ||
|
||
export fesom_ROOT=<path-to-fesom-prefix> # can be install or build dir!!! | ||
cmake -S . -B build | ||
cmake --build build | ||
build/main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
program main | ||
use mod_mesh | ||
|
||
|
||
end program |