-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
38 lines (27 loc) · 1.2 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
cmake_minimum_required(VERSION 3.12)
project(INF443Project)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories("external" "src")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(glfw3 3.3 REQUIRED)
find_package(assimp REQUIRED)
file(GLOB_RECURSE SRCS "src/*" "external/*" "resources/*")
# taken from https://stackoverflow.com/a/31987079
foreach(FILE ${SRCS})
# Get the directory of the source file
get_filename_component(PARENT_DIR "${FILE}" DIRECTORY)
# Remove common directory prefix to make the group
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" GROUP "${PARENT_DIR}")
# Make sure we are using windows slashes
string(REPLACE "/" "\\" GROUP "${GROUP}")
source_group("${GROUP}" FILES "${FILE}")
endforeach()
# disable iterator debugging because it slows down a lot our app
if(CMAKE_GENERATOR MATCHES "Visual Studio")
add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
add_executable(INF443Project ${SRCS})
target_link_libraries(INF443Project Threads::Threads glfw assimp::assimp ${CMAKE_DL_LIBS})