mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-12 18:10:24 +08:00
Initial attempt at getting netcdf-c to automatically build and install netcdf-fortran.
This commit is contained in:
parent
2ab47745cc
commit
a4724f7aee
@ -309,6 +309,14 @@ OPTION(ENABLE_LOGGING "Enable Logging." OFF)
|
||||
IF(ENABLE_LOGGING)
|
||||
SET(LOGGING ON)
|
||||
ENDIF()
|
||||
|
||||
# Option to automatically build netcdf-fortran.
|
||||
OPTION(BUILD_FORTRAN "Download and build netcdf-fortran automatically." OFF)
|
||||
IF(BUILD_FORTRAN)
|
||||
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/fortran_install.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/fortran_install.sh")
|
||||
ENDIF(BUILD_FORTRAN)
|
||||
|
||||
# Option to use HDF4
|
||||
OPTION(ENABLE_HDF4 "Build netCDF-4 with HDF5 read capability(HDF4, HDF5 and Zlib required)." OFF)
|
||||
IF(ENABLE_HDF4)
|
||||
@ -1520,5 +1528,12 @@ install(
|
||||
# End export files
|
||||
####
|
||||
|
||||
###
|
||||
# If build fortran, we will want to run a script.
|
||||
###
|
||||
IF(BUILD_FORTRAN)
|
||||
INSTALL(SCRIPT "${CMAKE_SOURCE_DIR}/PostInstall.cmake")
|
||||
ENDIF(BUILD_FORTRAN)
|
||||
|
||||
# CPack inclusion must come last.
|
||||
INCLUDE(CPack)
|
||||
|
1
PostInstall.cmake
Normal file
1
PostInstall.cmake
Normal file
@ -0,0 +1 @@
|
||||
EXECUTE_PROCESS(COMMAND sh -c "${CMAKE_BINARY_DIR}/fortran_install.sh")
|
18
fortran_install.sh.in
Executable file
18
fortran_install.sh.in
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Script to automatically build, install netcdf-fortran.
|
||||
# Very rought draft.
|
||||
|
||||
|
||||
###
|
||||
# Fetch netcdf-fortran from git
|
||||
###
|
||||
git clone http://github.com/unidata/netcdf-fortran
|
||||
cd netcdf-fortran
|
||||
mkdir -p build
|
||||
cd build
|
||||
git checkout v4.4.1
|
||||
|
||||
###
|
||||
# Invoke cmake to build netcdf-fortran
|
||||
###
|
||||
cmake .. -DCMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@ -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ && make && make install
|
@ -110,6 +110,13 @@ INSTALL(
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
###
|
||||
# If build fortran, we will want to run a script.
|
||||
###
|
||||
IF(BUILD_FORTRAN)
|
||||
INSTALL(SCRIPT "${CMAKE_SOURCE_DIR}/PostInstall.cmake")
|
||||
ENDIF(BUILD_FORTRAN)
|
||||
|
||||
SET(ALL_TLL_LIBS ${TLL_LIBS} PARENT_SCOPE)
|
||||
SET(NC_LIBS ${NC_LIBS} PARENT_SCOPE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user