Skip to content

Commit 52f7f1b

Browse files
JorgeG94dougiesquire
authored andcommitted
CMakeLists.txt: use find_package for mocsy dependency (#41)
--------- Co-authored-by: dougiesquire <[email protected]>
1 parent 3289512 commit 52f7f1b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ endif()
7474

7575
find_package(MPI REQUIRED COMPONENTS Fortran)
7676
find_package(FMS REQUIRED COMPONENTS R8)
77-
find_package(PkgConfig REQUIRED)
78-
pkg_check_modules(MOCSY REQUIRED IMPORTED_TARGET "mocsy")
77+
find_package(mocsy REQUIRED)
7978

8079
add_library(gtracers)
8180

@@ -112,7 +111,7 @@ target_include_directories(gtracers
112111

113112
target_link_libraries(gtracers PUBLIC
114113
FMS::fms_r8
115-
PkgConfig::MOCSY)
114+
mocsy::mocsy)
116115

117116
install(TARGETS gtracers
118117
EXPORT GFDLGTracersTargets)

cmake/GFDLGTracersConfig.cmake.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ set(_required_components ${GFDLGTracers_FIND_COMPONENTS})
1313

1414
find_dependency(MPI REQUIRED COMPONENTS Fortran)
1515
find_dependency(fms COMPONENTS R8 REQUIRED)
16-
find_dependency(PkgConfig REQUIRED)
17-
pkg_check_modules(MOCSY REQUIRED IMPORTED_TARGET "mocsy")
16+
find_dependency(mocsy REQUIRED)
1817

1918
# Run the normal Targets.cmake
2019
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

0 commit comments

Comments
 (0)