PROJECT(CellTracker)

cmake_minimum_required(VERSION 2.0)

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

FIND_PACKAGE(CPLEX)
FIND_PACKAGE(CONCERT)
IF(CPLEX_FOUND)
	INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
ENDIF(CPLEX_FOUND)
IF(CONCERT_FOUND)
	INCLUDE_DIRECTORIES(${CONCERT_INCLUDE_DIRS})
ENDIF(CONCERT_FOUND)
ADD_DEFINITIONS(-DIL_STD)
find_package( Boost)

include_directories ( ${Boost_INCLUDE_DIRS} )
# INCLUDE_DIRECTORIES (D:/FARSIGHT/SOURCE/NuclearSegmentation/yousef_core)
SET(SRCS helpers.h itkBinaryThinningImageFilter3D.h ftkTrackFeatures.h itkBinaryThinningImageFilter3D.h itkBinaryThinningImageFilter3D.txx)

ADD_LIBRARY(trackingHelpers helpers.cpp helpers.h)
ADD_LIBRARY(ftkTrackFeatures ftkTrackFeatures.h ftkTrackFeatures.cpp)

#ADD_EXECUTABLE(unmix unmix.cpp helpers.h)
#ADD_EXECUTABLE(unmixt unmix_threshold.cpp helpers.h)
#ADD_EXECUTABLE(segmentation segmentation.cpp helpers.h)
#ADD_EXECUTABLE(tracking tracking.cpp helpers.h ftkTrackFeatures.h)
#ADD_EXECUTABLE(remove_small_components remove_small_components.cpp helpers.h)
IF(CPLEX_FOUND)
	ADD_EXECUTABLE(tracking_multiframe tracking_multiframe.cpp helpers.h ftkTrackFeatures.h)
ENDIF(CPLEX_FOUND)
#ADD_EXECUTABLE(vessel_thinning vessel_thinning.cpp ${SRCS})
#ADD_EXECUTABLE(summary summary.cpp helpers.h ftkTrackFeatures.h)
#ADD_EXECUTABLE(background_subtraction background_subtraction.cpp helpers.h)
#ADD_EXECUTABLE(extract_slices extract_slices.cpp helpers.h)
#ADD_EXECUTABLE(medianfilter medianfilter.cpp helpers.h)
#ADD_EXECUTABLE(anisodiff anisodiff.cpp helpers.h)
#ADD_EXECUTABLE(tracklog tracklog.cpp helpers.h)
# ADD_EXECUTABLE(render_tracks render_tracks.cpp helpers.h)

TARGET_LINK_LIBRARIES(trackingHelpers ITKIO ITKCommon ITKStatistics ftkFeatures)
# TARGET_LINK_LIBRARIES(unmix ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(unmixt ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(segmentation ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(tracking ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(remove_small_components trackingHelpers)
IF(CPLEX_FOUND)
	TARGET_LINK_LIBRARIES(tracking_multiframe ITKCommon ITKIO  ITKStatistics trackingHelpers ${CPLEX_LIBRARIES} ${CONCERT_LIBRARIES} wsock32 libKPLS)
ENDIF(CPLEX_FOUND)
# TARGET_LINK_LIBRARIES(vessel_thinning ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(summary ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers ftkTrackFeatures)
# TARGET_LINK_LIBRARIES(background_subtraction ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(extract_slices ITKCommon ITKIO Yousef_Nucleus_Seg ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(anisodiff ITKCommon ITKIO ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(medianfilter ITKCommon ITKIO ITKStatistics trackingHelpers)
#TARGET_LINK_LIBRARIES(tracklog ITKCommon ITKIO ITKStatistics trackingHelpers)
# TARGET_LINK_LIBRARIES(render_tracks ITKCommon ITKIO ITKStatistics ITKBasicFilters trackingHelpers vtkVolumeRendering vtkRendering vtkCommon vtkIO vtksys vtkFiltering vtkHybrid)


# INSTALL(TARGETS unmix RUNTIME DESTINATION bin)
# INSTALL(TARGETS unmixt RUNTIME DESTINATION bin)
# INSTALL(TARGETS segmentation RUNTIME DESTINATION bin)
# INSTALL(TARGETS tracking RUNTIME DESTINATION bin)
# INSTALL(TARGETS remove_small_components RUNTIME DESTINATION bin)
IF(CPLEX_FOUND)
	INSTALL(TARGETS tracking_multiframe RUNTIME DESTINATION bin)
ENDIF(CPLEX_FOUND)
# INSTALL(TARGETS vessel_thinning RUNTIME DESTINATION bin)
# INSTALL(TARGETS summary RUNTIME DESTINATION bin)
# INSTALL(TARGETS background_subtraction RUNTIME DESTINATION bin)
# INSTALL(TARGETS extract_slices RUNTIME DESTINATION bin)
# INSTALL(TARGETS anisodiff RUNTIME DESTINATION bin)
# INSTALL(TARGETS medianfilter RUNTIME DESTINATION bin)
# INSTALL(TARGETS tracklog RUNTIME DESTINATION bin)
# INSTALL(TARGETS render_tracks RUNTIME DESTINATION bin)

