DKSET(QUEUE_BUILD ON)
DKEXECUTABLE(DKRestart)

if(WIN)
	if(DEBUG)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${DEBUG_DIR}/DKRestart.exe ${DKPROJECT}/assets/DKRestart/${OS}Debug TRUE)
	endif()
	if(RELEASE)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${RELEASE_DIR}/DKRestart.exe ${DKPROJECT}/assets/DKRestart/${OS}Release TRUE)
	endif()
endif()


if(MAC)
	if(DEBUG)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${DEBUG_DIR}/DKRestart.app ${DKPROJECT}/assets/DKRestart/${OS}Debug/DKRestart.app TRUE)
	endif()
	if(RELEASE)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${RELEASE_DIR}/DKRestart.app ${DKPROJECT}/assets/DKRestart/${OS}Release/DKRestart.app" TRUE)
	endif()
endif()


if(LINUX)
	if(DEBUG)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${DEBUG_DIR}/DKRestart ${DKPROJECT}/assets/${OS}Debug/DKRestart TRUE)
	endif()
	if(RELEASE)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${RELEASE_DIR}/DKRestart ${DKPROJECT}/assets/${OS}Release/DKRestart TRUE)
	endif()
endif()


if(RASPBERRY)
	if(DEBUG)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${DEBUG_DIR}/DKRestart ${DKPROJECT}/assets/${OS}Debug/DKRestart TRUE)
	endif()
	if(RELEASE)
		DKCOPY(${DKPLUGINS}/DKRestart/${OS}/${RELEASE_DIR}/DKRestart ${DKPROJECT}/assets/${OS}Release/DKRestart TRUE)
	endif()
endif()



## DKRestart win
if(WIN)
#	DKAPPEND_CMAKE("INCLUDE_DIRECTORIES(${DKPLUGINS}) \n")
#	DKAPPEND_CMAKE("FIND_LIBRARY(DKd DK.lib ${DK}/${OS}/${DEBUG_DIR}) \n")
#	DKAPPEND_CMAKE("LIST(APPEND DEBUG_LIBS debug \${DKd}) \n")
#	DKAPPEND_CMAKE("FIND_LIBRARY(DK DK.lib ${DK}/${OS}/${RELEASE_DIR}) \n")
#	DKAPPEND_CMAKE("LIST(APPEND RELEASE_LIBS optimized \${DK}) \n")	
	DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp ${DKPLUGINS}/DKRestart/*.manifest) \n")	
	if(WIN_32)
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart WIN32 \${DKRestart_SRC}) \n")
	endif()
	if(WIN_64)
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart WIN64 \${DKRestart_SRC}) \n")
	endif()
#	DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart \${DEBUG_LIBS} \${RELEASE_LIBS}) \n")
	DKAPPEND_CMAKE("SET_TARGET_PROPERTIES(DKRestart PROPERTIES LINK_FLAGS_DEBUG \"/MANIFESTUAC:NO /SUBSYSTEM:CONSOLE /SAFESEH:NO\" LINK_FLAGS_RELEASE \"/INCREMENTAL:NO /OPT:NOREF /MANIFESTUAC:NO /SUBSYSTEM:CONSOLE /FORCE /SAFESEH:NO\") \n")
endif()


## DKRestart mac
if(MAC)
#	DKAPPEND_CMAKE("INCLUDE_DIRECTORIES(${DKPLUGINS}) \n")
#	DKAPPEND_CMAKE("FIND_LIBRARY(DKd libDK.a ${DK}/${OS}/${DEBUG_DIR}) \n")
#	DKAPPEND_CMAKE("LIST(APPEND DEBUG_LIBS debug \${DKd}) \n")
#	DKAPPEND_CMAKE("FIND_LIBRARY(DK libDK.a ${DK}/${OS}/${RELEASE_DIR}) \n")
#	DKAPPEND_CMAKE("LIST(APPEND RELEASE_LIBS optimized \${DK}) \n")
	DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp) \n")
	if(MAC_32)
		DKAPPEND_CMAKE("SET(CMAKE_OSX_ARCHITECTURES \"i386\") \n")
	endif()
	if(MAC_64)
		DKAPPEND_CMAKE("SET(CMAKE_OSX_ARCHITECTURES \"x86_64\") \n")
	endif()
	DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart MACOSX_BUNDLE \${DKRestart_SRC}) \n")
#	DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart \${DEBUG_LIBS} \${RELEASE_LIBS}) \n")
endif()


## DKRestart linux
if(LINUX)
	#DKAPPEND_CMAKE("INCLUDE_DIRECTORIES(${DKPLUGINS}) \n")
	if(DEBUG)
		#DKAPPEND_CMAKE("FIND_LIBRARY(DKd libDK.a ${DK}/${OS}/${DEBUG_DIR}) \n")
		#DKAPPEND_CMAKE("LIST(APPEND DEBUG_LIBS debug \${DKd}) \n")
		DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp) \n")
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart \${DKRestart_SRC}) \n")
		#DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart  \${DEBUG_LIBS}) \n")
	endif()
	if(RELEASE)
		#DKAPPEND_CMAKE("FIND_LIBRARY(DK libDK.a ${DK}/${OS}/${RELEASE_DIR}) \n")
		#DKAPPEND_CMAKE("LIST(APPEND RELEASE_LIBS optimized \${DK}) \n")
		DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp) \n")
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart \${DKRestart_SRC}) \n")
		#DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart  \${RELEASE_LIBS}) \n")
	endif()
endif()


## DKRestart raspberry
if(RASPBERRY)
	#DKAPPEND_CMAKE("INCLUDE_DIRECTORIES(${DKPLUGINS}) \n")
	if(DEBUG)
		#DKAPPEND_CMAKE("FIND_LIBRARY(DKd libDK.a ${DK}/${OS}/${DEBUG_DIR}) \n")
		#DKAPPEND_CMAKE("LIST(APPEND DEBUG_LIBS debug \${DKd}) \n")
		DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp) \n")
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart \${DKRestart_SRC}) \n")
		#DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart  \${DEBUG_LIBS}) \n")
	endif()
	if(RELEASE)
		#DKAPPEND_CMAKE("FIND_LIBRARY(DK libDK.a ${DK}/${OS}/${RELEASE_DIR}) \n")
		#DKAPPEND_CMAKE("LIST(APPEND RELEASE_LIBS optimized \${DK}) \n")
		DKAPPEND_CMAKE("FILE(GLOB DKRestart_SRC ${DKPLUGINS}/DKRestart/*.cpp) \n")
		DKAPPEND_CMAKE("ADD_EXECUTABLE(DKRestart \${DKRestart_SRC}) \n")
		#DKAPPEND_CMAKE("TARGET_LINK_LIBRARIES(DKRestart  \${RELEASE_LIBS}) \n")
	endif()
endif()
