
add_subdirectory(Util)

set(PORTR_SOURCES stdafx.cpp stdafx.h MyUtils.cpp MyUtils.h VolRegOpt.cpp VolRegOpt.h VolRegOptITK.cpp VolumeBP.cpp VolumeBP.h Volume.h FFD_table.h ENT_table.h itkJointSegmentationRegistrationFilter.h itkJointSegmentationRegistrationFilter.txx itkJointSegmentationRegistrationFunction.h itkJointSegmentationRegistrationFunction.txx itkMultiResolutionJointSegmentationRegistration.h itkMultiResolutionJointSegmentationRegistration.txx BrainTumorRegistration.cpp)

if(CUDA_FOUND)
cuda_add_executable(PORTR ${PORTR_SOURCES} VolumeBP.cu)
else(CUDA_FOUND)
add_executable(PORTR ${PORTR_SOURCES})
endif(CUDA_FOUND)
add_executable(EvaluateQ stdafx.cpp stdafx.h MyUtils.cpp MyUtils.h Volume.h EvaluateQ.cpp)

if(ITKHasMetaIO EQUAL -1)
	set(PORTR_LIBRARIES MetaIO NIFTI zlib ${ITK_LIBRARIES})
	set(EvaluateQ_LIBRARIES MetaIO NIFTI zlib ${ITK_LIBRARIES})
else()
	set(PORTR_LIBRARIES NIFTI zlib ${ITK_LIBRARIES})
	set(EvaluateQ_LIBRARIES NIFTI zlib ${ITK_LIBRARIES})
endif()

if(WIN32)
	target_link_libraries(PORTR ${PORTR_LIBRARIES})
else(WIN32)
	target_link_libraries(PORTR ${PORTR_LIBRARIES} -lrt)
endif(WIN32)
target_link_libraries(EvaluateQ ${EvaluateQ_LIBRARIES})

install(TARGETS PORTR DESTINATION bin)
install(TARGETS EvaluateQ DESTINATION bin)
