From ccd433cd60696a6f3ddbfa2e53bc7d5b0e8fdf01 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Tue, 4 Jan 2022 17:19:03 +0100
Subject: [PATCH] Add source files locally

With `target_sources` rather than referring to their path from another
directory.
---
 Inst_eddies/Tests/CMakeLists.txt | 4 +---
 Tests/CMakeLists.txt             | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Inst_eddies/Tests/CMakeLists.txt b/Inst_eddies/Tests/CMakeLists.txt
index 8e9228d7..36b95eeb 100644
--- a/Inst_eddies/Tests/CMakeLists.txt
+++ b/Inst_eddies/Tests/CMakeLists.txt
@@ -56,9 +56,7 @@ target_link_libraries(test_nearby_extr Shapelib_03::shapelib_03
 
 # test_local_extrema
 
-add_executable(test_local_extrema
-  test_local_extrema.f90
-  ${PROJECT_SOURCE_DIR}/Tests/write_extr_map.f90)
+add_executable(test_local_extrema test_local_extrema.f90)
 
 target_link_libraries(test_local_extrema NetCDF95::netcdf95
   Jumble::jumble NetCDF_Fortran::netcdff)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 091e8533..f6188ff1 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -4,3 +4,5 @@ add_executable(test_spher_polyline_area
 
 target_link_libraries(test_spher_polyline_area Geometry::geometry
   Contour_531::contour_531 Jumble::jumble)
+
+target_sources(test_local_extrema PRIVATE write_extr_map.f90)
-- 
GitLab