-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
executable file
·56 lines (51 loc) · 2.05 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
cmake_minimum_required(VERSION 3.5)
include_directories(include)
include_directories(include/Rosalila)
set (CMAKE_CXX_STANDARD 11)
link_directories(./)
# SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
set(CompilerFlags
LLVM_CFLAGS
LLVM_CXXFLAGS
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MDd" "/MD" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
IF (UNIX AND NOT APPLE)
link_directories(./lib)
file(GLOB_RECURSE SOURCES "src/*.cpp" main.cpp)
add_executable(BulletHellGame ${SOURCES})
add_definitions(-DGLEW_STATIC)
target_link_libraries (BulletHellGame GL SDL2 SDL2_image SDL2_ttf SDL2_mixer rosalila libsteam_api.so)
ENDIF ()
IF (APPLE)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(OpenGL REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})
include_directories(${SDL2_IMAGE_INCLUDE_DIR})
include_directories(${SDL2_TTF_INCLUDE_DIR})
include_directories(${SDL2_MIXER_INCLUDE_DIR})
include_directories(${OPENGL_INCLUDE_DIR})
file(GLOB_RECURSE SOURCES "src/*.cpp" main.cpp)
add_executable(BulletHellGame ${SOURCES})
target_link_libraries (BulletHellGame ${OPENGL_LIBRARIES} SDL2 SDL2_ttf SDL2_image SDL2_mixer libsteam_api.dylib librosalila.dylib)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_SOURCE_DIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ENDIF ()
IF (MSVC)
include_directories(windows_dependencies/include)
link_directories(${CMAKE_SOURCE_DIR}/windows_dependencies/lib)
add_definitions(-DROSALILA_STATICLIB)
file(GLOB_RECURSE SOURCES "src/*.cpp" main.cpp)
add_executable(BulletHellGame ${SOURCES})
target_link_libraries (BulletHellGame rosalila.lib SDL2.lib SDL2main.lib SDL2_image.lib SDL2_mixer.lib SDL2_ttf.lib SDL2test.lib steam_api.lib glew32.lib opengl32.lib)
ENDIF ()