cmake_minimum_required(VERSION 2.8)

PROJECT(ObstacleEditor)

function    (cm_export_file FILE DEST)
  if    (NOT TARGET export-files)
    add_custom_target(export-files ALL COMMENT "Exporting files into build tree")
  endif (NOT TARGET export-files)
  get_filename_component(FILENAME "${FILE}" NAME)
  add_custom_command(TARGET export-files COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}" "${CMAKE_CURRENT_BINARY_DIR}/${DEST}/${FILENAME}")
  install(FILES "${FILE}" DESTINATION "${DEST}")
endfunction (cm_export_file)

ADD_SUBDIRECTORY(../../../GGE "../../../GGE")
ADD_SUBDIRECTORY(../../../Gorgon "../../../Gorgon")

SET_SOURCE_FILES_PROPERTIES(Main.cpp PROPERTIES COMPILE_FLAGS "-std=c++0x -I../../../ -I../../../GGE/ -DLINUX -O3")


ADD_EXECUTABLE(ObstacleEditor Main.cpp)
SET_TARGET_PROPERTIES(ObstacleEditor PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../)
cm_export_file(cup.png ../)
TARGET_LINK_LIBRARIES(ObstacleEditor GGE)
TARGET_LINK_LIBRARIES(ObstacleEditor Gorgon)

