cmake_minimum_required(VERSION 2.8)

PROJECT(Gorgon)

ADD_DEFINITIONS(-DLINUX -fPIC -O3)
SET(StandardFlags "-std=c++0x -Wall -I../GGE/ -Wno-reorder -Wno-unknown-pragmas -Wno-switch -Wno-unused-function")

SET(Base 
	Base.cpp
	File.cpp
	Folder.cpp
)

SET(Generic
	Generic/GenericLoaders.cpp
)

SET(Extended
	Extended/ExtendedLoaders.cpp
)

SET(Game
	Game/GameLoaders.cpp
	Game/BitmapFont.cpp
)

SET(Widgets
	Widgets/WidgetLoaders.cpp
	Widgets/Checkbox.cpp
	Widgets/Panel.cpp
	Widgets/Textbox.cpp
	Widgets/Slider.cpp
	Widgets/WidgetRegistry.cpp
)

FOREACH(_file ${Base} ${Generic} ${Extended} ${Game} ${Widgets})
	SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS ${StandardFlags})
ENDFOREACH()


SET(sources
	${Base} 
	${Generic} 
	${Extended} 
	${Game}
	${Widgets}
)

SET(libraries
	rt
)
ADD_LIBRARY(Gorgon STATIC ${sources})

FOREACH(_lib ${libraries})
	FIND_LIBRARY(_libn ${_lib})
	ADD_LIBRARY(${_lib} UNKNOWN IMPORTED)
	SET_TARGET_PROPERTIES(${_lib} PROPERTIES IMPORTED_LOCATION ${_libn})
	TARGET_LINK_LIBRARIES(Gorgon ${_lib})
	UNSET(_libn CACHE)
ENDFOREACH()
