Skip to content

Commit 14cc8e5

Browse files
committed
allow user to install to NetCDF_ROOT
1 parent c9bc2a3 commit 14cc8e5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13...3.20)
22

33
project(nc4fortran
44
LANGUAGES C Fortran
5-
VERSION 1.2.1
5+
VERSION 1.2.2
66
DESCRIPTION "thin, light object-oriented NetCDF4 Fortran interface"
77
HOMEPAGE_URL https://github.com/geospace-code/nc4fortran)
88

cmake/netcdf.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ find_package(HDF5 COMPONENTS C Fortran REQUIRED)
77

88
set(netcdf_external true CACHE BOOL "autobuild NetCDF")
99

10-
set(NetCDF_ROOT ${PROJECT_BINARY_DIR}/netcdf)
10+
if(NOT DEFINED NetCDF_ROOT)
11+
set(NetCDF_ROOT ${PROJECT_BINARY_DIR}/netcdf)
12+
endif()
13+
1114
set(NetCDF_INCLUDE_DIRS ${NetCDF_ROOT}/include)
1215

1316
set(NetCDF_C_LIBRARIES ${NetCDF_ROOT}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}netcdf${CMAKE_SHARED_LIBRARY_SUFFIX})
@@ -43,11 +46,8 @@ target_link_libraries(NetCDF::NetCDF_C INTERFACE "${NetCDF_C_LIBRARIES}")
4346
add_dependencies(NetCDF::NetCDF_C NETCDF_C)
4447

4548
# -- external deps
46-
4749
target_link_libraries(NetCDF::NetCDF_C INTERFACE HDF5::HDF5)
4850

49-
50-
5151
# --- NetCDF-Fortran
5252
ExternalProject_Add(NETCDF_FORTRAN
5353
URL https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.zip

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('nc4fortran', 'fortran',
22
meson_version : '>=0.52.0',
3-
version: '1.2.1',
3+
version: '1.2.2',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
# --- find netcdf

0 commit comments

Comments
 (0)