From 6c6b6623c1672e2ec9ba6ccc61b71f1e6881867a Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Wed, 9 Nov 2011 00:59:07 +0000 Subject: [PATCH] Windows build fixes. Refs #281 git-svn-id: https://svn.nexusformat.org/code/trunk@1749 ff5d1e40-2be0-497f-93bd-dc18237bd3c7 --- CMakeLists.txt | 6 ++++++ Windows_extra/libNeXus-0-Win32.def | 13 ++++++++++++- src/CMakeLists.txt | 15 +++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d20f57..f598406d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,12 @@ set(NX_CPP -D_CRT_SECURE_NO_WARNINGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NX_CFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NX_CFLAGS}") +if (CMAKE_SIZEOF_VOID_P MATCHES "8") + set(ARCH64 1) +else() + set(ARCH64 0) +endif() + # Recurse into the subdirectories. add_subdirectory (src) add_subdirectory (bindings) diff --git a/Windows_extra/libNeXus-0-Win32.def b/Windows_extra/libNeXus-0-Win32.def index 12ddf1b6..505b70a2 100644 --- a/Windows_extra/libNeXus-0-Win32.def +++ b/Windows_extra/libNeXus-0-Win32.def @@ -50,6 +50,7 @@ NXMDisableErrorReporting NXMEnableErrorReporting NXMGetError NXMSetError +NXMSetTError createNXDataset createTextNXDataset dropNXDataset @@ -65,6 +66,7 @@ nxiclose_ nxiclosedata_ nxiclosegroup_ nxicompmakedata_ +nxicompmakedata64_ nxicompress_ nxifclose_ nxifcompmakedata_ @@ -82,20 +84,25 @@ nxigetdataid_ nxigetgroupid_ nxigetgroupinfo_ nxigetrawinfo_ +nxigetrawinfo64_ nxigetinfo_ +nxigetinfo64_ nxigetnextattr_ nxigetnextentry_ nxigetslab_ +nxigetslab64_ nxiinitattrdir_ nxiinitgroupdir_ nxiinquirefile_ nxiisexternalgroup_ nxilinkexternal_ nximakedata_ +nximakedata64_ nximakegroup_ nximakelink_ nximakenamedlink_ nximalloc_ +nximalloc64_ nxiopen_ nxiopendata_ nxiopengroup_ @@ -105,9 +112,13 @@ nxiopensourcegroup_ nxiputattr_ nxiputdata_ nxiputslab_ +nxiputslab64_ nxisameid_ nxisetcache_ nxisetnumberformat_ putNXDatasetValue putNXDatasetValueAt -nxigetpath_ \ No newline at end of file +nxigetpath_ +nxilinkexternaldataset_ +nxiisexternaldataset_ +nxireopen_ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db6d7436..08b07ceb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,9 +40,14 @@ endif (HDF5_FOUND) # need napi_exports2.c on win32 but not win64 if (WIN32) - set(NAPISRC ${NAPISRC} napi_exports.c napi_exports.h) + if (CMAKE_CL_64) + set(NAPISRC ${NAPISRC} napi_exports2.c napi_exports.h) + else() + set(NAPISRC ${NAPISRC} napi_exports.c napi_exports2.c napi_exports.h) + endif() endif (WIN32) + set (NAPISRC ${NAPISRC} nxxml.c nxio.c nxio.h) set_property(SOURCE ${NAPISRC} APPEND PROPERTY COMPILE_FLAGS ${NX_CFLAGS}) @@ -81,11 +86,17 @@ add_library (NeXus_Shared_Library SHARED ${NAPISRC}) set_property(TARGET NeXus_Shared_Library APPEND PROPERTY COMPILE_DEFINITIONS _HDF5USEDLL_) +if (CMAKE_CL_64) + set(DEF_FILE ${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-x64.def) +else() + set(DEF_FILE ${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-Win32.def) +endif() + #Note - library version needs to be got from somewhere? if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set_target_properties(NeXus_Shared_Library PROPERTIES OUTPUT_NAME libNeXus-0 VERSION 1.0 SOVERSION 4 ) - set_property(TARGET NeXus_Shared_Library APPEND PROPERTY LINK_FLAGS /def:${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-x64.def) + set_property(TARGET NeXus_Shared_Library APPEND PROPERTY LINK_FLAGS /def:${DEF_FILE}) else(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set_target_properties(NeXus_Shared_Library PROPERTIES OUTPUT_NAME NeXus VERSION 1.0 SOVERSION 4)