Fixed an issue with Windows builds

not compiling due to how
ssize_t was being detected/defined.
This commit is contained in:
Ward Fisher 2013-05-24 21:19:07 +00:00
parent 1df00fa579
commit da16fc1cde
5 changed files with 27 additions and 6 deletions

View File

@ -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)

View File

@ -268,6 +268,5 @@
#cmakedefine DLL_EXPORT
#cmakedefine DLL_NETCDF
#include <ncconfigure.h>
#endif

View File

@ -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)

View File

@ -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})

View File

@ -15,7 +15,8 @@
#else
#define ssize_t int
#endif
#endif
#define HAVE_SSIZE_T
#endif
#include "ocinternal.h"
#include "ocdebug.h"