Switched to C++

This commit is contained in:
Ben
2020-01-11 15:07:22 +00:00
parent c6256c4118
commit fc4e596a95
6 changed files with 84 additions and 0 deletions

78
CMakeLists.txt Normal file
View File

@@ -0,0 +1,78 @@
# Cmake OwO
cmake_minimum_required(VERSION 3.7)
project(2D_GLOBAL_ILLUMINATION)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CMakeModules/)
cmake_policy(SET CMP0037 OLD) # alow for spaces in file names
set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_CXX_FLAGS "-Ofast")
set(exe output)
set(src ./src)
set(include ./include)
# Adds RESOURCES constant in C++
add_definitions(-DRESOURCES="${CMAKE_SOURCE_DIR}/resources/")
message(${CMAKE_SOURCE_DIR}/resources)
if (UNIX)
find_package(SDL2 REQUIRED)
endif(UNIX)
if (WIN32)
include_directories(${executable}
"C:/dev/glm"
"C:/dev/SDL2/include/"
"C:/dev/SDL2_image/include/"
)
endif (WIN32)
set(THREADS_PREFER_PTHREAD_FLAD ON)
find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
if (UNIX)
include_directories(${executable}
${SDL2_INCLUDE_DIR}
)
endif (UNIX)
include_directories(${executable}
${IncludeDIR}
)
file(GLOB SourceFiles
${SrcDIR}/*
)
add_executable(${executable} ${SourceFiles})
set_target_properties(${executable} PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
if (UNIX)
target_link_libraries(${executable}
SDL2
OpenGL::OpenGL
OpenGL::GL
Threads::Threads
)
endif (UNIX)
if (WIN32)
target_link_libraries(${executable}
"C:/dev/SDL2/lib/x64/SDL2.lib"
"C:/dev/SDL2/lib/x64/SDL2main.lib"
"C:/dev/SDL2/lib/x64/SDL2test.lib"
${WinSDK}
)
endif (WIN32)
target_link_libraries(${executable}
${CMAKE_DL_LIBS}
)

View File

View File

6
src/main.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "dani has a small pp" << std::endl;
}