Commit c6fcf2f0 authored by TheNumbat's avatar TheNumbat
Browse files

initial codebase

parent f746c7c1
deps/* linguist-vendored
name: MacOS
on: [push]
jobs:
build-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: deps
run: brew install sdl2 pkg-config
- name: configure
run: mkdir build && cd build && cmake ..
- name: build
run: cmake --build build
name: Ubuntu
on: [push]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update
run: sudo apt update
- name: deps
run: sudo apt install pkg-config libgtk-3-dev libsdl2-dev
- name: configure
run: mkdir build && cd build && cmake ..
- name: build
run: cmake --build build
name: Windows
on: [push]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: configure
run: mkdir build && cd build && cmake ..
- name: build
run: cmake --build build
*build*/
.vs/
x64/
Debug/
*.asset
bin/*.db
bin/.vs
bin/*.opendb
bin/project.sublime-workspace
data/log_*
log_*
imgui.ini
deps/win/assimp/assimp.lib
deps/win/assimp/assimp_d.lib
settings.json
.vscode/*.json
.sublime/
.DS_Store
media/test.*
media/env_maps/
media/test/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Release",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build_rel/Scotty3D",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build Release"
},
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build_dbg/Scotty3D",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build Debug"
}
]
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Release",
"type": "shell",
"command": "mkdir build_rel ; pushd build_rel ; CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release .. ; make -j7 ; popd",
"args": [],
"group": "build",
"problemMatcher": "$gcc"
},
{
"label": "Build Debug",
"type": "shell",
"command": "mkdir build_dbg ; pushd build_dbg ; CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j7 ; popd",
"args": [],
"group": "build",
"problemMatcher": "$gcc"
}
]
}
\ No newline at end of file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Release",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build_rel/Scotty3D",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build Release"
},
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build_dbg/Scotty3D",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build Debug"
}
]
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Release",
"type": "shell",
"command": "mkdir build_rel ; pushd build_rel ; cmake -DCMAKE_BUILD_TYPE=Release .. ; make -j7 ; popd",
"args": [],
"group": "build",
"problemMatcher": "$gcc"
},
{
"label": "Build Debug",
"type": "shell",
"command": "mkdir build_dbg ; pushd build_dbg ; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j7 ; popd",
"args": [],
"group": "build",
"problemMatcher": "$gcc"
}
]
}
\ No newline at end of file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Release",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/RelWithDebInfo/Scotty3D.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build Release"
},
{
"name": "Debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/Scotty3D.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/media",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build Debug"
}
]
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Configure",
"type": "shell",
"group": "build",
"command": "build_win configure",
"problemMatcher": []
},
{
"label": "Build Release",
"type": "shell",
"command": "build_win RelWithDebInfo",
"args": [],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "Build Debug",
"type": "shell",
"command": "build_win Debug",
"args": [],
"group": "build",
"problemMatcher": "$msCompile"
}
]
}
\ No newline at end of file
cmake_minimum_required(VERSION 3.17)
# define project
project(Scotty3D VERSION 1.1
DESCRIPTION "CMU15462: Computer Graphics"
LANGUAGES CXX)
set(SCOTTY3D_BUILD_REF false)
if(SCOTTY3D_BUILD_REF)
add_definitions(-DSCOTTY3D_BUILD_REF)
endif()
# define sources
set(SOURCES_SCOTTY3D_GUI
"src/gui/manager.cpp"
"src/gui/manager.h"
"src/gui/model.cpp"
"src/gui/model.h"
"src/gui/layout.cpp"
"src/gui/layout.h"
"src/gui/animate.cpp"
"src/gui/animate.h"
"src/gui/widgets.cpp"
"src/gui/widgets.h"
"src/gui/rig.cpp"
"src/gui/rig.h"
"src/gui/render.cpp"
"src/gui/render.h")
set(SOURCES_SCOTTY3D_GEOM
"src/geometry/halfedge.cpp"
"src/geometry/halfedge.h"
"src/geometry/util.cpp"
"src/geometry/util.h"
"src/geometry/spline.h")
set(SOURCES_SCOTTY3D_RAYS
"src/rays/pathtracer.cpp"
"src/rays/pathtracer.h"
"src/rays/light.cpp"
"src/rays/light.h"
"src/rays/bsdf.h"
"src/rays/env_light.h"
"src/rays/bvh.h"
"src/rays/list.h"
"src/rays/object.h"
"src/rays/samplers.h"
"src/rays/tri_mesh.h"
"src/rays/shapes.h")
set(SOURCES_SCOTTY3D_UTIL
"src/util/hdr_image.cpp"
"src/util/hdr_image.h"
"src/util/camera.cpp"
"src/util/camera.h"
"src/util/thread_pool.cpp"
"src/util/thread_pool.h"
"src/util/rand.h"
"src/util/rand.cpp")
set(SOURCES_SCOTTY3D_PLATFORM
"src/platform/gl.cpp"
"src/platform/platform.cpp"
"src/platform/gl.h"
"src/platform/platform.h"
"deps/imgui/imgui_impl_opengl3.cpp"
"deps/imgui/imgui_impl_opengl3.h"
"deps/imgui/imgui_impl_sdl.cpp"
"deps/imgui/imgui_impl_sdl.h")
set(SOURCES_SCOTTY3D_SCENE
"src/scene/undo.cpp"
"src/scene/undo.h"
"src/scene/renderer.cpp"
"src/scene/renderer.h"
"src/scene/scene.cpp"
"src/scene/scene.h"
"src/scene/pose.cpp"
"src/scene/pose.h"
"src/scene/skeleton.h"
"src/scene/light.cpp"
"src/scene/light.h"
"src/scene/skeleton.cpp"
"src/scene/skeleton.h"
"src/scene/material.cpp"
"src/scene/material.h"
"src/scene/object.cpp"
"src/scene/object.h")
set(SOURCES_SCOTTY3D_LIB
"src/lib/bbox.h"
"src/lib/line.h"
"src/lib/log.h"
"src/lib/mat4.h"
"src/lib/mathlib.h"
"src/lib/plane.h"
"src/lib/quat.h"
"src/lib/ray.h"
"src/lib/spectrum.h"
"src/lib/vec2.h"
"src/lib/vec3.h"
"src/lib/vec4.h")
if(SCOTTY3D_BUILD_REF)
set(SOURCES_SCOTTY3D_STUDENT
"src/reference/meshedit.cpp"
"src/reference/camera.cpp"
"src/reference/pathtracer.cpp"
"src/reference/samplers.cpp"
"src/reference/shapes.cpp"
"src/reference/bsdf.cpp"
"src/reference/bbox.cpp"
"src/reference/skeleton.cpp"
"src/reference/env_light.cpp"
"src/reference/tri_mesh.cpp")
else()
set(SOURCES_SCOTTY3D_STUDENT
"src/student/meshedit.cpp"
"src/student/camera.cpp"
"src/student/pathtracer.cpp"
"src/student/samplers.cpp"
"src/student/shapes.cpp"
"src/student/bsdf.cpp"
"src/student/bbox.cpp"
"src/student/debug.h"
"src/student/debug.cpp"
"src/student/env_light.cpp"
"src/student/skeleton.cpp"
"src/student/tri_mesh.cpp")
endif()
set(SOURCES_SCOTTY3D ${SOURCES_SCOTTY3D_UTIL}
${SOURCES_SCOTTY3D_GUI}
${SOURCES_SCOTTY3D_GEOM}
${SOURCES_SCOTTY3D_RAYS}
${SOURCES_SCOTTY3D_PLATFORM}
${SOURCES_SCOTTY3D_STUDENT}
${SOURCES_SCOTTY3D_SCENE}
${SOURCES_SCOTTY3D_LIB}
"src/app.cpp"
"src/app.h"
"src/main.cpp")
# setup OS-specific options
if(UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework AppKit")
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS}/..)
include_directories(${SDL2_INCLUDE_DIRS})
link_directories(${SDL2_LIBRARY_DIRS})
add_definitions(${SDL2_CFLAGS_OTHER})
endif()
if(LINUX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
include_directories(${SDL2_INCLUDE_DIRS})
link_directories(${SDL2_LIBRARY_DIRS})
add_definitions(${SDL2_CFLAGS_OTHER})
endif()
# define executable
if(WIN32)
add_executable(Scotty3D ${SOURCES_SCOTTY3D})
else()
add_executable(Scotty3D ${SOURCES_SCOTTY3D})
endif()
set_target_properties(Scotty3D PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF)
if(MSVC)
target_compile_options(Scotty3D PRIVATE /W4 /WX /wd4201 /wd4840 /wd4100 /fp:fast)
else()
target_compile_options(Scotty3D PRIVATE -Wall -Wextra -Werror -Wno-reorder -Wno-unused-parameter)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address")
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(Scotty3D PRIVATE Threads::Threads)
# define include paths
target_include_directories(Scotty3D PRIVATE "deps/" "deps/assimp/include")
target_include_directories(Scotty3D PRIVATE "${CMAKE_BINARY_DIR}/deps/assimp/include")
include_directories("${Scotty3D_SOURCE_DIR}/deps/")
source_group(lib FILES ${SOURCES_SCOTTY3D_LIB})
source_group(scene FILES ${SOURCES_SCOTTY3D_SCENE})
source_group(platform FILES ${SOURCES_SCOTTY3D_PLATFORM})
# build dependencies
add_subdirectory("deps/imgui/")
add_subdirectory("deps/glad/")
add_subdirectory("deps/nfd/")
add_subdirectory("deps/sf_libs/")
set(ASSIMP_BUILD_COLLADA_IMPORTER TRUE)
set(ASSIMP_BUILD_OBJ_IMPORTER TRUE)
set(ASSIMP_BUILD_PLY_IMPORTER TRUE)
set(ASSIMP_BUILD_FBX_IMPORTER TRUE)
set(ASSIMP_BUILD_GLTF_IMPORTER TRUE)
set(ASSIMP_BUILD_3DS_IMPORTER TRUE)
set(ASSIMP_BUILD_STL_IMPORTER TRUE)
set(ASSIMP_BUILD_BLEND_IMPORTER TRUE)
set(ASSIMP_BUILD_COLLADA_EXPORTER TRUE)
add_subdirectory("deps/assimp/")
include_directories(${ASSIMP_INCLUDE_DIRS})
# link libraries
if(WIN32)
target_include_directories(Scotty3D PRIVATE "deps/win")
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${Scotty3D_SOURCE_DIR}/src/platform/icon.res /IGNORE:4098 /IGNORE:4099")
endif()
add_definitions(-DWIN32_LEAN_AND_MEAN)
target_link_libraries(Scotty3D PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/deps/win/SDL2/SDL2main.lib")
target_link_libraries(Scotty3D PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/deps/win/SDL2/SDL2.lib")
target_link_libraries(Scotty3D PRIVATE Winmm)
target_link_libraries(Scotty3D PRIVATE Version)
target_link_libraries(Scotty3D PRIVATE Setupapi)
target_link_libraries(Scotty3D PRIVATE Shcore)
endif()
if(LINUX)
target_link_libraries(Scotty3D PRIVATE SDL2)
endif()
if(APPLE)
target_link_libraries(Scotty3D PRIVATE ${SDL2_LIBRARIES})
endif()
target_link_libraries(Scotty3D PRIVATE assimp)
target_link_libraries(Scotty3D PRIVATE nfd)
target_link_libraries(Scotty3D PRIVATE sf_libs)
target_link_libraries(Scotty3D PRIVATE imgui)
target_link_libraries(Scotty3D PRIVATE glad)
@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" > NUL 2> NUL
mkdir build
pushd build
cmake ..
if "%1"=="configure" exit
if [%1]==[] (cmake --build . --config RelWithDebInfo)
if not [%1]==[] (cmake --build . --config %1)
popd
# Commented out parameters are those with the same value as base LLVM style
# We can uncomment them if we want to change their value, or enforce the
# chosen value in case the base style changes (last sync: Clang 6.0.1).
---
### General config, applies to all languages ###
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
# AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlines: Right
# AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: false
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
# AfterClass: false
# AfterControlStatement: false
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
# BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
# BreakStringLiterals: true
ColumnLimit: 0
# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IncludeBlocks: Preserve
IncludeCategories:
- Regex: '".*"'
Priority: 1
- Regex: '^<.*\.h>'
Priority: 2
- Regex: '^<.*'
Priority: 3
# IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
#IndentPPDirectives: AfterHash
IndentWidth: 4
# IndentWrappedFunctionNames: false
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PointerAlignment: Right
# RawStringFormats:
# - Delimiter: pb
# Language: TextProto
# BasedOnStyle: google
# ReflowComments: true
# SortIncludes: true
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeParens: ControlStatements
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
---
### C++ specific config ###
Language: Cpp
Standard: Cpp11
---
### ObjC specific config ###
Language: ObjC
Standard: Cpp11
ObjCBlockIndentWidth: 4
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
---
### Java specific config ###
Language: Java
# BreakAfterJavaFieldAnnotations: false
...
# See <http://EditorConfig.org> for details
root = true
[CMakeLists.txt,*.cmake{,.in}]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 2
indent_style = space
[*.h.in]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space
[*.txt]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
set(ASSIMP_INCLUDE_DIRS
"@PROJECT_SOURCE_DIR@"
"@PROJECT_BINARY_DIR@")
set(ASSIMP_PACKAGE_VERSION "@ASSIMP_SOVERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${ASSIMP_PACKAGE_VERSION}" VERSION_LESS "${ASSIMP_PACKAGE_FIND_VERSION}")
set(ASSIMP_PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(ASSIMP_PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${ASSIMP_PACKAGE_VERSION}" VERSION_EQUAL "${ASSIMP_PACKAGE_FIND_VERSION}")
set(ASSIMP_PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
:: This is an example file to generate binaries using Windows Operating System
:: This script is configured to be executed from the source directory
:: Compiled binaries will be placed in BINARIES_DIR\code\CONFIG
:: NOTE
:: The build process will generate a config.h file that is placed in BINARIES_DIR\include
:: This file must be merged with SOURCE_DIR\include
:: You should write yourself a script that copies the files where you want them.
:: Also see: https://github.com/assimp/assimp/pull/2646
SET SOURCE_DIR=.
:: For generators see "cmake --help"
SET GENERATOR=Visual Studio 15 2017
SET BINARIES_DIR="./BINARIES/Win32"
cmake CMakeLists.txt -G "%GENERATOR%" -S %SOURCE_DIR% -B %BINARIES_DIR%
cmake --build %BINARIES_DIR% --config release
SET BINARIES_DIR="./BINARIES/x64"
cmake CMakeLists.txt -G "%GENERATOR% Win64" -S %SOURCE_DIR% -B %BINARIES_DIR%
cmake --build %BINARIES_DIR% --config debug
cmake --build %BINARIES_DIR% --config release
PAUSE
# Build Instructions
## Build on all platforms using vcpkg
You can download and install assimp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
```bash
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install assimp
```
The assimp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
## Manual build instructions
### Install CMake
Asset-Importer-Lib can be build for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via
```bash
sudo apt-get install cmake
```
### Get the source
Make sure you have a working git-installation. Open a command prompt and clone the Asset-Importer-Lib via:
```bash
git clone https://github.com/assimp/assimp.git
```
### Build instructions for Windows with Visual-Studio
First you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/
To generate the build environment for your IDE open a command prompt, navigate to your repo and type:
```bash
cmake CMakeLists.txt
```
This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it.
### Build instructions for Windows with UWP
See <https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app>
### Build instructions for Linux / Unix
Open a terminal and got to your repository. You can generate the makefiles and build the library via:
```bash
cmake CMakeLists.txt
make -j4
```
The option -j descripes the number of parallel processes for the build. In this case make will try to use 4 cores for the build.
If you want to use a IDE for linux you can try QTCreator for instance.
### Build instructions for MinGW
Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag
required to compile some of assimp's files, especially for debug builds.
Version 7.3.0 of g++-mingw-w64 & gcc-mingw-w64 appears to work.
Please see [CMake Cross Compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling) for general information on CMake Toolchains.
Some users have had success building assimp using MinGW on Linux using [polly](https://github.com/ruslo/polly/).
The following toolchain, which is not maintained by assimp, seems to work on Linux: [linux-mingw-w64-gnuxx11.cmake](https://github.com/ruslo/polly/blob/master/linux-mingw-w64-gnuxx11.cmake)
The following toolchain may or may not be helpful for building assimp using MinGW on Windows (untested):
[mingw-cxx17.cmake](https://github.com/ruslo/polly/blob/master/mingw-cxx17.cmake)
Besides the toolchain, compilation should be the same as for Linux / Unix.
### CMake build options
The cmake-build-environment provides options to configure the build. The following options can be used:
- **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib.
- **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle
- **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values.
- **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets
- **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active
- **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality
- **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib
- **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library.
- **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut).
- **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library.
- **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage.
- **ASSIMP_ERROR_MAX( default OFF)**: Enable all warnings.
- **ASSIMP_WERROR( default OFF )**: Treat warnings as errors.
- **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer.
- **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer.
- **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library.
- **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen.
- **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names
- **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash.
- **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files.
This diff is collapsed.
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