-
Notifications
You must be signed in to change notification settings - Fork 42
/
CMakeLists.txt
78 lines (64 loc) · 2.77 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 2.8.12.2)
project(ivan CXX C)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 59)
set(PROJECT_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
#set(VERSION_PATCH 0)
#set(PROJECT_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
add_definitions(-DIVAN_VERSION="${PROJECT_VERSION}" -DUSE_SDL)
option(BUILD_MAC_APP "Build standalone application for MacOS" OFF)
option(USE_HOME_FOR_STATE_DIR "Statedir will be /.ivan/ in current user's homedir" OFF)
option(WIZARD "Enable Wizard Mode" OFF)
if(UNIX)
add_definitions(-DUNIX)
include(GNUInstallDirs)
if(BUILD_MAC_APP)
install(DIRECTORY Graphics Script Music Sound DESTINATION "ivan")
install(FILES COPYING INSTALL LICENSING NEWS MANUAL README.md DESTINATION "docs")
add_definitions(-DMAC_APP)
else()
install(DIRECTORY Graphics Script Music Sound DESTINATION "${CMAKE_INSTALL_DATADIR}/ivan")
add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
message("\n*NOTICE*\n"
" Highscore files and Bone files are now stored at \"\$HOME/.ivan\".\n"
" Your HOME directory is \"$ENV{HOME}\".\n")
if(IS_DIRECTORY "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/ivan")
message(WARNING
"If you have game data in \"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/ivan\","
" please move them to \"$ENV{HOME}/.ivan\".")
endif()
endif()
elseif(WIN32)
install(DIRECTORY Graphics Script Music Sound DESTINATION "ivan")
install(FILES COPYING INSTALL LICENSING NEWS MANUAL README.md DESTINATION "ivan")
add_definitions(-DWIN32)
if(MINGW)
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif(MINGW)
# This is bad. To remove below defines, FeLib should switch to std::chrono and serialize time since common epoch.
# 32 bit TIME_T has year 2038 problem. Moreover, serialized value is not portable for time_t in general.
# Switching to std::chrono should not be hard, but it's not a topic for this pull request.
add_definitions(-D_USE_32BIT_TIME_T)
endif(UNIX)
# In visual studio 2017, add an option to hide the console window (useful where debugging is not intended - i.e. releases)
if(MSVC AND MSVC_HIDE_CONSOLE_WINDOW)
# Hide the console window in visual studio projects
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
if(WIZARD)
add_definitions(-DWIZARD)
endif()
find_path(EXECINFO_INCLUDE_DIR NAMES execinfo.h)
if(NOT EXECINFO_INCLUDE_DIR MATCHES "-NOTFOUND$")
add_definitions(-DBACKTRACE)
endif()
add_subdirectory(FeLib)
add_subdirectory(audio)
add_subdirectory(Main)
add_subdirectory(igor)
add_subdirectory(mihail)
add_subdirectory(xbrzscale)
add_subdirectory(fantasyname)
add_subdirectory(FastNoise)