##### dtiDroid/src CMakeLists ########################################
##### $Id: CMakeLists.txt 296 2009-09-23 00:31:23Z rouchdyy@UPHS.PENNHEALTH.PRV $ ##########
#######################################################################

if(COMMAND cmake_policy)
	cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

#Build the libraries...
ADD_LIBRARY(matrixSHEN_CLASSIC matrixSHENCLASSIC.c xzdgshennewCLASSIC.c )
ADD_LIBRARY(matrixSHEN_dgtools matrixSHENdgtools.c )
ADD_LIBRARY(mvcd_dgtools mvcddgtools.c )
ADD_LIBRARY(matrixSHEN_DTIRegistrationTensorGeometry matrixSHENDRTG.cpp )
ADD_LIBRARY(mvcd_DTIRegistrationTensorGeometry mvcdDRTG.cpp  )

#build the executables...
ADD_EXECUTABLE(combinetwodeformationfields combine_two_deformationfields.c)
TARGET_LINK_LIBRARIES(combinetwodeformationfields matrixSHEN_CLASSIC)

ADD_EXECUTABLE(FloatFA2Byte FloatFA2Byte.cpp)
TARGET_LINK_LIBRARIES(FloatFA2Byte gsl gslcblas )

ADD_EXECUTABLE(reversedeformationfield ReverseDeformationField.c)
TARGET_LINK_LIBRARIES(reversedeformationfield matrixSHEN_dgtools mvcd_dgtools)

ADD_EXECUTABLE( TensorStructRegistration_V2.0 RGBAcolorMap.cpp TensorField.cpp TensorStruct-Registration-V2.cpp )
TARGET_LINK_LIBRARIES( TensorStructRegistration_V2.0 gsl gslcblas mvcd_DTIRegistrationTensorGeometry matrixSHEN_DTIRegistrationTensorGeometry)

ADD_EXECUTABLE( dtiFA dtiFA.cpp Fields.cpp)
TARGET_LINK_LIBRARIES( dtiFA gsl gslcblas )

ADD_EXECUTABLE( dtiPD dtiPD.cpp Fields.cpp)
TARGET_LINK_LIBRARIES( dtiPD gsl gslcblas )

ADD_EXECUTABLE( dtiTrace dtiTrace.cpp Fields.cpp)
TARGET_LINK_LIBRARIES( dtiTrace gsl gslcblas )

ADD_EXECUTABLE( PDcolorMap PDcolorMap.cpp RGBAcolorMapDT.cpp Fields.cpp)
TARGET_LINK_LIBRARIES( PDcolorMap gsl gslcblas )

ADD_EXECUTABLE( hammer2xdr hammer2xdr.cpp)
ADD_EXECUTABLE( xdr2hammer xdr2hammer.cpp)

SET(warp_SRCS
  DTVolume.C
  VoxMap.C 
  Basics.C 
	WarpVolume.C
	ImgVol.C 
	nrutil.C 
	svdcmp.C  
	mVolume.C 
	GPrimitive.C 
	eig.C 
	Ellipsoid.C  
	Utilities.C
)

ADD_EXECUTABLE ( warpDT.V5 nWarpDTV5.C ${warp_SRCS} )
ADD_EXECUTABLE ( LnWarpDT LnWarpDT.C ${warp_SRCS} )

INSTALL(TARGETS
	combinetwodeformationfields
	FloatFA2Byte
	reversedeformationfield
	TensorStructRegistration_V2.0
	dtiFA
	dtiPD
	dtiTrace
	PDcolorMap
	hammer2xdr
	xdr2hammer
	warpDT.V5
	LnWarpDT
	matrixSHEN_CLASSIC
	matrixSHEN_dgtools
	mvcd_dgtools
	matrixSHEN_DTIRegistrationTensorGeometry
	mvcd_DTIRegistrationTensorGeometry
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)
