# ITK
FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
	INCLUDE_DIRECTORIES(${ITK_INCLUDE_DIRS})
	INCLUDE(${ITK_USE_FILE})
ELSE()
	MESSAGE(FATAL_ERROR "ITK not found, but needed.")
ENDIF(ITK_FOUND)


# The headers and sources in the ritkTools module
#================================================
SET(HDRS  
	ritkTools.h
	ritkTimer.h
)

SET(SRCS 
	ritkTimer.txx
	ritkToolsInstantiations.cxx
)


# Set the library name for the ritkTools module
# =============================================
SET(TOOLS_LIBRARY ritkTools CACHE INTERNAL "")
SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)


# Project settings
# ================
SET(TOOLS_INCLUDE_DIRS
	${TOOLS_INCLUDE_DIRS}
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}	
	CACHE INTERNAL ""
)
INCLUDE_DIRECTORIES(${TOOLS_INCLUDE_DIRS})
ADD_DEFINITIONS("/DTOOLS_SHAREDLIB_EXPORT")
ADD_LIBRARY(${TOOLS_LIBRARY} SHARED ${SRCS} ${HDRS} ${MOC_SRCS} ${UI_HDRS})
TARGET_LINK_LIBRARIES(${TOOLS_LIBRARY} ${ITK_LIBRARIES})
SET_TARGET_PROPERTIES(${TOOLS_LIBRARY} PROPERTIES DEBUG_POSTFIX "d")


# Module installation
# ====================
INSTALL(FILES ${HDRS} DESTINATION dev/include/Tools)
INSTALL(TARGETS ${TOOLS_LIBRARY} CONFIGURATIONS Debug
	RUNTIME DESTINATION bin/debug
	LIBRARY DESTINATION dev/lib/debug
	ARCHIVE DESTINATION dev/lib/debug
)
INSTALL(TARGETS ${TOOLS_LIBRARY} CONFIGURATIONS Release
	RUNTIME DESTINATION bin/release
	LIBRARY DESTINATION dev/lib/release
	ARCHIVE DESTINATION dev/lib/release
)
