mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-25 17:40:27 +08:00
Changes in suport of CMake
This commit is contained in:
parent
ec4b3dd141
commit
2dc39563cc
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.6)
|
|||||||
#Project Name
|
#Project Name
|
||||||
project(NETCDF C)
|
project(NETCDF C)
|
||||||
ADD_DEFINITIONS()
|
ADD_DEFINITIONS()
|
||||||
|
SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
#Add custom CMake Modules
|
#Add custom CMake Modules
|
||||||
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/"
|
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/"
|
||||||
CACHE INTERNAL "Location of our custom CMake modules.")
|
CACHE INTERNAL "Location of our custom CMake modules.")
|
||||||
@ -46,6 +46,14 @@ FIND_PACKAGE (CURL)
|
|||||||
FIND_PACKAGE (HDF5)
|
FIND_PACKAGE (HDF5)
|
||||||
FIND_PACKAGE (ZLIB)
|
FIND_PACKAGE (ZLIB)
|
||||||
|
|
||||||
|
# Enable some additional flags.
|
||||||
|
IF (DLL_NETCDF)
|
||||||
|
SET(BUILD_DLL ON)
|
||||||
|
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -DDLL_EXPORT)
|
||||||
|
ENDIF (DLL_NETCDF)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Beging autotools-style checks for config.h
|
## Beging autotools-style checks for config.h
|
||||||
|
|
||||||
CHECK_INCLUDE_FILE("alloca.h" HAVE_ALLOCA_H)
|
CHECK_INCLUDE_FILE("alloca.h" HAVE_ALLOCA_H)
|
||||||
@ -105,7 +113,7 @@ SET (NETCDF_LIB_CORENAME "netcdf")
|
|||||||
#add_subdirectory(man4)
|
#add_subdirectory(man4)
|
||||||
#add_subdirectory(man4/images)
|
#add_subdirectory(man4/images)
|
||||||
add_subdirectory(libsrc)
|
add_subdirectory(libsrc)
|
||||||
#add_subdirectory(libsrc4)
|
add_subdirectory(libsrc4)
|
||||||
#add_subdirectory(nc_test4)
|
#add_subdirectory(nc_test4)
|
||||||
#add_subdirectory(nc_test)
|
#add_subdirectory(nc_test)
|
||||||
#add_subdirectory(ncdump)
|
#add_subdirectory(ncdump)
|
||||||
|
@ -86,11 +86,17 @@
|
|||||||
|
|
||||||
/* Set this when building a DLL under MinGW */
|
/* Set this when building a DLL under MinGW */
|
||||||
#cmakedefine DLL_NETCDF
|
#cmakedefine DLL_NETCDF
|
||||||
|
#cmakedefine BUILD_DLL
|
||||||
/* Set this when DAP is enabled. */
|
/* Set this when DAP is enabled. */
|
||||||
#cmakedefine ENABLE_DAP
|
#cmakedefine ENABLE_DAP
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `uchar'.*/
|
||||||
#cmakedefine HAVE_UCHAR 1
|
#cmakedefine HAVE_UCHAR 1
|
||||||
|
|
||||||
#include <ncconfigure.h>
|
/* Define to 1 if the system has the type 'unsigned long long int'.*/
|
||||||
|
#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT
|
||||||
|
|
||||||
|
#cmakedefine HAVE_LONG_LONG_INT
|
||||||
|
|
||||||
|
#include <ncconfigure.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(".")
|
INCLUDE_DIRECTORIES(".")
|
||||||
#INCLUDE_DIRECTORIES(${NETCDF_SOURCE_DIR}/include)
|
|
||||||
|
|
||||||
|
# Process these files with m4.
|
||||||
|
SET(m4_SOURCES attr ncx putget t_ncxx)
|
||||||
|
MACRO(GEN_m4 filename)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
|
||||||
|
COMMAND m4 ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
ENDMACRO(GEN_m4)
|
||||||
|
|
||||||
|
foreach (f ${m4_SOURCES})
|
||||||
#SET(libsrc_SOURCES dim.c ffio.c lookup3.c memio.c mmap.c mmapio.c nc.c nc3dispatch.c ncFile.c ncio.c nclistmgr.c ncstdio.c ncx_cray.c posixio.c t_ncio.c t_ncx.c v1hpg.c var.c winceio.c)
|
GEN_m4(${f})
|
||||||
|
endforeach(f)
|
||||||
|
|
||||||
SET(libsrc_SOURCES v1hpg.c nclistmgr.c putget.c attr.c nc3dispatch.c nc.c var.c dim.c ncx.c lookup3.c ncio.c)
|
SET(libsrc_SOURCES v1hpg.c nclistmgr.c putget.c attr.c nc3dispatch.c nc.c var.c dim.c ncx.c lookup3.c ncio.c)
|
||||||
|
|
||||||
@ -19,6 +28,26 @@ ENDIF (BUILD_DISKLESS)
|
|||||||
|
|
||||||
IF (USE_FFIO)
|
IF (USE_FFIO)
|
||||||
SET(libsrc_SOURCES ${libsrc_SOURCES} ffio.c)
|
SET(libsrc_SOURCES ${libsrc_SOURCES} ffio.c)
|
||||||
|
ELSE (USE_FFIO)
|
||||||
|
SET(libsrc_SOURCES ${libsrc_SOURCES} posixio.c)
|
||||||
ENDIF (USE_FFIO)
|
ENDIF (USE_FFIO)
|
||||||
|
|
||||||
add_library(netcdf3 ${libsrc_SOURCES})
|
add_library(netcdf3 ${libsrc_SOURCES})
|
||||||
|
|
||||||
|
# The C API man page.
|
||||||
|
set(man_MANS netcdf.3)
|
||||||
|
|
||||||
|
set(ARGS_MANPAGE -DAPI=C)
|
||||||
|
|
||||||
|
IF (USE_NETCDF4)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DNETCDF4=TRUE)
|
||||||
|
ENDIF(USE_NETCDF4)
|
||||||
|
|
||||||
|
IF (BUILD_DAP)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DDAP=TRUE)
|
||||||
|
ENDIF(BUILD_DAP)
|
||||||
|
|
||||||
|
IF (BUILD_PARALLEL)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE)
|
||||||
|
ENDIF(BUILD_PARALLEL)
|
||||||
|
|
||||||
|
@ -52,9 +52,15 @@ dnl
|
|||||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||||
# define ULLONG_MAX 18446744073709551615ULL
|
# define ULLONG_MAX 18446744073709551615ULL
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef LONG_LONG_MAX
|
||||||
#define LONG_LONG_MAX LLONG_MAX
|
#define LONG_LONG_MAX LLONG_MAX
|
||||||
|
#endif
|
||||||
|
#ifndef LONG_LONG_MIN
|
||||||
#define LONG_LONG_MIN LLONG_MIN
|
#define LONG_LONG_MIN LLONG_MIN
|
||||||
|
#endif
|
||||||
|
#ifndef ULONG_LONG_MAX
|
||||||
#define ULONG_LONG_MAX ULLONG_MAX
|
#define ULONG_LONG_MAX ULLONG_MAX
|
||||||
|
#endif
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#ifndef FLT_MAX /* This POSIX macro missing on some systems */
|
#ifndef FLT_MAX /* This POSIX macro missing on some systems */
|
||||||
# ifndef NO_IEEE_FLOAT
|
# ifndef NO_IEEE_FLOAT
|
||||||
|
27
libsrc4/CMakeLists.txt
Normal file
27
libsrc4/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(".")
|
||||||
|
|
||||||
|
# Process these files with m4.
|
||||||
|
|
||||||
|
SET(libsrc4_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4file.c nc4grp.c nc4type.c nc4var.c ncfunc.c nc4internal.c nc4hdf.c error4.c)
|
||||||
|
|
||||||
|
add_library(netcdf4 ${libsrc4_SOURCES})
|
||||||
|
|
||||||
|
# The C API man page.
|
||||||
|
set(man_MANS netcdf.3)
|
||||||
|
|
||||||
|
set(ARGS_MANPAGE -DAPI=C)
|
||||||
|
|
||||||
|
IF (USE_NETCDF4)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DNETCDF4=TRUE)
|
||||||
|
ENDIF(USE_NETCDF4)
|
||||||
|
|
||||||
|
IF (BUILD_DAP)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DDAP=TRUE)
|
||||||
|
ENDIF(BUILD_DAP)
|
||||||
|
|
||||||
|
IF (BUILD_PARALLEL)
|
||||||
|
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE)
|
||||||
|
ENDIF(BUILD_PARALLEL)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user