-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
91 lines (68 loc) · 2.61 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
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.14)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/mk")
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
message(STATUS "Source dir: ${CMAKE_SOURCE_DIR}")
project(flixel++, VERSION 0.1.0)
include_directories("include/")
include_directories("bundles/tinyxml2/")
file (GLOB_RECURSE FLIXEL_FILES CONFIGURE_DEPENDS "source/*.cpp" "bundles/tinyxml2/tinyxml2.cpp")
if(DEFINED SDL_LEGACY)
add_definitions(-DSDL_LEGACY)
find_package(SDL_image REQUIRED)
include_directories(${SDLIMAGE_INCLUDE_DIRS})
find_package(SDL_ttf REQUIRED)
include_directories(${SDLTTF_INCLUDE_DIRS})
find_package(SDL REQUIRED)
include_directories(${SDL_INCLUDE_DIRS})
endif()
if(DEFINED SDL)
find_package(SDL2_image REQUIRED)
include_directories(${SDL2IMAGE_INCLUDE_DIRS})
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2TTF_INCLUDE_DIRS})
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
endif()
if(DEFINED OPENGL)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
find_package(OpenGL REQUIRED)
find_package(glfw3 3.3 REQUIRED)
include_directories(${GLFW_INCLUDE_DIRS})
find_package(SOIL REQUIRED)
include_directories(${SOIL_INCLUDE_DIRS})
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
endif()
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
find_package(OpenAL REQUIRED)
include_directories(${OPENAL_INCLUDE_DIR})
find_package(LibVorbisfile REQUIRED)
include_directories(${VORBIS_INCLUDE_DIR})
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})
add_library(flixel++ SHARED ${FLIXEL_FILES})
if(DEFINED SDL_LEGACY)
target_link_libraries(flixel++ ${SDL_LIBRARIES})
target_link_libraries(flixel++ ${SDL_IMAGE_LIBRARIES})
target_link_libraries(flixel++ ${SDL_TTF_LIBRARIES})
endif()
if(DEFINED SDL)
target_link_libraries(flixel++ ${SDL2_LIBRARIES})
target_link_libraries(flixel++ ${SDL2_IMAGE_LIBRARIES})
target_link_libraries(flixel++ ${SDL2_TTF_LIBRARIES})
endif()
if(DEFINED OPENGL)
target_link_libraries(flixel++ ${SDL2_LIBRARIES})
target_link_libraries(flixel++ ${GLEW_LIBRARIES})
target_link_libraries(flixel++ ${OPENGL_LIBRARY})
target_link_libraries(flixel++ ${GLFW_LIBRARY})
target_link_libraries(flixel++ ${SOIL_LIBRARY})
endif()
target_link_libraries(flixel++ ${CURL_LIBRARIES})
target_link_libraries(flixel++ ${OPENAL_LIBRARY})
target_link_libraries(flixel++ ${VORBISFILE_LIBRARY})
target_link_libraries(flixel++ ${CURL_LIBRARY})
install(TARGETS flixel++ DESTINATION lib)