-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
62 lines (47 loc) · 1.93 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
cmake_minimum_required(VERSION 3.15.0)
project(small3d)
file(COPY "deps/include" DESTINATION ".")
file(COPY "deps/lib" DESTINATION ".")
if(MSVC)
file(COPY "deps/bin" DESTINATION ".")
endif()
file(COPY "include" DESTINATION ".")
file(COPY "resources" DESTINATION "./bin")
file(COPY "resources/shaders" DESTINATION ".")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
if(MSVC)
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/lib")
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(DEPS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps")
set(CMAKE_PREFIX_PATH ${DEPS_PATH})
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLFW REQUIRED)
find_package(PORTAUDIO REQUIRED)
find_package(PNG REQUIRED)
find_package(OGG REQUIRED)
find_package(VORBIS REQUIRED)
find_package(Freetype REQUIRED)
if(UNIX)
find_package(BZip2 REQUIRED)
endif()
# On windows bzip2 is required for gcc version >= 10, otherwise a freetype associated
# link error is produced. Not using REQUIRED in find_package though, because sometimes
# the compilation works without BZip2 while it can be blocked if cmake cannot find it.
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
find_package(BZip2)
endif()
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -stdlib=libc++")
endif()
subdirs(src unit-tests format-converter)