Skip to content

Commit

Permalink
Migrate to Conan 2
Browse files Browse the repository at this point in the history
  • Loading branch information
LesleyLai committed Jun 1, 2023
1 parent 3a32428 commit c43a0c6
Show file tree
Hide file tree
Showing 15 changed files with 1,492 additions and 283 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Expand Up @@ -3,7 +3,5 @@ CMakeLists.txt.user
cmake-build-*
build
.vs

# Copied by conan
third-party/imgui/bindings
*/imgui.ini
CMakeUserPresets.json
*/imgui.ini
4 changes: 0 additions & 4 deletions CMakeLists.txt
Expand Up @@ -2,12 +2,8 @@ cmake_minimum_required(VERSION 3.17)

project(cuda_path_tracer VERSION 0.0.0 LANGUAGES CXX CUDA)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_BINARY_DIR}")

include("cmake/StandardProjectSettings.cmake")
include("cmake/compiler.cmake")
include("cmake/conan.cmake")
run_conan()

option(CUDA_PATH_TRACER_COPY_ASSETS "Copy assets to the build directory" ON)

Expand Down
1 change: 1 addition & 0 deletions cmake/compiler.cmake
Expand Up @@ -13,6 +13,7 @@ if (MSVC)
/wd4201
/wd4245
/wd4324 # Disable "structure was padded due to alignment specifier"
/wd4819 # Disable "The file contains a character that cannot be represented in the current code page"
/wd4127
>)
target_compile_definitions(cuda_pt_compiler_warnings INTERFACE _CRT_SECURE_NO_WARNINGS)
Expand Down
17 changes: 0 additions & 17 deletions cmake/conan.cmake

This file was deleted.

29 changes: 15 additions & 14 deletions conanfile.txt
@@ -1,26 +1,27 @@
[requires]
catch2/3.2.1
catch2/3.3.2
fmt/9.1.0
spdlog/1.11.0
glfw/3.3.2
glfw/3.3.8
glm/0.9.9.8
glad/0.1.34
glad/0.1.36
tl-function-ref/1.0.0
imgui/1.84.2
assimp/5.0.0
imgui/1.89.4
assimp/5.2.2
nlohmann_json/3.11.2
stb/cci.20210910
stb/cci.20220909

[generators]
cmake_find_package
CMakeToolchain
CMakeDeps

[options]
glad:gl_profile=core
glad:gl_version=4.5
glad/*:gl_profile=core
glad/*:gl_version=4.6

[imports]
./res/bindings, imgui_impl_glfw.cpp -> ../third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3.cpp -> ../third-party/imgui/bindings
./res/bindings, imgui_impl_glfw.h -> ../third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3.h -> ../third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3_loader.h -> ../third-party/imgui/bindings
./res/bindings, imgui_impl_glfw.cpp -> ./third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3.cpp -> ./third-party/imgui/bindings
./res/bindings, imgui_impl_glfw.h -> ./third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3.h -> ./third-party/imgui/bindings
./res/bindings, imgui_impl_opengl3_loader.h -> ./third-party/imgui/bindings
2 changes: 1 addition & 1 deletion src/interactive-app/CMakeLists.txt
Expand Up @@ -18,6 +18,6 @@ add_library(cuda_pt::interactive_app ALIAS cuda_pt_interactive_app)

target_link_libraries(cuda_pt_interactive_app PRIVATE
cuda_pt::lib
glfw::glfw
glfw
glad::glad
third-party::imgui_bindings)
4 changes: 2 additions & 2 deletions src/lib/CMakeLists.txt
Expand Up @@ -4,7 +4,7 @@ find_package(fmt REQUIRED)
find_package(glm REQUIRED)
find_package(assimp REQUIRED)
find_package(tl-function-ref REQUIRED)
find_package(jsonformoderncpp REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(stb REQUIRED)
find_package(spdlog REQUIRED)

Expand Down Expand Up @@ -61,7 +61,7 @@ target_link_libraries(cuda_pt_lib PUBLIC
tl::function-ref
stb::stb
assimp::assimp
jsonformoderncpp::jsonformoderncpp
nlohmann_json::nlohmann_json
cxxopts::cxxopts
CUDA::cudart)
target_include_directories(cuda_pt_lib PUBLIC ${PROJECT_SOURCE_DIR}/src)
Expand Down
1 change: 1 addition & 0 deletions src/lib/assets/json_parser.cpp
Expand Up @@ -11,6 +11,7 @@
#include <fstream>

#include <nlohmann/json.hpp>
#include <spdlog/spdlog.h>

#include "lib/prelude.hpp"

Expand Down
4 changes: 3 additions & 1 deletion src/lib/image.cpp
Expand Up @@ -2,13 +2,15 @@

#include "image.hpp"

#include <spdlog/spdlog.h>
#include <fmt/format.h>
#include <stb_image_write.h>

void write_image_file(std::string filename, Resolution res, const void* data)
{
auto [width, height] = res;

std::filesystem::path output_path{filename};
const std::filesystem::path output_path{filename};

if (output_path.extension() == ".png") {
if (stbi_write_png(filename.c_str(), width, height, 4, data, 0) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion third-party/imgui/CMakeLists.txt
Expand Up @@ -11,7 +11,7 @@ add_library(imgui_bindings

target_link_libraries(imgui_bindings
PUBLIC
glfw::glfw
glfw
glad::glad
imgui::imgui)

Expand Down

0 comments on commit c43a0c6

Please sign in to comment.