Commit c342c372 authored by pieper's avatar pieper
Browse files

COMP: fix windows build for BRAINSCommonLib library

git-svn-id: http://svn.slicer.org/Slicer4/trunk@12936 3bd1e089-480b-0410-8dfb-8563597acbee
parent 45bb38d7
/*
* Here is where system computed values get stored.
* These values should only change when the target compile platform changes.
*/
#if defined(WIN32) && !defined(BRAINSCOMMONLIB_STATIC)
#pragma warning ( disable : 4275 )
#endif
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define BRAINSCOMMONLIB_STATIC
#endif
/// BRAINSCommonLibWin32Header - manage Windows system differences
///
/// The BRAINSCommonLibWin32Header captures some system differences between Unix
/// and Windows operating systems.
#ifndef __BRAINSCommonLibWin32Header_h
#define __BRAINSCommonLibWin32Header_h
#include <BRAINSCommonLib.h>
#if defined(WIN32) && !defined(BRAINSCommonLib_STATIC)
#if defined(BRAINSCommonLib_EXPORTS)
#define BRAINSCommonLib_EXPORT __declspec( dllexport )
#else
#define BRAINSCommonLib_EXPORT __declspec( dllimport )
#endif
#else
#define BRAINSCommonLib_EXPORT
#endif
#endif
......@@ -17,6 +17,7 @@
#include <vector>
#include <string>
#include "BRAINSCommonLibWin32Header.h"
// TODO: This needs to be moved to the top, and header files moved to this
// header where needed.
......@@ -70,18 +71,18 @@ typedef itk::Transform<double,3,3> GenericTransformType;
namespace itk {
//Functions for writing out transforms to disk
extern int WriteBothTransformsToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & outputTransform, const std::string & strippedOutputTransform);
extern int WriteStrippedRigidTransformToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & strippedOutputTransform);
extern int WriteTransformToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & outputTransform);
extern GenericTransformType::Pointer ReadTransformFromDisk(const std::string initialTransform);
BRAINSCommonLib_EXPORT extern int WriteBothTransformsToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & outputTransform, const std::string & strippedOutputTransform);
BRAINSCommonLib_EXPORT extern int WriteStrippedRigidTransformToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & strippedOutputTransform);
BRAINSCommonLib_EXPORT extern int WriteTransformToDisk(GenericTransformType::Pointer & genericTransformToWrite, const std::string & outputTransform);
BRAINSCommonLib_EXPORT extern GenericTransformType::Pointer ReadTransformFromDisk(const std::string initialTransform);
/** Method for verifying that the ordering of the transformTypes is consistent with converting routines. */
extern void ValidateTransformRankOrdering(const std::vector<std::string> & transformType);
BRAINSCommonLib_EXPORT extern void ValidateTransformRankOrdering(const std::vector<std::string> & transformType);
}
namespace itk
{
class ITK_EXPORT BRAINSFitHelper : public Object
class BRAINSCommonLib_EXPORT BRAINSFitHelper : public Object
{
public:
/** Standard class typedefs. */
......
......@@ -29,6 +29,17 @@ endif(NOT ITK_FOUND)
#-----------------------------------------------------------------------------
# Output directories.
#
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/BRAINSCommonLib.h.in
${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set(BRAINSCommonLib_SRCS GenericTransformImage.cxx BRAINSFitHelper.cxx)
add_library(BRAINSCommonLib ${BRAINSCommonLib_SRCS})
......@@ -43,7 +54,7 @@ INSTALL(TARGETS BRAINSCommonLib
IF(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
FILE(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
FILE(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
INSTALL(FILES ${__files1} ${__files2}
INSTALL(FILES ${__files1} ${__files2} ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/BRAINSCommonLib
COMPONENT Development)
ENDIF(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
......
#ifndef _GenericTransformImage_H_
#define _GenericTransformImage_H_
#include "BRAINSCommonLibWin32Header.h"
#include <iostream>
#include "itkImage.h"
#include "itkCastImageFilter.h"
......@@ -55,7 +57,7 @@ AffineTransformType::Pointer
ReadLinearTransform(const std::string & filename);
void ReadDotMatTransformFile(std::string RegistrationFilename,
BRAINSCommonLib_EXPORT void ReadDotMatTransformFile(std::string RegistrationFilename,
BSplineTransformType::Pointer &itkBSplineTransform,
AffineTransformType::Pointer &ITKAffineTransform,
bool invertTransform);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment