refactor: cleanup cmake, fix benchmar/tests
This commit is contained in:
114
CMakeLists.txt
114
CMakeLists.txt
@@ -12,23 +12,18 @@ set(CMAKE_AUTORCC ON)
|
||||
# setup project
|
||||
project(enzo_project)
|
||||
|
||||
set(ENGINE_SOURCES
|
||||
src/Engine/Operator/Attribute.cpp
|
||||
src/Engine/Operator/Geometry.cpp
|
||||
src/Engine/Operator/GeometryOperator.cpp
|
||||
src/Engine/Operator/GeometryConnection.cpp
|
||||
src/Engine/Operator/GeometryOpDef.cpp
|
||||
src/Engine/Operator/GOP_test.cpp
|
||||
src/Engine/Operator/GOP_transform.cpp
|
||||
src/Engine/Network/NetworkManager.cpp
|
||||
)
|
||||
|
||||
# qt
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets SvgWidgets OpenGLWidgets)
|
||||
qt_standard_project_setup()
|
||||
|
||||
# glm
|
||||
find_package(glm REQUIRED)
|
||||
|
||||
# eigen (math)
|
||||
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
|
||||
|
||||
# tbb
|
||||
find_package(TBB REQUIRED COMPONENTS TBB::tbb)
|
||||
|
||||
|
||||
|
||||
qt_add_executable(${AppExec}
|
||||
set(GUI_SOURCES
|
||||
static/resources.qrc
|
||||
src/Gui/main.cpp
|
||||
src/Gui/Interface.cpp
|
||||
@@ -47,62 +42,59 @@ qt_add_executable(${AppExec}
|
||||
src/Gui/Network/FloatingEdgeGraphic.cpp
|
||||
src/Gui/Network/DisplayFlagButton.cpp
|
||||
src/Gui/Network/NodeIconGraphic.cpp
|
||||
)
|
||||
|
||||
src/Engine/Operator/Attribute.cpp
|
||||
src/Engine/Operator/Geometry.cpp
|
||||
src/Engine/Operator/GeometryOperator.cpp
|
||||
src/Engine/Operator/GeometryConnection.cpp
|
||||
src/Engine/Operator/GeometryOpDef.cpp
|
||||
src/Engine/Network/NetworkManager.cpp
|
||||
# qt
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets SvgWidgets OpenGLWidgets)
|
||||
qt_standard_project_setup()
|
||||
|
||||
src/Engine/Operator/GOP_test.cpp
|
||||
src/Engine/Operator/GOP_transform.cpp
|
||||
# glm
|
||||
find_package(glm REQUIRED)
|
||||
|
||||
# eigen (math)
|
||||
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
|
||||
|
||||
# tbb
|
||||
find_package(TBB REQUIRED COMPONENTS TBB::tbb)
|
||||
|
||||
|
||||
|
||||
qt_add_executable(${AppExec}
|
||||
${GUI_SOURCES}
|
||||
${ENGINE_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets Qt6::SvgWidgets Qt6::OpenGLWidgets glm::glm Eigen3::Eigen TBB::tbb)
|
||||
target_include_directories(${AppExec} PUBLIC src)
|
||||
|
||||
# tests
|
||||
# Include(FetchContent)
|
||||
Include(FetchContent)
|
||||
|
||||
# FetchContent_Declare(
|
||||
# Catch2
|
||||
# GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
# GIT_TAG v3.8.1 # or a later release
|
||||
# )
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.8.1 # or a later release
|
||||
)
|
||||
|
||||
# FetchContent_MakeAvailable(Catch2)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
# add_executable(${TestExec}
|
||||
# tests/main-tests.cpp
|
||||
# tests/OperatorTests.cpp
|
||||
# tests/NetworkTests.cpp
|
||||
add_executable(${TestExec}
|
||||
${ENGINE_SOURCES}
|
||||
tests/main-tests.cpp
|
||||
tests/OperatorTests.cpp
|
||||
tests/NetworkTests.cpp
|
||||
)
|
||||
target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb)
|
||||
target_compile_definitions(${TestExec} PRIVATE UNIT_TEST)
|
||||
target_include_directories(${TestExec} PUBLIC src)
|
||||
|
||||
# src/Engine/Operator/Attribute.cpp
|
||||
# src/Engine/Operator/Geometry.cpp
|
||||
# src/Engine/Operator/GeometryOperator.cpp
|
||||
# src/Engine/Network/NetworkManager.cpp
|
||||
# src/Engine/Operator/GeometryConnection.cpp
|
||||
# src/Engine/Operator/GeometryOpDef.cpp
|
||||
# src/Engine/Operator/GOP_test.cpp
|
||||
# )
|
||||
# target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb)
|
||||
# target_compile_definitions(${TestExec} PRIVATE UNIT_TEST)
|
||||
# target_include_directories(${TestExec} PUBLIC src)
|
||||
# benchmarks
|
||||
add_executable(${BenchExec}
|
||||
${ENGINE_SOURCES}
|
||||
|
||||
# # benchmarks
|
||||
# add_executable(${BenchExec}
|
||||
# tests/Benchmarks.cpp
|
||||
|
||||
# src/Engine/Operator/Attribute.cpp
|
||||
# src/Engine/Operator/Geometry.cpp
|
||||
# src/Engine/Operator/GeometryOperator.cpp
|
||||
# src/Engine/Network/NetworkManager.cpp
|
||||
# src/Engine/Operator/GeometryConnection.cpp
|
||||
# src/Engine/Operator/GeometryOpDef.cpp
|
||||
# src/Engine/Operator/GOP_test.cpp
|
||||
# )
|
||||
# target_link_libraries(${BenchExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb)
|
||||
# target_compile_definitions(${BenchExec} PRIVATE UNIT_TEST)
|
||||
# target_include_directories(${BenchExec} PUBLIC src)
|
||||
tests/Benchmarks.cpp
|
||||
)
|
||||
target_link_libraries(${BenchExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb)
|
||||
target_compile_definitions(${BenchExec} PRIVATE UNIT_TEST)
|
||||
target_include_directories(${BenchExec} PUBLIC src)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Operator/GeometryOperator.h"
|
||||
#include "Engine/Types.h"
|
||||
#include "Engine/Operator/GOP_test.h"
|
||||
#include <iostream>
|
||||
|
||||
struct NMReset
|
||||
@@ -22,7 +23,7 @@ struct NMReset
|
||||
TEST_CASE_METHOD(NMReset, "Network Manager")
|
||||
{
|
||||
using namespace enzo;
|
||||
nt::OpId startOp = nt::NetworkManager::addOperator();
|
||||
nt::OpId startOp = nt::NetworkManager::addOperator(&GOP_test::ctor);
|
||||
nt::OpId prevOp = startOp;
|
||||
std::vector<nt::OpId> prevOps;
|
||||
|
||||
@@ -30,7 +31,7 @@ TEST_CASE_METHOD(NMReset, "Network Manager")
|
||||
{
|
||||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
nt::OpId newOp = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOp = nt::NetworkManager::addOperator(&GOP_test::ctor);
|
||||
prevOps.push_back(newOp);
|
||||
nt::connectOperators(newOp, i, prevOp, 0);
|
||||
}
|
||||
@@ -40,7 +41,7 @@ TEST_CASE_METHOD(NMReset, "Network Manager")
|
||||
for(int i=0; i<size(prevOpsBuffer); ++i)
|
||||
{
|
||||
prevOps.clear();
|
||||
nt::OpId newOp = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOp = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
prevOps.push_back(newOp);
|
||||
nt::connectOperators(newOp, 0, prevOpsBuffer[i], 0);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Operator/GeometryOperator.h"
|
||||
#include "Engine/Types.h"
|
||||
#include "Engine/Operator/GOP_test.h"
|
||||
#include <iostream>
|
||||
|
||||
struct NMReset
|
||||
@@ -22,7 +23,7 @@ struct NMReset
|
||||
TEST_CASE_METHOD(NMReset, "network fixture separation start")
|
||||
{
|
||||
using namespace enzo;
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
REQUIRE(newOpId==1);
|
||||
REQUIRE(nt::NetworkManager::isValidOp(1));
|
||||
|
||||
@@ -38,8 +39,8 @@ TEST_CASE_METHOD(NMReset, "network fixture separation end")
|
||||
TEST_CASE_METHOD(NMReset, "network")
|
||||
{
|
||||
using namespace enzo;
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOpId2 = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
nt::OpId newOpId2 = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
|
||||
REQUIRE(nt::NetworkManager::isValidOp(newOpId));
|
||||
if(nt::NetworkManager::isValidOp(newOpId))
|
||||
@@ -61,13 +62,13 @@ TEST_CASE_METHOD(NMReset, "network")
|
||||
TEST_CASE_METHOD(NMReset, "reset")
|
||||
{
|
||||
using namespace enzo;
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOpId = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
|
||||
nt::NetworkManager::_reset();
|
||||
|
||||
REQUIRE_FALSE(nt::NetworkManager::isValidOp(newOpId));
|
||||
|
||||
nt::OpId newOpId2 = nt::NetworkManager::addOperator();
|
||||
nt::OpId newOpId2 = nt::NetworkManager::addOperator(GOP_test::ctor);
|
||||
REQUIRE(nt::NetworkManager::isValidOp(newOpId2));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user