-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (55 loc) · 1.92 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
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
set(golden_sun_cmake_module_dir "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Modules")
list(APPEND CMAKE_MODULE_PATH "${golden_sun_cmake_module_dir}")
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
set(golden_sun_major_version 0)
set(golden_sun_minor_version 1)
set(golden_sun_patch_version 0)
set(golden_sun_version ${golden_sun_major_version}.${golden_sun_minor_version}.${golden_sun_patch_version})
project(GoldenSun VERSION ${golden_sun_version})
if(golden_sun_clang_format)
find_program(clang_format
NAMES
clang-format-9
clang-format
)
if(${clang_format} STREQUAL "CLANG_FORMAT-NOTFOUND")
message(FATAL_ERROR "No clang-format tool found")
endif()
message(STATUS "Generating clang-format target using ${clang_format}")
file(GLOB_RECURSE all_source_files *.cpp *.h *.hpp)
add_custom_target(clang_format
COMMAND ${clang_format} -i ${all_source_files})
return()
endif()
include(${golden_sun_cmake_module_dir}/Common.cmake)
include(${golden_sun_cmake_module_dir}/Platform.cmake)
include(${golden_sun_cmake_module_dir}/Compiler.cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Lib")
set(header_files
Include/GoldenSun/Base.hpp
Include/GoldenSun/Camera.hpp
Include/GoldenSun/Engine.hpp
Include/GoldenSun/GoldenSun.hpp
Include/GoldenSun/Light.hpp
Include/GoldenSun/Material.hpp
Include/GoldenSun/Mesh.hpp
)
add_library(GoldenSun INTERFACE
${header_files}
)
target_include_directories(GoldenSun
INTERFACE
Include
)
target_link_libraries(GoldenSun
INTERFACE
GoldenSunEngine
)
set_target_properties(GoldenSun PROPERTIES FOLDER "Interface")
add_subdirectory(Source)