-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
79 lines (63 loc) · 2.71 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
cmake_minimum_required (VERSION 3.14)
project (Vioarr C CXX)
if (MOLLENOS)
enable_language (ASM_NASM)
endif ()
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
include (CheckIncludeFiles)
check_include_files (threads.h HAVE_C11_THREADS)
check_include_files (pthread.h HAVE_PTHREAD)
find_package (Gracht REQUIRED)
find_package (Freetype REQUIRED)
find_package (ZIP REQUIRED)
find_package (Python3 REQUIRED)
find_package (GLM REQUIRED)
message (STATUS "Found GRLM in ${GLM_INCLUDE_DIR}")
if (NOT MOLLENOS)
find_package (GLFW3 REQUIRED)
message (STATUS "Found GLFW3 in ${GLFW3_INCLUDE_DIR}")
endif ()
if (WIN32)
set (LIBS glfw3 opengl32 freetype)
elseif (UNIX AND NOT APPLE)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
find_package (OpenGL REQUIRED)
add_definitions (${OPENGL_DEFINITIONS})
find_package (X11 REQUIRED)
# the order of link libraries here is important
set (LIBS ${GLFW3_LIBRARY} X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL m pthread freetype ${CMAKE_DL_LIBS})
set (CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -l${CMAKE_DL_LIBS}")
elseif (APPLE)
include_directories (/System/Library/Frameworks)
find_library (COCOA_LIBRARY Cocoa)
find_library (OpenGL_LIBRARY OpenGL)
find_library (IOKit_LIBRARY IOKit)
find_library (CoreVideo_LIBRARY CoreVideo)
mark_as_advanced (COCOA_LIBRARY OpenGL_LIBRARY)
set (APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY} ${CoreVideo_LIBRARY})
set (APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY})
set (LIBS ${LIBS} ${APPLE_LIBS})
elseif (MOLLENOS)
include($ENV{VALI_SDK_PATH}/lib/cmake/ValiDDKTargets.cmake)
set (LIBS freetype gallium-osmesa ValiDDK::libddk)
endif ()
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# this will be the directory the protocols are generated to
set (VIOARR_ROOT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set (VIOARR_PROTOCOL_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protocols)
add_subdirectory (protocols)
add_subdirectory (libs/common)
add_subdirectory (libs/asgaard)
add_subdirectory (libs/glad)
# include subdirectories required for building apps
include_directories(libs/common/include/vioarr)
include_directories(libs/freetype/include)
include_directories(libs/asgaard/include)
add_subdirectory (apps/alumni)
add_subdirectory (apps/heimdall)
add_subdirectory (core)
# configure global install targets
install (EXPORT AsgaardExport DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/asgaard)
install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/protocols DESTINATION ${CMAKE_INSTALL_PREFIX}/share/vioarr/protocols)