link stuff where needed & use only what's needed
This commit is contained in:
+7
-22
@@ -6,13 +6,16 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CXX_STANDARD 20)
|
||||
set(CXX_STANDARD_REQUIRED true)
|
||||
|
||||
set(glfw_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
|
||||
# setting global module directories
|
||||
set(glfw3_module_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
|
||||
set(glfw3_DIR "${glfw3_module_DIR}/CMake")
|
||||
set(imgui_DIR ${PROJECT_SOURCE_DIR}/modules/imgui)
|
||||
set(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs)
|
||||
set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
message(STATUS "GLFW:\t" ${glfw_DIR})
|
||||
message(STATUS "GLFW:\t" ${glfw3_module_DIR})
|
||||
message(STATUS "PFD:\t\t" ${pfd_DIR})
|
||||
message(STATUS "SPDLOG:\t" ${spdlog_DIR})
|
||||
|
||||
@@ -31,7 +34,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(${glfw3_module_DIR})
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(lib)
|
||||
|
||||
@@ -42,7 +45,7 @@ set(SRC
|
||||
src/main.cpp)
|
||||
|
||||
#====================
|
||||
# needed for the spdlogger implemntation
|
||||
# needed for the spdlogger implementation
|
||||
# this is not nice, but it won't work when, e.g. doing it from lower level cmake files
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
@@ -67,24 +70,6 @@ target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC ${LIBCZI_INCLUDE_DIR}
|
||||
PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE opengl32.lib
|
||||
PRIVATE glfw
|
||||
PRIVATE OpenGL::GL)
|
||||
endif()
|
||||
if(LINUX)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE glfw GL)
|
||||
endif()
|
||||
if(APPLE)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PUBLIC glfw
|
||||
PUBLIC "-framework OpenGL")
|
||||
endif()
|
||||
|
||||
|
||||
option(PIXELARIUM_BUILD_UNITTESTS "Generate Unittests" ON)
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,5 @@ class AppGLFW
|
||||
void LogLevelSelect();
|
||||
int log_level_{0};
|
||||
GLFWwindow* window = nullptr;
|
||||
ImGuiWindowFlags window_flags_ = 0;
|
||||
};
|
||||
} // namespace pixelarium::application
|
||||
|
||||
+18
-10
@@ -1,11 +1,3 @@
|
||||
set(imgui_DIR ${PROJECT_SOURCE_DIR}/modules/imgui)
|
||||
# set(glfw_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
|
||||
|
||||
message(STATUS "IMGUI:\t" ${imgui_DIR})
|
||||
# message(STATUS "GLFW:\t" ${glfw_DIR})
|
||||
|
||||
# add_directory(${glfw_DIR})
|
||||
|
||||
set(PIXELARIUM_TITLE ${CMAKE_PROJECT_NAME})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uiresources_app.h.in
|
||||
${CMAKE_BINARY_DIR}/uiresources_app.h @ONLY)
|
||||
@@ -28,9 +20,25 @@ add_library(${APPLIBNAME}
|
||||
target_link_libraries(${APPLIBNAME}
|
||||
PRIVATE pixelariumutilslib)
|
||||
|
||||
# This needs to be public to let the consumer know about it.
|
||||
if(WIN32)
|
||||
target_link_libraries(${APPLIBNAME}
|
||||
PUBLIC opengl32.lib
|
||||
PUBLIC glfw
|
||||
PUBLIC OpenGL::GL)
|
||||
endif()
|
||||
if(LINUX)
|
||||
target_link_libraries(${APPLIBNAME}
|
||||
PUBLIC glfw GL)
|
||||
endif()
|
||||
if(APPLE)
|
||||
target_link_libraries(${APPLIBNAME}
|
||||
PUBLIC glfw
|
||||
PUBLIC "-framework OpenGL")
|
||||
endif()
|
||||
|
||||
target_include_directories(${APPLIBNAME}
|
||||
PUBLIC ${CMAKE_BINARY_DIR}
|
||||
PUBLIC ${PROJECT_SOURCE_DIR}/lib
|
||||
PUBLIC ${imgui_DIR}
|
||||
PUBLIC ${imgui_DIR}/backends
|
||||
PUBLIC ${glfw_INCLUDE_DIR})
|
||||
PUBLIC ${imgui_DIR}/backends)
|
||||
|
||||
@@ -61,8 +61,8 @@ GLuint pixelarium::render::CvMatRender::uploadTexture()
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, this->texture_);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "AppGLFW.hpp"
|
||||
|
||||
Reference in New Issue
Block a user