Additional CMake support changes.

This commit is contained in:
Ward Fisher 2012-07-24 22:53:58 +00:00
parent 9726e2d283
commit dfdad6adf7
7 changed files with 108 additions and 37 deletions

View File

@ -42,16 +42,6 @@ IF(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
ENDIF(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
# Option to Build DAP Client
OPTION (BUILD_DAP "Enable DAP Client." OFF)
IF (BUILD_DAP)
#FIND_PACKAGE(CURL)
FIND_LIBRARY(CURL NAMES curl libcurl)
IF(NOT CURL)
MESSAGE(FATAL_ERROR "DAP Support specified, CURL libraries are not found.")
ENDIF(NOT CURL)
MESSAGE("Looking for libcurl: ${CURL}")
ENDIF(BUILD_DAP)
# Option to use MMAP
OPTION (BUILD_MMAP "Use MMAP." OFF)
@ -78,28 +68,26 @@ ENDIF (USE_HDF4)
# Option to Build DLL
OPTION (DLL_NETCDF "Build a Windows DLL." OFF)
IF (DLL_NETCDF)
SET(BUILD_DLL ON)
OPTION (BUILD_DLL "Build a Windows DLL." OFF)
IF (BUILD_DLL)
SET(DLL_NETCDF ON)
SET(DLL_EXPORT ON)
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -DDLL_EXPORT)
ENDIF (DLL_NETCDF)
ENDIF ()
OPTION (ENABLE_DOXYGEN "Enable generation of documentation" OFF)
OPTION (ENABLE_INTERNAL_DOCS "Enable documentation of library internals. This is of interest only to those developing the netCDF library." OFF)
OPTION (USE_FSYNC "Enable experimental fsync code." OFF)
OPTION (VALGRIND_TESTS "Build with valgrind tests (valgrind is required, static builds only." OFF)
OPTION (ENABLE_NETCDF_4 "Enable NetCDF-4" OFF)
OPTION (ENABLE_NETCDF_4 "Enable NetCDF-4" ${USE_HDF5})
IF(ENABLE_NETCDF_4)
SET(ENABLE_NETCDF4 ON)
SET(ENABLE_NETCDF4 ON CACHE BOOL "")
ENDIF()
OPTION (ENABLE_CDMREMOTE OFF "Build with cdmremote client support.")
# Option to Enable HDF5
OPTION (USE_HDF5 "Use HDF5." OFF)
IF (USE_HDF5 OR ENABLE_NETCDF4)
OPTION (USE_HDF5 "Use HDF5." ${ENABLE_NETCDF_4})
IF (USE_HDF5 OR ENABLE_NETCDF_4)
SET(USE_HDF5 ON)
SET(USE_NETCDF4 ON)
@ -123,14 +111,42 @@ IF (USE_HDF5 OR ENABLE_NETCDF4)
ENDIF ()
# Option to Build DAP Client
OPTION (BUILD_DAP "Enable DAP Client." OFF)
IF (BUILD_DAP)
#FIND_PACKAGE(CURL)
FIND_LIBRARY(CURL NAMES curl libcurl)
IF(NOT CURL)
MESSAGE(FATAL_ERROR "DAP Support specified, CURL libraries are not found.")
ENDIF(NOT CURL)
MESSAGE("Looking for libcurl: ${CURL}")
ENDIF(BUILD_DAP)
IF(ENABLE_NETCDF4 AND BUILD_DAP)
OPTION(ENABLE_DAP_GROUPS "Whether netcdf4 group names should be enabled." ON)
ELSE()
SET(ENABLE_DAP_GROUPS OFF CACHE BOOL "Whether netcdf4 group names should be enabled.")
ENDIF()
OPTION (ENABLE_DOXYGEN "Enable generation of documentation" OFF)
OPTION (ENABLE_INTERNAL_DOCS "Enable documentation of library internals. This is of interest only to those developing the netCDF library." OFF)
OPTION (USE_FSYNC "Enable experimental fsync code." OFF)
OPTION (VALGRIND_TESTS "Build with valgrind tests (valgrind is required, static builds only." OFF)
# Does the user want to turn on PNETCDF read ability?
OPTION (ENABLE_PNETCDF "Enable parallel I/O for classic and 64-bit offset files using parallel-netcdf." OFF)
OPTION(BUILD_CDMREMOTE "Enabled CDMRemote" OFF)
MARK_AS_ADVANCED(ENABLE_DOXYGEN ENABLE_INTERNAL_DOCS VALGRIND_TESTS ENABLE_PNETCDF BUILD_CDMREMOTE)
#####
# End option checks.
#####
#INCLUDE_DIRECTORIES("/usr/include/machine/")
# Library checks
CHECK_INCLUDE_FILE("alloca.h" HAVE_ALLOCA_H)
@ -158,6 +174,7 @@ CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE("curl.h" HAVE_CURL_H)
CHECK_INCLUDE_FILE("pstdint.h" HAVE_PSTDINT_H)
CHECK_INCLUDE_FILE("endian.h" HAVE_ENDIAN_H)
# Type checks
CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE)
@ -233,8 +250,12 @@ ENDIF (USE_HDF5)
IF (BUILD_DAP)
ADD_SUBDIRECTORY(oc)
ADD_SUBDIRECTORY(libdap2)
ENDIF()
IF (BUILD_CDMREMOTE)
ADD_SUBDIRECTORY(libcdmr)
ENDIF()
add_subdirectory(liblib)
#add_subdirectory(nc_test4)

View File

@ -1,6 +1,6 @@
#ifndef CONFIG_H
#define CONFIG_H
#define HAVE_CONFIG_H
/* Cache Size, other variables for HDF5 */
#define DEFAULT_CHUNK_SIZE ${DEFAULT_CHUNK_SIZE}
#define DEFAULT_CHUNKS_IN_CACHE ${DEFAULT_CHUNKS_IN_CACHE}

View File

@ -34,7 +34,10 @@
#include <stdio.h> /* for occasional printf()s */
#include <stdlib.h> /* for abort(), malloc() etc */
#include <string.h> /* for strlen(), memcpy(), memmove() */
#include <endian.h>
#ifdef HAVE_ENDIAN_H
#include <machine/endian.h>
#endif
#include "config.h"
#include <ast_runtime.h>

View File

@ -1,6 +1,6 @@
#ifdef HAVE_CONFIG_H
//#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
//#endif
#include <stdlib.h>
#include <stdio.h>

32
libdap2/CMakeLists.txt Normal file
View File

@ -0,0 +1,32 @@
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
INCLUDE_DIRECTORIES(".")
SET(dap2_SOURCES constraints3.c common34.c dapcvt.c dapalign.c dapodom.c daputil.c ncdaperr.c cdf3.c cache.c dapdump.c dapdebug.c dapattr3.c ncd3dispatch.c ncdap3.c ncdap3a.c getvara3.c dceconstraints.c dcetab.c dceparse.c dcelex.c)
add_library(dap2 OBJECT ${dap2_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)

View File

@ -9,9 +9,14 @@ IF(USE_HDF5 OR USE_NETCDF4)
ENDIF()
IF(BUILD_DAP)
SET(liblib_LIBS ${liblib_LIBS} oc)
SET(liblib_LIBS ${liblib_LIBS} oc dap2)
ENDIF()
IF(BUILD_CDMREMOTE)
SET(liblib_LIBS ${liblib_LIBS} cdmr)
ENDIF()
FOREACH(LIBS ${liblib_LIBS})
SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
ENDFOREACH()
@ -25,6 +30,12 @@ ENDIF(BUILD_DAP)
IF(USE_HDF5 OR USE_NETCDF4)
TARGET_LINK_LIBRARIES(netcdf ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARY} )
ENDIF()
IF(BUILD_DAP)
TARGET_LINK_LIBRARIES(netcdf ${CURL})
ENDIF()
#TARGET_LINK_LIBRARIES(netcdf ${LARGS})
#ADD_LIBRARY(netcdf stub.c $<TARGET_OBJECTS:dispatch> $<TARGET_OBJECTS:netcdf3>)

View File

@ -38,6 +38,8 @@ BUILDTYPE='-DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_LIBS=ON'
HDF5OPS='-DUSE_HDF5=OFF -DUSE_HDF5=ON'
DAPOPS='-DBUILD_DAP=OFF -DBUILD_DAP=ON'
DISKLESSOPS='-DBUILD_DISKLESS=OFF -DBUILD_DISKLESS=ON'
CDMROPS='-DENABLE_CDMREMOTE=OFF -DENABLE_CDMREMOTE=ON'
DOXOPS='-DENABLE_DOXYGEN=OFF -DENABLE_DOXYGEN=ON'
INTOPS='-DENABLE_INTERNAL_DOCS=OFF -DENABLE_INTERNAL_DOCS=ON'
@ -61,12 +63,13 @@ for BT in $BUILDTYPE; do
for HOPS in $HDF5OPS; do
for DOPS in $DAPOPS; do
for DIOPS in $DISKLESSOPS; do
for DOXS in $DOXOPS; do
for IOPS in $INTOPS; do
for FOPS in $FSYOPS; do
for VLOPS in $VALOPS; do
for N4OPS in $NC4OPS; do
CUROPS="$BT $HOPS $DOPS $DIOPS $MMAPOPS $DOXS $IOPS $FOPS $VLOPS $N4OPS"
for COPS in $CDMROPS; do
#for DOXS in $DOXOPS; do
#for IOPS in $INTOPS; do
#for FOPS in $FSYOPS; do
#for VLOPS in $VALOPS; do
#for N4OPS in $NC4OPS; do
CUROPS="$BT $HOPS $DOPS $DIOPS $MMAPOPS $COPS"
echo "Options: $CUROPS"
if [ x$BLDTYPE = "xWIN" ]; then
cmake $CUROPS .. -G"MSYS Makefiles" >> $LOGFILE
@ -110,10 +113,11 @@ for BT in $BUILDTYPE; do
if [ x$DOCLEAN = "xYES" ]; then
rm -rf *
fi
done
done
done
done
#done
#done
#done
#done
#done
done
done
done