diff --git a/CMakeLists.txt b/CMakeLists.txt index c2f0be6ad..64a221440 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ FIND_PACKAGE(PkgConfig QUIET) ## File taken from http://ensc.de/cmake/FindMakeDist.cmake FIND_PACKAGE(MakeDist) ADD_MAKEDIST() -ENABLE_MAKEDIST(cmake_config.h.in CMakeLists.txt cmake) + ## End 'enable dist and distcheck' # Only necessary for Windows @@ -97,6 +97,16 @@ ENDIF() ##### # Some utility macros/scripts. ##### +# Macro to append files to the EXTRA_DIST files. +##### +SET(EXTRA_DIST "") +MACRO(ADD_EXTRA_DIST files) + FOREACH(F ${files}) + SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/${F}) + SET(EXTRA_DIST ${EXTRA_DIST} PARENT_SCOPE) + + ENDFOREACH() +ENDMACRO() # A basic script used to convert m4 files MACRO(GEN_m4 filename) @@ -206,6 +216,7 @@ MACRO(print_conf_summary) MESSAGE(STATUS "\tUsing pnetcdf:\t\t\t" ${STATUS_PNETCDF}) MESSAGE(STATUS "\tUsing Parallel IO:\t\t" ${STATUS_PARALLEL}) MESSAGE(STATUS "\tLinking against:\t\t" "${ALL_TLL_LIBS}") + MESSAGE("") ENDMACRO() @@ -649,7 +660,14 @@ CHECK_TYPE_SIZE("uchar" SIZEOF_UCHAR) CHECK_TYPE_SIZE("int64_t" SIZEOF_INT64_T) CHECK_TYPE_SIZE("uint64_t" SIZEOF_UINT64_T) -SET(HAVE_SSIZE_T SIZEOF_SSIZE_T CACHE STRING "") +IF(SIZEOF_SSIZE_T) + SET(HAVE_SSIZE_T 1) +ELSE() + CHECK_TYPE_SIZE("SSIZE_T" SIZEOF_SSIZE_T) + IF(SIZEOF_SSIZE_T) + SET(HAVE_SSIZE_T 1) + ENDIF() +ENDIF() # Check for various functions. CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC) @@ -916,7 +934,10 @@ set (CPACK_COMPONENT_DEPENDENCIES_DESCRIPTION set (CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "The netCDF user documentation.") print_conf_summary() -#MESSAGE(STATUS "CPACK_SOURCE_IGNORE_FILES: ${CPACK_SOURCE_IGNORE_FILES}") + +# Enable Makedist files. +ENABLE_MAKEDIST(README COPYRIGHT RELEASE_NOTES INSTALL INSTALL.cmake test_prog.c lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt config.h.in.cmake cmake_uninstall.cmake.in netcdf-config-version.cmake.in netcdf-config.cmake.in FixBundle.cmake.in nc-config.in.cmake RELEASE_NOTES.md configure) + # CPack inclusion must come last. INCLUDE(CPack) diff --git a/config.h.in.cmake b/config.h.in.cmake index 48bfb1b7a..b9d24905f 100644 --- a/config.h.in.cmake +++ b/config.h.in.cmake @@ -268,6 +268,5 @@ #cmakedefine DLL_EXPORT #cmakedefine DLL_NETCDF - #include #endif diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index 833a0515f..8adf2741f 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -51,3 +51,4 @@ IF (BUILD_PARALLEL) SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE) ENDIF(BUILD_PARALLEL) +ADD_EXTRA_DIST("${libsrc_SOURCES}" attr.m4 ncx.m4 putget.m4 XGetopt.c) \ No newline at end of file diff --git a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt index 100dce253..2858d0f17 100644 --- a/oc2/CMakeLists.txt +++ b/oc2/CMakeLists.txt @@ -2,7 +2,6 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(".") -#SET(oc_SOURCES occurlfunctions.c dapparse.c daplex.c ocdata.c ocuri.c ochttp.c ocbytes.c oc.c ocdebug.c ocdump.c ocinternal.c occompile.c oclist.c oclog.c ocnode.c ocutil.c occlientparams.c ocrc.c ocread.c xxdr.c daptab.c) SET(oc_SOURCES oc.c daplex.c dapparse.c daptab.c occlientparams.c occompile.c occurlfunctions.c ocdata.c ocdebug.c ocdump.c ocinternal.c ocnode.c ochttp.c ocrc.c ocread.c ocutil.c ocbytes.c oclist.c ocuri.c oclog.c xxdr.c) add_library(oc2 OBJECT ${oc_SOURCES}) diff --git a/oc2/ocdump.c b/oc2/ocdump.c index 77e2cd3f4..40ee71cc1 100644 --- a/oc2/ocdump.c +++ b/oc2/ocdump.c @@ -15,7 +15,8 @@ #else #define ssize_t int #endif -#endif +#define HAVE_SSIZE_T +#endif #include "ocinternal.h" #include "ocdebug.h"