diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index fa9ae04bd3b11225590e3b1a3c431c70256fcc62..2e8c74f79335f0315e6fabc14ba612b6378693ec 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -469,29 +469,45 @@ if(OGS_BUILD_UTILS) endif() if(OGS_USE_NETCDF) - find_package(netCDF CONFIG REQUIRED) - find_library(NETCDF_LIBRARIES_CXX NAMES netcdf_c++4 netcdf-cxx4) - if(NOT NETCDF_LIBRARIES_CXX) - CPMAddPackage( - NAME netcdf-cxx4 - GIT_REPOSITORY https://github.com/Unidata/netcdf-cxx4 - VERSION 4.3.1 - EXCLUDE_FROM_ALL YES SOURCE_SUBDIR cxx4 - OPTIONS "NCXX_ENABLE_TESTS OFF" SYSTEM TRUE - ) - set_target_properties( - netCDF::netcdf PROPERTIES INTERFACE_LINK_LIBRARIES "" - ) # fix win installed config - target_link_libraries(netcdf-cxx4 netCDF::netcdf) + if(NOT GUIX_BUILD) + find_package(netCDF CONFIG REQUIRED) + find_library(NETCDF_LIBRARIES_CXX NAMES netcdf_c++4 netcdf-cxx4) + if(NOT NETCDF_LIBRARIES_CXX) + CPMAddPackage( + NAME netcdf-cxx4 + GIT_REPOSITORY https://github.com/Unidata/netcdf-cxx4 + VERSION 4.3.1 + EXCLUDE_FROM_ALL YES SOURCE_SUBDIR cxx4 + OPTIONS "NCXX_ENABLE_TESTS OFF" SYSTEM TRUE + ) + set_target_properties( + netCDF::netcdf PROPERTIES INTERFACE_LINK_LIBRARIES "" + ) # fix win installed config + target_link_libraries(netcdf-cxx4 netCDF::netcdf) + else() + find_path(NETCDF_INCLUDES_CXX NAMES netcdf) + add_library(netcdf-cxx4 INTERFACE IMPORTED) + target_include_directories( + netcdf-cxx4 SYSTEM INTERFACE ${NETCDF_INCLUDES_CXX} + ) + target_link_libraries( + netcdf-cxx4 INTERFACE ${NETCDF_LIBRARIES_CXX} netCDF::netcdf + ) + endif() else() - find_path(NETCDF_INCLUDES_CXX NAMES netcdf) + find_library( + NETCDF_LIBRARIES_CXX NAMES netcdf_c++4 netcdf-cxx4 REQUIRED + ) + find_path(NETCDF_INCLUDES_CXX "ncVar.h" REQUIRED) + message( + STATUS + "NetCDF-cxx4: ${NETCDF_LIBRARIES_CXX} | ${NETCDF_INCLUDES_CXX}" + ) add_library(netcdf-cxx4 INTERFACE IMPORTED) target_include_directories( netcdf-cxx4 SYSTEM INTERFACE ${NETCDF_INCLUDES_CXX} ) - target_link_libraries( - netcdf-cxx4 INTERFACE ${NETCDF_LIBRARIES_CXX} netCDF::netcdf - ) + target_link_libraries(netcdf-cxx4 INTERFACE ${NETCDF_LIBRARIES_CXX}) endif() endif() diff --git a/scripts/guix/channels.scm b/scripts/guix/channels.scm index 57991845b4550d44d35814a6bbb81cd8b714e817..231fc80112a72585fb6298724adbc18d36a49527 100644 --- a/scripts/guix/channels.scm +++ b/scripts/guix/channels.scm @@ -2,7 +2,7 @@ (name 'guix-ogs) (url "https://gitlab.opengeosys.org/ogs/inf/guix-ogs.git") (branch "master") - (commit "49ad517d788eff70640a22920f4ca0ccbfeffb23")) + (commit "a87da0ffacbfd5e9a4d43d3f61d0722bd66b5237")) (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git")