PROJECT( Mosaic )
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_CAPITALIZED)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
ADD_DEFINITIONS(-DUNICODE)

#Use MFC in a Shared DLL
ADD_DEFINITIONS(-D_AFXDLL)
SET(CMAKE_MFC_FLAG 2)

FILE(GLOB_RECURSE HDRS_FILES *.h *.hpp)
FILE(GLOB_RECURSE SRCS_FILES *.cpp)
FILE(GLOB_RECURSE UI_FILES *.ui)
FILE(GLOB CD_FILES *.cd)

SET(FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${SRCS_FILES} ${UI_FILES} ${HDRS_FILES} PARENT_SCOPE)

SOURCE_GROUP("UI Files" FILES ${UI_FILES})
SOURCE_GROUP("Generated Files" FILES ${MOC_SRCS} ${UI_HDRS} ${RSC_SRCS})
SOURCE_GROUP("Class Diagrams" FILES ${CD_FILES} )
#SOURCE_GROUP("Resources" FILES ${RSCS} )

ADD_EXECUTABLE(${PROJECT_NAME} ${HDRS_FILES} ${SRCS_FILES} ${UI_HDRS} ${UI_FILES} ${RSC_SRCS} ${MOC_SRCS} ${CD_FILES})
ADD_DEPENDENCIES(${PROJECT_NAME} Utils)
SET_SOURCE_FILES_PROPERTIES(${CD_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) # DO NOT COMPILE CS FILES
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} ${OpenCV_LIBS} Utils libf2cd.lib BLASd.lib clapackd.lib tmglibd.lib levmar.lib)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcmt.lib")

SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES FOLDER SRC)  	
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
