Commit 53ba3c7b authored by Johannes Braun's avatar Johannes Braun
Browse files

Made Project fully self-contained even after build and fixed game executable

parent f79061d1
build_VS
.vs
.idea
.vscode
build
assets/screenshots/*
assets/meshes/*
assets/textures/*
......@@ -8,4 +10,7 @@ assets/textures/*
!assets/textures/ryfjallet
!assets/textures/splash.png
!assets/textures/bricky.png
*.hdr
\ No newline at end of file
*.hdr
bin/*.exe
bin/*.ilk
bin/*.pdb
\ No newline at end of file
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
message(${CMAKE_CXX_COMPILER})
set(BINARY_DIR_REL "${PROJECT_SOURCE_DIR}/bin/")
set(BINARY_DIR_DBG "${BINARY_DIR_REL}")
#set(CMAKE_C_COMPILER_DEBUG "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe")
#set(CMAKE_CXX_COMPILER_DEBUG "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${BINARY_DIR_DBG}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${BINARY_DIR_DBG}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${BINARY_DIR_DBG}")
include(config.cmake)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BINARY_DIR_REL}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${BINARY_DIR_REL}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${BINARY_DIR_REL}")
include(${CMAKE_MODULE_PATH}/setup/system_check.cmake)
include(${CMAKE_MODULE_PATH}/setup/directory_macros.cmake)
include(${CMAKE_MODULE_PATH}/setup/external_libraries.cmake)
include(${CMAKE_MODULE_PATH}/setup/macros.cmake)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${BINARY_DIR_DBG}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${BINARY_DIR_DBG}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${BINARY_DIR_DBG}")
set(CMAKE_CXX_STANDARD 17)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL "${BINARY_DIR_REL}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${BINARY_DIR_REL}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${BINARY_DIR_REL}")
if(MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /MP")
endif()
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MAXSPEEDREL "${BINARY_DIR_REL}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_MAXSPEEDREL "${BINARY_DIR_REL}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_MAXSPEEDREL "${BINARY_DIR_REL}")
set(EXTENSION_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(${EXTENSION_PATH}/setup/config.cmake)
include(${EXTENSION_PATH}/setup/system_check.cmake)
include(${EXTENSION_PATH}/setup/directory_macros.cmake)
include(${EXTENSION_PATH}/setup/external_libraries.cmake)
include(${EXTENSION_PATH}/setup/macros.cmake)
if(SYS_WINDOWS)
add_definitions("-DLOG_PLATFORM_WINDOWS")
endif()
collect_subdirectories(PROJECT_EXECUTABLES ${CMAKE_SOURCE_DIR}/src/executables)
collect_subdirectories(PROJECT_LIBRARIES ${CMAKE_SOURCE_DIR}/src/libraries)
FOREACH(subdir ${PROJECT_LIBRARIES})
make_library(${subdir} ${CMAKE_SOURCE_DIR}/src/libraries/${subdir} LIBRARIES)
file(REMOVE "${BINARY_DIR_REL}/${subdir}.lib")
ENDFOREACH()
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/src/libraries)
include_directories(${CMAKE_SOURCE_DIR}/src/libraries/)
FOREACH(subdir ${PROJECT_EXECUTABLES})
make_executable(${subdir} ${CMAKE_SOURCE_DIR}/src/executables/${subdir})
target_link_libraries(${subdir} ${LIBRARIES})
file(REMOVE "${BINARY_DIR_REL}/${subdir}.exe")
file(REMOVE "${BINARY_DIR_REL}/${subdir}.exe.manifest")
file(REMOVE "${BINARY_DIR_REL}/${subdir}.ilk")
file(REMOVE "${BINARY_DIR_REL}/${subdir}.pdb")
ENDFOREACH()
......@@ -2,40 +2,50 @@
// Informationen zu dieser Datei finden Sie unter https://go.microsoft.com//fwlink//?linkid=834763.
"configurations": [
{
"name": "x86-Debug",
"name": "Debug",
"generator": "Ninja",
"configurationType" : "Debug",
"inheritEnvironments": [ "msvc_x86" ],
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x86-Release",
"name": "Release",
"generator": "Ninja",
"configurationType" : "Release",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "Release with Debug Info",
"generator": "Ninja",
"configurationType" : "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x86" ],
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x64-Debug",
"name": "Min Size Release",
"generator": "Ninja",
"configurationType" : "Debug",
"inheritEnvironments": [ "msvc_x64" ],
"configurationType" : "MinSizeRel",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"name": "Max Speed Release",
"generator": "Ninja",
"configurationType" : "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64" ],
"configurationType" : "MinSizeRel",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
......
{
"configurations": [
{
"inheritEnvironments": [
"msvc_x86"
],
"name": "x86-Debug",
"includePath": [
"${env.INCLUDE}",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\imgui",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data\\collector_units",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\executables\\pathtracing"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x86"
},
{
"inheritEnvironments": [
"msvc_x86"
],
"name": "x86-Release",
"includePath": [
"${env.INCLUDE}",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\imgui",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data\\collector_units",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\executables\\pathtracing"
],
"defines": [
"WIN32",
"NDEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x86"
},
{
"inheritEnvironments": [
"msvc_x64"
],
"name": "x64-Debug",
"includePath": [
"${env.INCLUDE}",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\imgui",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data\\collector_units",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\executables\\pathtracing"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64"
},
{
"inheritEnvironments": [
"msvc_x64"
],
"name": "x64-Release",
"includePath": [
"${env.INCLUDE}",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\imgui",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\libraries\\raytrace\\data\\collector_units",
"c:\\Users\\johannesbraun\\Desktop\\glare\\src\\executables\\pathtracing"
],
"defines": [
"WIN32",
"NDEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64"
}
]
}
\ No newline at end of file
@echo off
setlocal enabledelayedexpansion
set /p path="Enter a path: "
set /p className="Enter a class name: "
set /p subNamespace="What namespace should it be in? "
set fileNameCPP=%className%.cpp
set fileNameH=%className%.h
set fileNameUpperH=%className%.h
for %%b in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
set "fileNameUpperH=!fileNameUpperH:%%b=%%b!"
)
set fileNameUpperH=INCLUDE_%fileNameUpperH:.=_%
if not exist src/%path%/%fileNameH% (
echo #ifndef %fileNameUpperH%>> src/%path%/%fileNameH%
echo #define %fileNameUpperH%>> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo // --------------- STDLIB --------------->> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo // --------------- EXTERN --------------->> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo // --------------- INTERN --------------->> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo namespace glare>> src/%path%/%fileNameH%
echo {>> src/%path%/%fileNameH%
echo namespace %subNamespace%>> src/%path%/%fileNameH%
echo {>> src/%path%/%fileNameH%
echo class %className%>> src/%path%/%fileNameH%
echo {>> src/%path%/%fileNameH%
echo public:>> src/%path%/%fileNameH%
echo %className%^(^)^; >> src/%path%/%fileNameH%
echo %className%^(%className%^& other^) ^= default^; >> src/%path%/%fileNameH%
echo %className%^(%className%^&^& other^) ^= default^; >> src/%path%/%fileNameH%
echo %className%^& operator^=^(%className%^& other^) ^= default^; >> src/%path%/%fileNameH%
echo %className%^& operator^=^(%className%^&^& other^) ^= default^; >> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo };>> src/%path%/%fileNameH%
echo }>> src/%path%/%fileNameH%
echo }>> src/%path%/%fileNameH%
echo.>> src/%path%/%fileNameH%
echo #endif //%fileNameUpperH%>> src/%path%/%fileNameH%
echo #include "%fileNameH%">> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo // --------------- STDLIB --------------->> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo // --------------- EXTERN --------------->> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo // --------------- INTERN --------------->> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo.>> src/%path%/%fileNameCPP%
echo namespace glare>> src/%path%/%fileNameCPP%
echo {>> src/%path%/%fileNameCPP%
echo namespace %subNamespace%>> src/%path%/%fileNameCPP%
echo {>> src/%path%/%fileNameCPP%
echo %className%::%className%^(^) >> src/%path%/%fileNameCPP%
echo { >> src/%path%/%fileNameCPP%
echo } >> src/%path%/%fileNameCPP%
echo }>> src/%path%/%fileNameCPP%
echo }>> src/%path%/%fileNameCPP%
) else (
echo File %path%/%fileNameH% already exists!
)
[Debug]
Pos=-1,0
Size=353,64
Collapsed=0
[Scene]
Pos=0,64
Size=352,837
Collapsed=0
[Settings]
Pos=1130,0
Size=311,899
Collapsed=0
File added
@echo off
mkdir build_VS
cd build_VS
cmake -G "Visual Studio 14 2015 Win64" ..
cd ..
\ No newline at end of file
......@@ -48,5 +48,5 @@ elseif(SYS_APPLE)
elseif(SYS_LINUX)
endif()
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(Freetype)
\ No newline at end of file
......@@ -35,5 +35,5 @@ else()
NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
endif()
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(GLEW)
\ No newline at end of file
......@@ -21,7 +21,7 @@ if(SYS_WINDOWS)
endif()
FIND_LIBRARY(GLFW3_LIBRARY
NAMES glfw3
NAMES glfw3dll
PATHS ${GLFW3_LIB_DIR})
# TODO: Check if even necessary... Well... after Apple releases some OpenGL 4.3 at least...
# elseif(SYS_APPLE)
......@@ -40,5 +40,5 @@ else()
PATH_SUFFIXES dynamic)
endif()
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(GLFW3)
\ No newline at end of file
......@@ -4,5 +4,5 @@ set(GLM_DIR ${LIBS_PATH}/glm)
FIND_PATH(GLM_INCLUDE_PATH glm/glm.hpp
${GLM_DIR})
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library_nolib(GLM)
\ No newline at end of file
......@@ -12,7 +12,7 @@ endif()
FIND_LIBRARY(OpenAL_LIBRARY
NAMES OpenAL32.lib
PATHS ${OpenAL_LIB_DIR})
PATHS ${OpenAL_LIB_DIR})
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(OpenAL)
\ No newline at end of file
......@@ -29,5 +29,5 @@ else()
)
endif()
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(OpenGL)
\ No newline at end of file
......@@ -14,5 +14,5 @@ FIND_LIBRARY(STB_LIBRARY
NAMES stb.lib
PATHS ${STB_LIB_DIR})
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
check_library(STB)
\ No newline at end of file
project(GLARE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:libcmt /ignore:4098,4099")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /MP")
endif()
\ No newline at end of file
......@@ -5,7 +5,7 @@ set(ROOT_PATH ${CMAKE_SOURCE_DIR})
#message(${ROOT_PATH})
#Assets
add_definitions(-DASSETS_PATH="${ROOT_PATH}/assets/")
file(MAKE_DIRECTORY "${ROOT_PATH}/assets")
#add_definitions(-DASSETS_PATH="${ROOT_PATH}/assets/")
#file(MAKE_DIRECTORY "${ROOT_PATH}/assets")
message("Set necessary path definitions.")
\ No newline at end of file
set(LIBS_PATH ${CMAKE_SOURCE_DIR}/lib)
include(${CMAKE_MODULE_PATH}/setup/library.cmake)
include(${EXTENSION_PATH}/setup/library.cmake)
#OpenMP
find_package(OpenMP REQUIRED)
......@@ -8,6 +8,8 @@ if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
set(LIBRARIES_ROOT ${})
#GLEW
find_and_add_library(GLEW REQUIRED LIBRARIES)
add_definitions(-DGLEW_STATIC)
......
#ifndef __GLARE_INCLUDE_ADVANCED
#define __GLARE_INCLUDE_ADVANCED
#include <raytrace/intersect.h>
#include <raytrace/tracer/raygenerator.h>
#include <raytrace/tracer/pathtracer.h>
#include <raytrace/data/local_collector.h>
#include <raytrace/data/global_collector.h>
#endif //!__GLARE_INCLUDE_ADVANCED
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment