-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (38 loc) · 1.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required (VERSION 2.6)
project (FreeSynd)
set (FREESYND_VERSION "0.9")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Use -DDATA_DIR to override data location
if(NOT DATA_DIR)
if(UNIX)
SET(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/freesynd/")
endif(UNIX)
endif(NOT DATA_DIR)
# Set standard definitions for all platforms.
add_definitions (-DSYSTEM_SDL)
add_definitions (-DPREFIX=\"${DATA_DIR}\")
# Locate libs we depend on directly.
find_package (SDL2 REQUIRED)
find_package (SDL2_image REQUIRED)
find_package (SDL2_mixer REQUIRED)
find_package (PNG)
if (NOT PNG_FOUND)
message (FATAL_ERROR "Unable to locate PNG")
endif ()
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "debug")
endif ()
if (CMAKE_BUILD_TYPE STREQUAL "debug" OR CMAKE_BUILD_TYPE STREQUAL "Debug")
set (BUILD_DEV_TOOLS TRUE)
else ()
set (BUILD_DEV_TOOLS FALSE)
# We only define an install target if we're doing a release build.
# Furthermore, on Mac, the data folder is a part of the app bundle.
if (UNIX)
install (DIRECTORY data DESTINATION ${DATA_DIR} PATTERN .svn EXCLUDE)
endif ()
endif ()
# Make sure we can include from the libs we found.
include_directories (${PNG_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${SDL2_MIXER_INCLUDE_DIRS})
# Build the sources in this subdirectory.
subdirs (src)