CMake support changed

This commit is contained in:
Ward Fisher 2012-07-19 22:11:10 +00:00
parent 86b9a01f2d
commit 4af02f4c75
4 changed files with 104 additions and 2 deletions

View File

@ -9,7 +9,7 @@ ADD_DEFINITIONS()
### Verbose make, for debugging.
#SET(CMAKE_VERBOSE_MAKEFILE ON)
#Add custom CMake Modules
#Add custom CMake Module
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/"
CACHE INTERNAL "Location of our custom CMake modules.")
@ -44,7 +44,7 @@ ENDIF(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
OPTION (DLL_NETCDF "Build a Windows DLL." OFF)
# Option to Build DAP Client
OPTION (ENABLE_DAP "Enable DAP Client." OFF)
OPTION (BUILD_DAP "Enable DAP Client." OFF)
# Option to use MMAP
OPTION (BUILD_MMAP "Use MMAP." OFF)
@ -90,6 +90,8 @@ IF (USE_HDF5)
ENDIF (USE_HDF5)
# Packages to include
#FIND_PACKAGE (CURL)
#FIND_PACKAGE (ZLIB)
@ -134,6 +136,31 @@ CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
CHECK_TYPE_SIZE("uchar" SIZEOF_UCHAR)
# Check for various functions.
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strcat HAVE_STRCAT)
CHECK_FUNCTION_EXISTS(strcpy HAVE_STRCPY)
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strtod HAVE_STRTOD)
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
CHECK_FUNCTION_EXISTS(strtoull HAVE_STROULL)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
CHECK_FUNCTION_EXISTS(rand HAVE_RAND)
CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS(MPI_Comm_f2C HAVE_MPI_COMM_F2C)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE)
CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
# Option for file cache size for HDF5
@ -168,6 +195,11 @@ IF (USE_HDF5)
add_subdirectory(libsrc4)
ENDIF (USE_HDF5)
IF (BUILD_DAP)
ADD_SUBDIRECTORY(oc)
ENDIF()
add_subdirectory(liblib)
#add_subdirectory(nc_test4)
#add_subdirectory(nc_test)

View File

@ -120,6 +120,33 @@
#define SIZEOF_OFF_T 8
#endif
/* Set if we have strdup */
#cmakedefine HAVE_STRDUP
#cmakedefine HAVE_STRLCAT
#cmakedefine HAVE_STRERROR
#cmakedefine HAVE_SNPRINTF
#cmakedefine HAVE_STRCHR
#cmakedefine HAVE_STRRCHR
#cmakedefine HAVE_STRCAT
#cmakedefine HAVE_STRCPY
#cmakedefine HAVE_STRDUP
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRTOD
#cmakedefine HAVE_STRTOLL
#cmakedefine HAVE_STROULL
#cmakedefine HAVE_STRSTR
#cmakedefine HAVE_MKSTEMP
#cmakedefine HAVE_RAND
#cmakedefine HAVE_GETRLIMIT
#cmakedefine HAVE_GETTIMEOFDAY
#cmakedefine HAVE_FSYNC
#cmakedefine HAVE_MPI_COMM_F2C
#cmakedefine HAVE_MEMMOVE
#cmakedefine HAVE_GETPAGESIZE
#cmakedefine HAVE_SYSCONF
#cmakedefine HAVE_MREMAP
/* Set this when building a DLL under MinGW */
#cmakedefine DLL_NETCDF
#cmakedefine BUILD_DLL

View File

@ -8,6 +8,10 @@ IF(USE_HDF5 OR USE_NETCDF4)
SET(liblib_LIBS ${liblib_LIBS} netcdf4)
ENDIF()
IF(BUILD_DAP)
SET(liblib_LIBS ${liblib_LIBS} oc)
ENDIF()
FOREACH(LIBS ${liblib_LIBS})
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
ENDFOREACH()

39
oc/CMakeLists.txt Normal file
View File

@ -0,0 +1,39 @@
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
INCLUDE_DIRECTORIES(".")
# Process these files with m4.
#SET(oc_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4file.c nc4grp.c nc4type.c nc4var.c ncfunc.c nc4internal.c nc4hdf.c error4.c)
SET(oc_SOURCES occurlfunctions.c dapparse.c daplex.c ocuri.c ochttp.c ocbytes.c oc.c occontent.c ocdebug.c ocdrno.c ocdump.c ocinternal.c oclist.c oclog.c ocnode.c ocutil.c occlientparams.c ocrc.c ocread.c xxdr.c daptab.c)
add_library(oc OBJECT ${oc_SOURCES})
###
# Options related to the man page generation.
###
###
# 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)