-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
123 lines (112 loc) · 3.17 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.3" CACHE STRING "Minimum macOS deployment target" FORCE)
project (psicore)
set(CMAKE_BUILD_TYPE Release)
#set(CMAKE_BUILD_TYPE Debug)
cmake_minimum_required (VERSION 3.2)
set(PSI_ARCH "macos_arm64")
# Add module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_compile_options(-Wall -std=c++14 -Wno-deprecated)
set(CMAKE_CXX_FLAGS_RELEASE "-Os -ffast-math -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-Og")
message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
message("CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}")
message("CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}")
# Yeah setting this to anything will not affect actually the output directory.
# At least on macOS.
set(PSI_CORE_OUTPUT_DIR lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PSI_CORE_OUTPUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PSI_CORE_OUTPUT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PSI_CORE_OUTPUT_DIR})
message("CMAKE_LIBRARY_OUTPUT_DIRECTORY is ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
message("CMAKE_ARCHIVE_OUTPUT_DIRECTORY is ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
set(SOURCES
src/ext/stb_image_impl.cpp
src/ext/qoi_impl.cpp
src/ext/miniaudio_impl.cpp
src/ext/tiny_gltf_loader.cpp
src/ext/fpng.cpp
src/PSIAudio.cpp
src/PSIGlobals.cpp
src/PSILog.cpp
src/PSIFileUtils.cpp
src/PSIMath.cpp
src/PSIVideo.cpp
src/PSIGeometry.cpp
src/PSIResourceManager.cpp
src/PSIGLUtils.cpp
src/PSIGLShader.cpp
src/PSIGLTransform.cpp
src/PSIGLTexture.cpp
src/PSIAABB.cpp
src/PSIRenderObj.cpp
src/PSIRenderMesh.cpp
src/PSIFrameTimer.cpp
src/PSICycler.cpp
src/PSIScaler.cpp
src/PSIColor.cpp
src/PSIString.cpp
src/PSICamera.cpp
src/PSIGLMesh.cpp
src/PSIGLRenderer.cpp
src/PSIQuadGeometry.cpp
src/PSIIcosahedronGeometry.cpp
src/PSIGeometryData.cpp
src/PSIRenderScene.cpp
src/PSICubeGeometry.cpp
src/PSITetrahedronGeometry.cpp
src/PSICuboidGeometry.cpp
src/PSIPlaneGeometry.cpp
src/PSITextRenderer.cpp
src/PSITimeDisplay.cpp
src/PSIGLTFLoader.cpp
src/PSIPrismGeometry.cpp
)
set(HEADER_FILES,
src/PSIAudio.h
src/PSIGlobals.h
src/PSILog.h
src/PSIFileUtils.h
src/PSIMath.h
src/PSIVideo.h
src/PSIGeometry.h
src/PSIResourceManager.h
src/PSIGLUtils.h
src/PSIGLShader.h
src/PSIGLTransform.h
src/PSIGLMaterial.h
src/PSIGLTexture.h
src/PSIAudio.h
src/PSIAABB.h
src/PSIRenderObj.h
src/PSIRenderMesh.h
src/PSIRenderContext.h
src/PSITimer.h
src/PSIFrameTimer.h
src/PSICycler.h
src/PSIScaler.h
src/PSIColor.h
src/PSIString.h
src/PSICamera.h
src/PSIGLMesh.h
src/PSIGLRenderer.h
src/PSIQuadGeometry.h
src/PSIIcosahedronGeometry.h
src/PSIGeometryData.h
src/PSIRenderScene.h
src/PSICubeGeometry.h
src/PSICuboidGeometry.h
src/PSIPlaneGeometry.h
src/PSILight.h
src/PSITextRenderer.h
src/PSITimeDisplay.h
src/PSIGLTFLoader.h
src/PSIPrismGeometry.h
)
add_library(${PROJECT_NAME} STATIC ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
install (TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${PSI_CORE_OUTPUT_DIR}
LIBRARY DESTINATION ${PSI_CORE_OUTPUT_DIR})