-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
55 lines (47 loc) · 1.95 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
cmake_minimum_required(VERSION 2.8)
project(glitch-life)
set(SOURCE_FILES
src/bsp_util.cpp src/Entity.cpp
src/ent_util.cpp src/gsrand.cpp
src/Keyvalue.cpp src/model_util.cpp
src/tex_util.cpp src/sound_util.cpp
src/Util.cpp src/Wad.cpp
src/bsp_util.h src/ent_data.h
src/ent_util.h src/Entity.h
src/Globals.h src/gsrand.h
src/Keyvalue.h src/masterList.h
src/model_util.h src/modelList.h
src/sentences.h src/sound_util.h
src/soundlists.h src/spriteList.h
src/studio.h src/tex_util.h
src/Util.h src/Wad.h
src/default_model_list.h
)
if(MSVC)
if(NOT MSVC_VERSION GREATER 1600) #MSVC 10
message(FATAL_ERROR "Visual Studio 10 or greater is required")
endif()
# Create virtual folders for VS
source_group("Header Files\\Content Lists" FILES
src/masterList.h src/modelList.h src/sentences.h
src/soundlists.h src/spriteList.h )
source_group("Header Files\\Utils" FILES
src/bsp_util.h src/ent_util.h src/model_util.h
src/sound_util.h src/tex_util.h src/Util.h)
source_group("Source Files\\Utils" FILES
src/bsp_util.cpp src/ent_util.cpp src/model_util.cpp
src/sound_util.cpp src/tex_util.cpp src/Util.cpp)
# compile using the static runtime
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /wd4244 /wd4018")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /wd4244 /wd4018")
# Disable C++ exceptions
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror -Wno-unused -Wno-sign-compare")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
else()
message(WARNING "Unknown compiler, no flags set")
endif()
include_directories(src)
add_executable(gsrand ${SOURCE_FILES})