Skip to content

Commit

Permalink
Windows build fixes. Refs #281
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.nexusformat.org/code/trunk@1749 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
  • Loading branch information
FreddieAkeroyd authored and Freddie Akeroyd committed Nov 9, 2011
1 parent 4a43ee6 commit 6c6b662
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 12 additions & 1 deletion Windows_extra/libNeXus-0-Win32.def
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ NXMDisableErrorReporting
NXMEnableErrorReporting
NXMGetError
NXMSetError
NXMSetTError
createNXDataset
createTextNXDataset
dropNXDataset
Expand All @@ -65,6 +66,7 @@ nxiclose_
nxiclosedata_
nxiclosegroup_
nxicompmakedata_
nxicompmakedata64_
nxicompress_
nxifclose_
nxifcompmakedata_
Expand All @@ -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_
Expand All @@ -105,9 +112,13 @@ nxiopensourcegroup_
nxiputattr_
nxiputdata_
nxiputslab_
nxiputslab64_
nxisameid_
nxisetcache_
nxisetnumberformat_
putNXDatasetValue
putNXDatasetValueAt
nxigetpath_
nxigetpath_
nxilinkexternaldataset_
nxiisexternaldataset_
nxireopen_
15 changes: 13 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6c6b662

Please sign in to comment.