netcdf-c/libsrc/CMakeLists.txt

68 lines
1.7 KiB
CMake
Raw Normal View History

## This is a CMake file, part of Unidata's netCDF package.
# Copyright 2012-2018, see the COPYRIGHT file for more information.
# 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()
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
nc3internal.c var.c dim.c ncx.c lookup3.c ncio.c)
SET(libsrc_SOURCES ${libsrc_SOURCES} pstdint.h ncio.h ncx.h)
2012-07-14 00:37:14 +08:00
SET(libsrc_SOURCES ${libsrc_SOURCES} memio.c)
2012-07-14 00:37:14 +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)
SET(libsrc_SOURCES ${libsrc_SOURCES} ffio.c)
ELSEIF (USE_STDIO)
SET(libsrc_SORUCES ${libsrc_SOURCES} ncstdio.c)
2012-07-17 06:31:35 +08:00
ELSE (USE_FFIO)
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)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DNETCDF4=TRUE)
2012-07-17 06:31:35 +08:00
ENDIF(USE_NETCDF4)
IF (BUILD_DAP)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DDAP=TRUE)
2012-07-17 06:31:35 +08:00
ENDIF(BUILD_DAP)
IF (BUILD_PARALLEL)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE)
2012-07-17 06:31:35 +08:00
ENDIF(BUILD_PARALLEL)
# Generate the man page.
IF(HAVE_M4)
2014-05-22 04:40:39 +08:00
FILE(GLOB libsrc_MANPAGE ${CMAKE_SOURCE_DIR}/docs/netcdf.m4)
FILE(COPY ${libsrc_MANPAGE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
IF(NOT MSVC)
ADD_CUSTOM_TARGET(manpage ALL
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'
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/netcdf.3 DESTINATION "share/man/man3" COMPONENT documentation)
ENDIF(NOT MSVC)
ENDIF()