diff --git a/CMakeLists.txt b/CMakeLists.txt index 466d7a8..c35375c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release) add_subdirectory(${pfd_DIR}) add_subdirectory(${spdlog_DIR}) add_subdirectory(${glfw_DIR}) +add_subdirectory(src) set(SRC src/AppGLFW.cpp @@ -61,7 +62,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${imgui_DIR}/backends PUBLIC ${glfw_INCLUDE_DIR} PUBLIC ${pfd_DIR} - PUBLIC ${LIBCZI_INCLUDE_DIR}) + PUBLIC ${LIBCZI_INCLUDE_DIR} + PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) + if(WIN32) target_link_libraries(${PROJECT_NAME} diff --git a/src/AppGLFW.cpp b/src/AppGLFW.cpp index 58d05a6..157e391 100644 --- a/src/AppGLFW.cpp +++ b/src/AppGLFW.cpp @@ -1,6 +1,7 @@ #include "AppGLFW.hpp" #include "portable-file-dialogs.h" +#include "uiresources.h" ui::AppGLFW::AppGLFW() { @@ -48,7 +49,7 @@ ui::AppGLFW::AppGLFW() // " screen heigth " + std::to_string(height)); // Create window with graphics context - window = glfwCreateWindow(1200, 800, "pixelarium", nullptr, nullptr); + window = glfwCreateWindow(1200, 800, PIXELARIUM_TITLE, nullptr, nullptr); if (window == nullptr) { // lg::Logger::Error("no window"); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..76feb0c --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,6 @@ +set(PIXELARIUM_TITLE ${CMAKE_PROJECT_NAME}) + +message(STATUS "Configuring Resources") + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uiresources.h.in + ${CMAKE_BINARY_DIR}/uiresources.h @ONLY) diff --git a/src/uiresources.h.in b/src/uiresources.h.in new file mode 100644 index 0000000..ef02a8b --- /dev/null +++ b/src/uiresources.h.in @@ -0,0 +1,5 @@ +#pragma once + + +/*-- Gets filled in during the cmake configuration step --*/ +#cmakedefine PIXELARIUM_TITLE "@PIXELARIUM_TITLE@" \ No newline at end of file