Skip to content

Commit

Permalink
BUG: Fix exporting for Nrrd library
Browse files Browse the repository at this point in the history
The Nrrd library was always marked for dllexport due to a defines. In
actuallity, on windows this library is build as static. Now
"TEEM_STATIC" is correct defined so that nothing is marked as a dll
interface.

Additionally, the NrrdIO.h file was removed from the itkNrddImageIO.h
to improve encapsulation, and and reduce unneeded headers being used.

Change-Id: I2e23050928cdb9fe6779c29c50a36ab7f4093c9f
  • Loading branch information
blowekamp committed Apr 4, 2012
1 parent 6013036 commit 3954208
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion Modules/IO/NRRD/include/itkNrrdImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "itkImageIOBase.h"
#include <fstream>
#include "NrrdIO.h"

namespace itk
{
Expand Down
2 changes: 2 additions & 0 deletions Modules/IO/NRRD/src/itkNrrdImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*=========================================================================*/

#include "itkNrrdImageIO.h"
#include "NrrdIO.h"

#include "itkMetaDataObject.h"
#include "itkIOCommon.h"
#include "itkFloatingPointExceptions.h"
Expand Down
10 changes: 7 additions & 3 deletions Modules/ThirdParty/NrrdIO/src/NrrdIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ formatNRRD.c encoding.c encodingRaw.c encodingAscii.c encodingHex.c
encodingGzip.c subset.c encodingBzip2.c formatEPS.c formatPNG.c
formatPNM.c formatText.c formatVTK.c )

# Turn on TEEM_BUILD so that the proper dll export def's are
# used on windows builds.
ADD_DEFINITIONS(-DTEEM_BUILD=1)
# Turn on TEEM_BUILD and TEEM_STATIIC so that the proper dll export
# def's are used on windows builds.
ADD_DEFINITIONS(-DTEEM_BUILD)

if(NOT BUILD_SHARED_LIBS)
set(TEEM_STATIC 1)
endif()

# Configure files with settings for use by the build.
CONFIGURE_FILE(${ITK3P_NrrdIO_SOURCE_DIR}/NrrdConfigure.h.in
Expand Down
2 changes: 2 additions & 0 deletions Modules/ThirdParty/NrrdIO/src/NrrdIO/NrrdConfigure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@
#endif
#endif

#cmakedefine TEEM_STATIC

#endif // __NrrdConfigure_h
1 change: 0 additions & 1 deletion Modules/ThirdParty/NrrdIO/src/NrrdIO/NrrdIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
extern "C" {
#endif

#define TEEM_BUILD 1
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(TEEM_STATIC)
# if defined(TEEM_BUILD) || defined(air_EXPORTS) || defined(teem_EXPORTS)
# define NRRDIO_EXPORT extern __declspec(dllexport)
Expand Down

0 comments on commit 3954208

Please sign in to comment.