-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (36 loc) · 1.46 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
cmake_minimum_required(VERSION 3.13.0)
project(DX12Lib-main VERSION 0.1.0)
if(WIN32)
ADD_DEFINITIONS(-D_AFXDLL)
ADD_DEFINITIONS(-DWIN32)
ADD_DEFINITIONS(-D_UNICODE)
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_DEBUG)
ADD_DEFINITIONS(-D_WINDOWS)
set(CMAKE_MFC_FLAG 2)
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
set(CMAKE_BUILD_PARALLEL_LEVEL 16)
set(CMAKE_CXX_STANDARD 17) # no need to manually adjust the CXXFLAGS
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(ROOT_FOLDER ${PROJECT_SOURCE_DIR})
set(THIRD_PARTY_DIR ${ROOT_FOLDER}/thirdParty)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
set(ASSIMP_INSTALL OFF CACHE BOOL "Build as submodule" FORCE)
add_subdirectory(${THIRD_PARTY_DIR}/assimp)
if (WIN32)
add_subdirectory(${THIRD_PARTY_DIR}/DirectX-Headers)
set(BUILD_TOOLS OFF CACHE BOOL "Build tex command-line tools" FORCE)
set(BUILD_SAMPLE OFF CACHE BOOL "Build DDSView sample" FORCE)
set(BUILD_DX11 OFF CACHE BOOL "Build with DirectX11 Runtime support" FORCE)
add_subdirectory(${THIRD_PARTY_DIR}/DirectXTex)
else()
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs" FORCE)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "Generate installation target" FORCE)
add_subdirectory(${THIRD_PARTY_DIR}/glfw)
endif()
add_subdirectory(src)