summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..c71cf448
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,66 @@
+# Project definition.
+PROJECT (tome2)
+CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
+
+# Default flags.
+IF(CMAKE_COMPILER_IS_GNUCC)
+ # Let's set sensible options.
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wno-unused-value")
+ SET(CMAKE_C_FLAGS_RELEASE "-O2")
+ SET(CMAKE_C_FLAGS_DEBUG "-O1 -g")
+ENDIF()
+
+# Add definitions.
+ADD_DEFINITIONS(-DUSE_EGO_GRAPHICS)
+ADD_DEFINITIONS(-DUSE_TRANSPARENCY)
+ADD_DEFINITIONS(-DSUPPORT_GAMMA)
+ADD_DEFINITIONS(-DUSE_PRECISE_CMOVIE)
+ADD_DEFINITIONS(-DUSE_UNIXSOCK)
+
+#
+# X11 support (OPTIONAL)
+#
+FIND_PACKAGE(X11)
+IF(X11_FOUND)
+ # Add X11 flags/options
+ ADD_DEFINITIONS(-DUSE_X11)
+ INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
+ SET(LIBS ${LIBS} ${X11_LIBRARIES})
+ENDIF()
+
+#
+# SDL support (OPTIONAL)
+#
+FIND_PACKAGE(SDL)
+IF(SDL_FOUND)
+ # Add SDL flags/options
+ ADD_DEFINITIONS(-DUSE_SDL)
+ INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
+ SET(LIBS ${LIBS} ${SDL_LIBRARY})
+ # SDL_image is also required
+ FIND_PACKAGE(SDL_image REQUIRED)
+ IF(SDLIMAGE_FOUND)
+ INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR})
+ SET(LIBS ${LIBS} ${SDLIMAGE_LIBRARY})
+ ENDIF()
+ # SDL_ttf is also required
+ FIND_PACKAGE(SDL_ttf REQUIRED)
+ IF(SDLTTF_FOUND)
+ INCLUDE_DIRECTORIES(${SDLTTF_INCLUDE_DIR})
+ SET(LIBS ${LIBS} ${SDLTTF_LIBRARY})
+ ENDIF()
+ENDIF()
+
+#
+# Curses support (OPTIONAL)
+#
+FIND_PACKAGE(Curses)
+IF(CURSES_FOUND)
+ # Add Curses flags/options
+ ADD_DEFINITIONS(-DUSE_GCU)
+ INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR})
+ SET(LIBS ${LIBS} ${CURSES_LIBRARIES})
+ENDIF()
+
+# Add the source subdirectory.
+ADD_SUBDIRECTORY (src)