Fixed normal calculation at edges, more UI changes
[ted.git] / CMakeLists.txt
blob38d6c7c425c873ffb1d6f705f5f0218f0c185c23
1 project(TED)
3 cmake_minimum_required(VERSION 2.6)
4 if(COMMAND cmake_policy)
5         cmake_policy(SET CMP0003 NEW)
6 endif(COMMAND cmake_policy)
7 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
9 set(EXECUTABLE main)
10 set(TED_SRC src)
11 file(GLOB_RECURSE TED_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${TED_SRC}/*.c*")
13 find_package(SDL REQUIRED)
14 find_package(SDL_image REQUIRED)
15 find_package(OpenGL REQUIRED)
16 #find_package(FTGL REQUIRED)
18 if(CMAKE_SYSTEM_NAME MATCHES Windows)
19         #this is to fix some cross compiling issues I'm having
20         #set(SDL_INCLUDE_DIR FTGL_INCLUDE_DIR)
21         #set(SDLIMAGE_INCLUDE_DIR FTGL_INCLUDE_DIR)
22 endif(CMAKE_SYSTEM_NAME MATCHES Windows)
24 include_directories(
25     ${CMAKE_SOURCE_DIR}/${TED_SRC}
26     ${SDL_INCLUDE_DIR}
27     ${SDLIMAGE_INCLUDE_DIR}  
28     ${OPENGL_INCLUDE_DIR}
29     #${FREETYPE_INCLUDE_DIRS}
30     #${FTGL_INCLUDE_DIR}
33 link_libraries(
34     #${FTGL_LIBRARY}
35     ${FREETYPE_LIBRARIES}
36     ${OPENGL_LIBRARIES}
37     ${SDL_LIBRARY}
38     ${SDLIMAGE_LIBRARY}
41 add_definitions(
42     -pipe -Wall -D_REENTRANT -D_GNU_SOURCE=1
45 if(BUILD MATCHES "Debug")
46         add_definitions(-DDEBUG -g)
47         message(STATUS "DEBUGGING ON!")
48         if(PROFILE)
49                 add_definitions(-pg)
50                 link_libraries(-pg)
51                 message(STATUS "PROFILING ON!")
52         endif(PROFILE)
53 endif(BUILD MATCHES "Debug")
55 if(BUILD MATCHES "Debug")
56         add_definitions(-03)
57 endif(BUILD MATCHES "Debug")
59 add_executable(${EXECUTABLE} ${TED_FILES})