Skip to content

Commit

Permalink
vtx_tool & vtx_tool_test
Browse files Browse the repository at this point in the history
  • Loading branch information
sguionni committed Jun 12, 2024
1 parent 5fcefc5 commit 1ba040d
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 83 deletions.
8 changes: 8 additions & 0 deletions dev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ include("${DIR_LIBS}/ui/test/cmake/library.cmake")

vtx_clear_registered_copies()

# Tool.
include("${DIR_LIBS}/tool/cmake/library.cmake")

# Tool test.
include("${DIR_LIBS}/tool/test/cmake/library.cmake")

vtx_clear_registered_copies()

# MdPrep.
include("${DIR_LIBS}/tool/tools/mdprep/cmake/library.cmake")

Expand Down
1 change: 0 additions & 1 deletion lib/renderer/test/cmake/library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (NOT DEFINED _VTX_RENDERER_TEST_CONAN)
target_link_libraries(vtx_renderer_test PRIVATE vtx_core)
target_link_libraries(vtx_renderer_test PRIVATE vtx_io)
target_link_libraries(vtx_renderer_test PRIVATE Catch2::Catch2WithMain)

else()
target_link_libraries(vtx_renderer_test PRIVATE vtx_util::vtx_util)
target_link_libraries(vtx_renderer_test PRIVATE vtx_renderer::vtx_renderer_no_opengl)
Expand Down
25 changes: 3 additions & 22 deletions lib/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
message("vtx_tool")
cmake_minimum_required(VERSION 3.23)

project(vtx_tool)

