-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (25 loc) · 1.03 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
cmake_minimum_required(VERSION 3.7)
set(NAME Software-Ray-Tracer)
set(DCMAKE_EXPORT_COMPILE_COMMANDS ON)
project(${NAME} VERSION 0.10.0)
# Find all .cpp files in source directory (including those inside subdirectories).
file(GLOB_RECURSE SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build")
if (WIN32)
message(STATUS "CREATING BUILD FOR WINDOWS")
# Include all external dependencies' header files and tell cmake where their link libraries are located.
if (USE_MINGW)
target_include_directories(${PROJECT_NAME} PUBLIC
${MINGW_PATH}/include
)
target_link_directories(${PROJECT_NAME} PUBLIC
${MINGW_PATH}/lib
)
endif()
# Include target source as a include directory because that is where all our header files are located.
target_include_directories(${PROJECT_NAME} PUBLIC
${PROJECT_SOURCE_DIR}/src
)
endif()