2013-08-15 23:43:59 +08:00
|
|
|
## This is a CMake file, part of Unidata's netCDF package.
|
2018-12-07 05:34:40 +08:00
|
|
|
# Copyright 2012-2018, see the COPYRIGHT file for more information.
|
2013-08-15 23:43:59 +08:00
|
|
|
|
2013-09-04 04:22:55 +08:00
|
|
|
# Process these files with m4.
|
|
|
|
SET(m4_SOURCES attr ncx putget t_ncxx)
|
2015-04-13 15:42:49 +08:00
|
|
|
foreach (f ${m4_SOURCES})
|
2017-01-04 03:10:05 +08:00
|
|
|
IF(HAVE_M4)
|
|
|
|
GEN_m4(${f})
|
|
|
|
ENDIF()
|
2013-09-04 04:22:55 +08:00
|
|
|
endforeach(f)
|
2012-07-14 00:37:14 +08:00
|
|
|
|
2015-07-28 05:31:23 +08:00
|
|
|
SET(libsrc_SOURCES v1hpg.c putget.c attr.c nc3dispatch.c
|
2018-02-25 11:36:24 +08:00
|
|
|
nc3internal.c var.c dim.c ncx.c lookup3.c ncio.c)
|
2015-10-10 03:06:32 +08:00
|
|
|
|
|
|
|
SET(libsrc_SOURCES ${libsrc_SOURCES} pstdint.h ncio.h ncx.h)
|
2012-07-14 00:37:14 +08:00
|
|
|
|
2018-05-12 05:30:19 +08:00
|
|
|
SET(libsrc_SOURCES ${libsrc_SOURCES} memio.c)
|
2012-07-14 00:37:14 +08:00
|
|
|
|
2018-05-12 05:30:19 +08:00
|
|
|
IF (BUILD_MMAP)
|
|
|
|
SET(libsrc_SOURCES ${libsrc_SOURCES} mmapio.c)
|
|
|
|
ENDIF( BUILD_MMAP)
|
2012-07-14 00:49:20 +08:00
|
|
|
|
|
|
|
IF (USE_FFIO)
|
2014-04-22 01:15:33 +08:00
|
|
|
SET(libsrc_SOURCES ${libsrc_SOURCES} ffio.c)
|
2015-10-10 03:06:32 +08:00
|
|
|
ELSEIF (USE_STDIO)
|
|
|
|
SET(libsrc_SORUCES ${libsrc_SOURCES} ncstdio.c)
|
2012-07-17 06:31:35 +08:00
|
|
|
ELSE (USE_FFIO)
|
2014-04-22 01:15:33 +08:00
|
|
|
SET(libsrc_SOURCES ${libsrc_SOURCES} posixio.c)
|
2012-07-14 00:49:20 +08:00
|
|
|
ENDIF (USE_FFIO)
|
2012-07-11 01:45:28 +08:00
|
|
|
|
2015-04-13 15:42:49 +08:00
|
|
|
add_library(netcdf3 OBJECT ${libsrc_SOURCES})
|
2012-07-17 06:31:35 +08:00
|
|
|
|
|
|
|
# The C API man page.
|
|
|
|
|
2012-10-18 05:14:30 +08:00
|
|
|
SET(MAN_FILES netcdf.3)
|
|
|
|
|
2012-07-17 06:31:35 +08:00
|
|
|
set(ARGS_MANPAGE -DAPI=C)
|
|
|
|
|
|
|
|
IF (USE_NETCDF4)
|
2014-04-22 01:15:33 +08:00
|
|
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DNETCDF4=TRUE)
|
2012-07-17 06:31:35 +08:00
|
|
|
ENDIF(USE_NETCDF4)
|
|
|
|
|
|
|
|
IF (BUILD_DAP)
|
2014-04-22 01:15:33 +08:00
|
|
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DDAP=TRUE)
|
2012-07-17 06:31:35 +08:00
|
|
|
ENDIF(BUILD_DAP)
|
|
|
|
|
|
|
|
IF (BUILD_PARALLEL)
|
2014-04-22 01:15:33 +08:00
|
|
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE)
|
2012-07-17 06:31:35 +08:00
|
|
|
ENDIF(BUILD_PARALLEL)
|
2013-08-14 05:42:45 +08:00
|
|
|
|
2013-08-15 23:43:59 +08:00
|
|
|
# Generate the man page.
|
2015-06-12 04:28:39 +08:00
|
|
|
IF(HAVE_M4)
|
2013-08-15 23:43:59 +08:00
|
|
|
|
2014-05-22 04:40:39 +08:00
|
|
|
FILE(GLOB libsrc_MANPAGE ${CMAKE_SOURCE_DIR}/docs/netcdf.m4)
|
2013-08-15 23:43:59 +08:00
|
|
|
FILE(COPY ${libsrc_MANPAGE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2018-04-27 04:38:56 +08:00
|
|
|
IF(NOT MSVC)
|
2013-08-14 05:57:53 +08:00
|
|
|
ADD_CUSTOM_TARGET(manpage ALL
|
2018-03-01 03:18:20 +08:00
|
|
|
|
2018-03-01 03:20:53 +08:00
|
|
|
COMMAND ${NC_M4} ${ARGS_MANPAGE} '${CMAKE_CURRENT_BINARY_DIR}/netcdf.m4' > '${CMAKE_CURRENT_BINARY_DIR}/netcdf.3'
|
2013-08-14 05:57:53 +08:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
2013-08-14 05:42:45 +08:00
|
|
|
|
2013-08-14 05:57:53 +08:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/netcdf.3 DESTINATION "share/man/man3" COMPONENT documentation)
|
2018-04-27 04:38:56 +08:00
|
|
|
ENDIF(NOT MSVC)
|
|
|
|
|
2013-08-14 05:57:53 +08:00
|
|
|
ENDIF()
|