project(cd_pult)
import_version(${PROJECT_NAME} qcd_utils)
find_qt(${QtVersions} Core Gui OpenGL)
set_deploy_property(${PROJECT_NAME}
		LABEL 		${PROJECT_NAME}
		FULLNAME 	"${_QCD_DOMAIN}.${PROJECT_NAME}"
		COMPANY 	${_QCD_COMPANY}
		INFO 		"CD Pult")
if (Qt5_FOUND)
	import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
	import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
endif()
make_rc(${PROJECT_NAME} out_RC)
qt_sources(SRC)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP ${out_RC})
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic qad_application qcd_utils piqt_utils)
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../../piqt_utils" ${QAD_INCLUDES})
message(STATUS "Building ${PROJECT_NAME}")
if(LIB)
	if(WIN32)
		qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN})
	else()
		if (DEFINED ANDROID_PLATFORM)
			qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin)
		else()
			qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin)
		endif()
	endif()
	#message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
else()
	qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
endif()
if (Qt5_FOUND)
	deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release)
endif()