find_package(vtx_util CONFIG REQUIRED)
find_package(vtx_app CONFIG REQUIRED)
find_package(vtx_ui CONFIG REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(vtx_tool_mdprep REQUIRED)
find_package(Eigen3 REQUIRED)

configure_qt()
add_library(vtx_tool)
configure_target(vtx_tool)

set(QT_RESOURCES_PATH asset/qt/resources)

file(GLOB_RECURSE HEADERS include/*)
file(GLOB_RECURSE SOURCES src/*)
file(GLOB_RECURSE QT_RESOURCES ${QT_RESOURCES_PATH}/*)
target_sources(vtx_tool
PRIVATE ${SOURCES}
PUBLIC FILE_SET public_headers TYPE HEADERS BASE_DIRS include FILES ${HEADERS})

qt_add_resources(vtx_tool vtx_qt_resources_tool BASE ${QT_RESOURCES_PATH} FILES ${QT_RESOURCES})

target_link_libraries(vtx_tool PRIVATE vtx_util::vtx_util)
target_link_libraries(vtx_tool PRIVATE vtx_app::vtx_app)
target_link_libraries(vtx_tool PRIVATE vtx_ui::vtx_ui)
target_link_libraries(vtx_tool PRIVATE Eigen3::Eigen)
target_link_libraries(vtx_tool PRIVATE vtx_tool_mdprep::vtx_tool_mdprep)
set(_VTX_TOOL_CONAN " ")
include("./cmake/library.cmake")

install(TARGETS vtx_tool FILE_SET public_headers DESTINATION include)
27 changes: 27 additions & 0 deletions lib/tool/cmake/library.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
add_library(vtx_tool)
configure_target(vtx_tool)

set(QT_RESOURCES_PATH ${CMAKE_CURRENT_LIST_DIR}/../asset/qt/resources)

file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_LIST_DIR}/../include/*)
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/../src/*)
file(GLOB_RECURSE QT_RESOURCES ${QT_RESOURCES_PATH}/*)
target_sources(vtx_tool
PRIVATE ${SOURCES}
PUBLIC FILE_SET public_headers TYPE HEADERS BASE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../include FILES ${HEADERS})

qt_add_resources(vtx_tool vtx_qt_resources_tool BASE ${QT_RESOURCES_PATH} FILES ${QT_RESOURCES})

if (NOT DEFINED _VTX_TOOL_CONAN)
target_link_libraries(vtx_tool PRIVATE vtx_util)
target_link_libraries(vtx_tool PRIVATE vtx_app)
target_link_libraries(vtx_tool PRIVATE vtx_ui)
target_link_libraries(vtx_tool PRIVATE vtx_tool_mdprep)
else()
target_link_libraries(vtx_tool PRIVATE vtx_util::vtx_util)
target_link_libraries(vtx_tool PRIVATE vtx_app::vtx_app)
target_link_libraries(vtx_tool PRIVATE vtx_ui::vtx_ui)
target_link_libraries(vtx_tool PRIVATE vtx_tool_mdprep::vtx_tool_mdprep)
endif()

target_link_libraries(vtx_tool PRIVATE Eigen3::Eigen)
6 changes: 3 additions & 3 deletions lib/tool/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class VTXToolRecipe(ConanFile):
def requirements(self):
self.requires("vtx_util/1.0")
self.requires("vtx_app/1.0")
self.requires("vtx_ui/1.0")
self.requires("eigen/3.4.0")
self.requires("vtx_tool_mdprep/1.0")
self.requires("vtx_ui/1.0")
self.requires("vtx_tool_mdprep/1.0")
self.requires("eigen/3.4.0")

def generate(self):
copy(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_UI_CORE_EXAMPLE_TOOL_REGISTRATION_TEST__
#define __VTX_UI_CORE_EXAMPLE_TOOL_REGISTRATION_TEST__

#include "ui/core/tool_registry.hpp"
#include "tool/core/tool_registry.hpp"

namespace VTX::UI::Core::Example
{
Expand Down
2 changes: 1 addition & 1 deletion lib/tool/include/tool/core/io/vtx_layout_reader.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_UI_CORE_IO_VTX_LAYOUT_READER__
#define __VTX_UI_CORE_IO_VTX_LAYOUT_READER__

#include "ui/core/layout_descriptor.hpp"
#include "tool/core/layout_descriptor.hpp"
#include <util/types.hpp>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion lib/tool/include/tool/core/layout_builder.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_UI_CORE_LAYOUT_BUILDER__
#define __VTX_UI_CORE_LAYOUT_BUILDER__

#include "ui/core/layout_descriptor.hpp"
#include "tool/core/layout_descriptor.hpp"
#include <vector>

namespace VTX::UI::Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_UI_CORE_SERIALIZATION_UI_CORE_SERIALIZERS__
#define __VTX_UI_CORE_SERIALIZATION_UI_CORE_SERIALIZERS__

#include "ui/core/layout_descriptor.hpp"
#include "tool/core/layout_descriptor.hpp"
#include <util/json/json.hpp>
#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions lib/tool/include/tool/core/tool_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define __VTX_UI_CORE_TOOL_HANDLER__

#include <app/application/system/system_registration.hpp>
#include <ui/core/base_ui_tool.hpp>
#include <ui/core/layout_descriptor.hpp>
#include <tool/core/base_ui_tool.hpp>
#include <tool/core/layout_descriptor.hpp>
#include <vector>

namespace VTX::UI::Core
Expand Down
2 changes: 1 addition & 1 deletion lib/tool/include/tool/qt/base_qt_widget.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_UI_QT_BASE_QT_TOOL__
#define __VTX_UI_QT_BASE_QT_TOOL__

#include "ui/core/base_ui_tool.hpp"
#include "tool/core/base_ui_tool.hpp"
#include <QObject>

namespace VTX::UI::QT
Expand Down
2 changes: 1 addition & 1 deletion lib/tool/src/tool/core/example/tool_registration_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ui/core/example/tool_registration_test.hpp"
#include "tool/core/example/tool_registration_test.hpp"
#include <util/logger.hpp>

namespace VTX::UI::Core::Example
Expand Down
4 changes: 2 additions & 2 deletions lib/tool/src/tool/core/io/vtx_layout_reader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ui/core/io/vtx_layout_reader.hpp"
#include "ui/core/serialization/ui_core_serializers.hpp"
#include "tool/core/io/vtx_layout_reader.hpp"
#include "tool/core/serialization/ui_core_serializers.hpp"
#include <app/application/system/serializer.hpp>

namespace VTX::UI::Core::IO
Expand Down
4 changes: 2 additions & 2 deletions lib/tool/src/tool/core/layout_builder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ui/core/layout_builder.hpp"
#include "ui/core/tool_handler.hpp"
#include "tool/core/layout_builder.hpp"
#include "tool/core/tool_handler.hpp"
#include <util/logger.hpp>

namespace VTX::UI::Core
Expand Down
2 changes: 1 addition & 1 deletion lib/tool/src/tool/core/layout_descriptor.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ui/core/layout_descriptor.hpp"
#include "tool/core/layout_descriptor.hpp"

namespace VTX::UI::Core
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ui/core/serialization/ui_core_serializers.hpp"
#include "tool/core/serialization/ui_core_serializers.hpp"
#include <app/application/system/serializer.hpp>
#include <string>
#include <util/exceptions.hpp>
Expand Down
5 changes: 2 additions & 3 deletions lib/tool/src/tool/core/tool_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "ui/core/tool_handler.hpp"
#include "ui/core/tool_registry.hpp"
#include "ui/qt/core/custom/dock_window_main_widget.hpp"
#include "tool/core/tool_handler.hpp"
#include "tool/core/tool_registry.hpp"

namespace VTX::UI::Core
{
Expand Down
2 changes: 1 addition & 1 deletion lib/tool/src/tool/qt/base_qt_widget.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ui/qt/base_qt_widget.hpp"
#include "tool/qt/base_qt_widget.hpp"

namespace VTX::UI::QT
{
Expand Down
13 changes: 3 additions & 10 deletions lib/tool/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
message("vtx_tool_test")
cmake_minimum_required(VERSION 3.23)

project(vtx_tool_test)

find_package(vtx_tool CONFIG REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Catch2 REQUIRED)

add_executable(vtx_tool_test src/main.cpp)
configure_target(vtx_tool_test)

target_link_libraries(vtx_tool_test PRIVATE vtx_tool::vtx_tool)
target_link_libraries(vtx_tool_test PRIVATE Catch2::Catch2WithMain)

target_compile_definitions(vtx_tool_test PRIVATE VTX_RENDERER_NO_OPENGL)

include(CTest)
include(Catch)
catch_discover_tests(vtx_tool_test DISCOVERY_MODE PRE_TEST)

set(_VTX_TOOL_TEST_CONAN " ")
include(cmake/library.cmake)

install(TARGETS vtx_tool_test)
14 changes: 14 additions & 0 deletions lib/tool/test/cmake/library.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(vtx_tool_test ${CMAKE_CURRENT_LIST_DIR}/../src/main.cpp)
configure_target(vtx_tool_test)

if (NOT DEFINED _VTX_TOOL_TEST_CONAN)
target_link_libraries(vtx_tool_test PRIVATE vtx_tool)
else()
target_link_libraries(vtx_tool_test PRIVATE vtx_tool::vtx_tool)
endif()

target_link_libraries(vtx_tool_test PRIVATE Eigen3::Eigen)
target_link_libraries(vtx_tool_test PRIVATE Catch2::Catch2WithMain)
target_compile_definitions(vtx_tool_test PRIVATE VTX_RENDERER_NO_OPENGL)

catch_discover_tests(vtx_tool_test DISCOVERY_MODE PRE_TEST)
19 changes: 6 additions & 13 deletions lib/ui/cmake/library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ configure_qt()
add_library(vtx_ui)
configure_target(vtx_ui)

find_package(Qt6 COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Gui REQUIRED)
find_package(Qt6 COMPONENTS Widgets REQUIRED)
find_package(Qt6 COMPONENTS OpenGLWidgets REQUIRED)

set(QT_RESOURCES_PATH ${CMAKE_CURRENT_LIST_DIR}/../asset/qt/resources)

file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_LIST_DIR}/../include/*)
Expand All @@ -28,10 +23,6 @@ if (NOT DEFINED _VTX_UI_CONAN)
target_link_libraries(vtx_ui PUBLIC vtx_app)
target_link_libraries(vtx_ui PUBLIC vtx_python_binding)
target_link_libraries(vtx_ui PUBLIC PyTX)
target_link_libraries(vtx_ui PUBLIC Qt6::Core)
target_link_libraries(vtx_ui PUBLIC Qt6::Gui)
target_link_libraries(vtx_ui PUBLIC Qt6::Widgets)
target_link_libraries(vtx_ui PUBLIC Qt6::OpenGLWidgets)

else()
target_link_libraries(vtx_ui PRIVATE vtx_util::vtx_util)
Expand All @@ -41,12 +32,14 @@ else()
target_link_libraries(vtx_ui PRIVATE vtx_app::vtx_app)
target_link_libraries(vtx_ui PRIVATE vtx_python_binding::vtx_python_binding)
target_link_libraries(vtx_ui PRIVATE vtx_python_binding::PyTX)
target_link_libraries(vtx_ui PRIVATE Qt6::Core)
target_link_libraries(vtx_ui PRIVATE Qt6::Gui)
target_link_libraries(vtx_ui PRIVATE Qt6::Widgets)
target_link_libraries(vtx_ui PRIVATE Qt6::OpenGLWidgets)

endif()

target_link_libraries(vtx_ui PRIVATE Qt6::Core)
target_link_libraries(vtx_ui PRIVATE Qt6::Gui)
target_link_libraries(vtx_ui PRIVATE Qt6::Widgets)
target_link_libraries(vtx_ui PRIVATE Qt6::OpenGLWidgets)

if(MSVC)
target_link_libraries(vtx_ui PRIVATE Qt6::QWindowsIntegrationPlugin)
endif()
16 changes: 0 additions & 16 deletions lib/ui/include/ui/qt/base_qt_widget.hpp

This file was deleted.

0 comments on commit 1ba040d

Please sign in to comment.