From ccf623155287a8af9e0cb3265e340f3571e64303 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Sun, 21 Feb 2021 01:08:24 -0500 Subject: [PATCH] correct GLOBAL for FetchContent --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83fa51b..7a51fd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,8 @@ target_include_directories(nc4fortran target_link_libraries(nc4fortran PUBLIC NetCDF::NetCDF_Fortran) set_target_properties(nc4fortran PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include) -add_library(nc4fortran::nc4fortran INTERFACE IMPORTED) +# GLOBAL needed for FetchContent use +add_library(nc4fortran::nc4fortran INTERFACE IMPORTED GLOBAL) target_link_libraries(nc4fortran::nc4fortran INTERFACE nc4fortran) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/nc4fortran.mod