File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,8 +63,7 @@ DEPENDS HDF5::HDF5
6363file (MAKE_DIRECTORY ${NetCDF_C_INCLUDE_DIRS} )
6464# avoid race condition
6565
66- # this GLOBAL is required to be visible via other project's FetchContent
67- add_library (NetCDF::NetCDF_C INTERFACE IMPORTED GLOBAL )
66+ add_library (NetCDF::NetCDF_C INTERFACE IMPORTED )
6867target_include_directories (NetCDF::NetCDF_C INTERFACE ${NetCDF_C_INCLUDE_DIRS} )
6968target_link_libraries (NetCDF::NetCDF_C INTERFACE ${NetCDF_C_LIBRARIES} )
7069
@@ -75,7 +74,7 @@ target_link_libraries(NetCDF::NetCDF_C INTERFACE HDF5::HDF5)
7574
7675# --- NetCDF-Fortran
7776
78- cmake_path (SET NetCDF_Fortran_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX} /include )
77+ cmake_path (SET NetCDF_Fortran_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR} )
7978
8079set (netcdf_fortran_cmake_args
8180-DCMAKE_INSTALL_PREFIX:PATH =${CMAKE_INSTALL_PREFIX}
@@ -109,8 +108,7 @@ DEPENDS NETCDF_C
109108
110109# --- imported target
111110
112- # this GLOBAL is required to be visible via other project's FetchContent
113- add_library (NetCDF::NetCDF_Fortran INTERFACE IMPORTED GLOBAL )
111+ add_library (NetCDF::NetCDF_Fortran INTERFACE IMPORTED )
114112target_include_directories (NetCDF::NetCDF_Fortran INTERFACE ${NetCDF_Fortran_INCLUDE_DIRS} )
115113target_link_libraries (NetCDF::NetCDF_Fortran INTERFACE ${NetCDF_Fortran_LIBRARIES} NetCDF::NetCDF_C )
116114
Original file line number Diff line number Diff line change @@ -103,8 +103,7 @@ USES_TERMINAL_TEST true
103103file (MAKE_DIRECTORY ${HDF5_INCLUDE_DIRS} )
104104# avoid race condition
105105
106- # this GLOBAL is required to be visible to parent projects
107- add_library (HDF5::HDF5 INTERFACE IMPORTED GLOBAL )
106+ add_library (HDF5::HDF5 INTERFACE IMPORTED )
108107target_include_directories (HDF5::HDF5 INTERFACE "${HDF5_INCLUDE_DIRS} " )
109108target_link_libraries (HDF5::HDF5 INTERFACE "${HDF5_LIBRARIES} " )
110109
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- set (NetCDF_C_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX} /include )
1+ set (NetCDF_C_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR} )
22
33set (netcdf_c_cmake_args
44-DCMAKE_INSTALL_PREFIX:PATH =${CMAKE_INSTALL_PREFIX}
@@ -55,8 +55,7 @@ USES_TERMINAL_TEST true
5555file (MAKE_DIRECTORY ${NetCDF_C_INCLUDE_DIRS} )
5656# avoid race condition
5757
58- # this GLOBAL is required to be visible via other project's FetchContent
59- add_library (NetCDF::NetCDF_C INTERFACE IMPORTED GLOBAL )
58+ add_library (NetCDF::NetCDF_C INTERFACE IMPORTED )
6059target_include_directories (NetCDF::NetCDF_C INTERFACE "${NetCDF_C_INCLUDE_DIRS} " )
6160target_link_libraries (NetCDF::NetCDF_C INTERFACE "${NetCDF_C_LIBRARIES} " )
6261
Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ USES_TERMINAL_TEST true
8181file (MAKE_DIRECTORY ${NetCDF_Fortran_INCLUDE_DIRS} )
8282# avoid race condition
8383
84- # this GLOBAL is required to be visible via other project's FetchContent
85- add_library (NetCDF::NetCDF_Fortran INTERFACE IMPORTED GLOBAL )
84+ add_library (NetCDF::NetCDF_Fortran INTERFACE IMPORTED )
8685target_include_directories (NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_Fortran_INCLUDE_DIRS} " )
8786target_link_libraries (NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_Fortran_LIBRARIES} " )
8887
Original file line number Diff line number Diff line change @@ -53,8 +53,7 @@ USES_TERMINAL_TEST true
5353file (MAKE_DIRECTORY ${ZLIB_INCLUDE_DIRS} )
5454# avoid race condition
5555
56- # for visibility in parent projects
57- add_library (ZLIB::ZLIB INTERFACE IMPORTED GLOBAL )
56+ add_library (ZLIB::ZLIB INTERFACE IMPORTED )
5857add_dependencies (ZLIB::ZLIB ZLIB ) # to avoid include directory race condition
5958target_link_libraries (ZLIB::ZLIB INTERFACE ${ZLIB_LIBRARIES} )
6059target_include_directories (ZLIB::ZLIB INTERFACE ${ZLIB_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change @@ -43,18 +43,16 @@ EXECUTABLE ${CMAKE_CTEST_COMMAND}
4343endif ()
4444
4545# --- NetCDF shared lib paths needed
46- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
47- if (WIN32 )
48- set_property (TEST minimal ${test_names} PROPERTY
49- ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../bin"
50- )
51- elseif (APPLE )
52- set_property (TEST minimal ${test_names} PROPERTY
53- ENVIRONMENT_MODIFICATION "DYLD_LIBRARY_PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../lib"
54- )
55- else ()
56- set_property (TEST minimal ${test_names} PROPERTY
57- ENVIRONMENT_MODIFICATION "LD_LIBRARY_PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../lib"
58- )
59- endif ()
46+ if (WIN32 )
47+ set_property (TEST minimal ${test_names} PROPERTY
48+ ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../bin"
49+ )
50+ elseif (APPLE )
51+ set_property (TEST minimal ${test_names} PROPERTY
52+ ENVIRONMENT_MODIFICATION "DYLD_LIBRARY_PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../lib"
53+ )
54+ else ()
55+ set_property (TEST minimal ${test_names} PROPERTY
56+ ENVIRONMENT_MODIFICATION "LD_LIBRARY_PATH=path_list_prepend:${NetCDF_Fortran_INCLUDE_DIRS} /../lib"
57+ )
6058endif ()
You can’t perform that action at this time.
0 commit comments