...@@ -20,6 +20,6 @@ test:cmake: ...@@ -20,6 +20,6 @@ test:cmake:
- cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Debug - cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Debug
- cmake --build build --target unit_tests_csg - cmake --build build --target unit_tests_csg
- cd build - cd build
- ctest - ctest --verbose
tags: tags:
- mfix-exa - mfix-exa
...@@ -15,8 +15,6 @@ if(CCACHE_FOUND) ...@@ -15,8 +15,6 @@ if(CCACHE_FOUND)
set( CMAKE_CXX_COMPILER_LAUNCHER ccache ) set( CMAKE_CXX_COMPILER_LAUNCHER ccache )
endif() endif()
option(ENABLE_CSG "Build with CSG support" OFF)
# Download automatically, you can also just copy the conan.cmake file # Download automatically, you can also just copy the conan.cmake file
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
...@@ -37,7 +35,9 @@ include(Catch) ...@@ -37,7 +35,9 @@ include(Catch)
add_subdirectory(src/csg) add_subdirectory(src/csg)
target_include_directories(csg PRIVATE target_include_directories(csg
${CONAN_INCLUDE_DIRS_PEGTL}) PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CONAN_INCLUDE_DIRS_PEGTL}
)
target_compile_features(csg PRIVATE cxx_std_17) target_compile_features(csg PRIVATE cxx_std_17)
File moved
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <variant> #include <variant>
#include <vector> #include <vector>
#include <inputs.hpp> #include <solver_inputs.hpp>
namespace solver { namespace solver {
... ...
......
...@@ -8,19 +8,7 @@ pegtl = dependency('pegtl', method: 'pkg-config') ...@@ -8,19 +8,7 @@ pegtl = dependency('pegtl', method: 'pkg-config')
catch2 = dependency('catch2', method: 'pkg-config') catch2 = dependency('catch2', method: 'pkg-config')
cgal = dependency('cgal', method: 'pkg-config') cgal = dependency('cgal', method: 'pkg-config')
parser_inc = include_directories( parser_inc = include_directories('include', 'src')
'src/csg',
'src/csg/impl',
'src/inputs')
subdir('src/csg') subdir('src/csg')
subdir('src/inputs') subdir('src/inputs')
executable(
'mfix-parser',
'src/main.cpp',
include_directories: parser_inc,
link_with: [
lib_csg_parser,
lib_inputs_parser,
])
################################################################################ ################################################################################
# CSG Parser # CSG Parser
################################################################################ ################################################################################
add_library(csg) add_library(csg
csg.cpp
target_sources(csg PRIVATE levelset_2d.cpp
impl/parser.cpp levelset_3d.cpp
impl/levelset_3d.cpp matrix_functions.cpp
impl/levelset_2d.cpp parser.cpp
impl/csg.cpp
impl/matrix_functions.cpp
) )
target_include_directories(csg INTERFACE ${CMAKE_SOURCE_DIR})
target_link_libraries(csg PRIVATE target_link_libraries(csg PRIVATE
stdc++fs stdc++fs
CONAN_PKG::cgal CONAN_PKG::cgal
... ...
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include "../csg.hpp" #include "csg.hpp"
#include "csg_types.hpp" #include "csg_types.hpp"
... ...
......
File moved
File moved
#include "matrix_functions.hpp" #include "csg_matrix_functions.hpp"
namespace { namespace {
double determinant(const matrix::Mat2d &m) { double determinant(const matrix::Mat2d &m) {
... ...
......
lib_csg_parser = static_library( lib_csg_parser = static_library(
'csg-parser', 'csg-parser',
'impl/csg.cpp', 'csg.cpp',
'impl/levelset_3d.cpp', 'levelset_3d.cpp',
'impl/levelset_2d.cpp', 'levelset_2d.cpp',
'impl/parser.cpp', 'parser.cpp',
'impl/matrix_functions.cpp', 'matrix_functions.cpp',
include_directories: parser_inc,
dependencies: [pegtl, cgal], dependencies: [pegtl, cgal],
install : true) install : true)
... ...
......
File moved
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
add_executable(unit_tests_csg EXCLUDE_FROM_ALL add_executable(unit_tests_csg EXCLUDE_FROM_ALL
levelset/boolean.t.cpp levelset/boolean.t.cpp
levelset/extrude.t.cpp
levelset/primitives.t.cpp levelset/primitives.t.cpp
levelset/transform.t.cpp levelset/transform.t.cpp
levelset/extrude.t.cpp
parser/boolean.t.cpp parser/boolean.t.cpp
parser/main.cpp parser/extrude.t.cpp
parser/nest.cpp parser/nest.cpp
parser/other.t.cpp parser/other.t.cpp
parser/primitives.t.cpp parser/primitives.t.cpp
parser/transform.t.cpp parser/transform.t.cpp
parser/extrude.t.cpp unit_tests_csg.main.cpp
) )
target_include_directories(unit_tests_csg PRIVATE target_include_directories(unit_tests_csg
.. PUBLIC ${CMAKE_SOURCE_DIR}/include
../impl PRIVATE ${CMAKE_SOURCE_DIR}/src
${CONAN_INCLUDE_DIRS_CATCH2} ${CONAN_INCLUDE_DIRS_CATCH2}
) )
... ...
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <csg.hpp> #include <csg.hpp>
#include <csg_types.hpp> #include <csg_types.hpp>
#include <matrix_functions.hpp> #include <csg_matrix_functions.hpp>
namespace { namespace {
... ...
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <csg.hpp> #include <csg.hpp>
#include <csg_types.hpp> #include <csg_types.hpp>
#include <matrix_functions.hpp> #include <csg_matrix_functions.hpp>
namespace { namespace {
... ...
......
test_csg = executable( test_csg = executable(
'unit_tests_csg', 'unit_tests_csg',
'levelset/boolean.t.cpp', 'levelset/boolean.t.cpp',
'levelset/extrude.t.cpp',
'levelset/primitives.t.cpp', 'levelset/primitives.t.cpp',
'levelset/transform.t.cpp', 'levelset/transform.t.cpp',
'levelset/extrude.t.cpp',
'parser/boolean.t.cpp', 'parser/boolean.t.cpp',
'parser/main.cpp', 'parser/extrude.t.cpp',
'parser/nest.cpp', 'parser/nest.cpp',
'parser/other.t.cpp', 'parser/other.t.cpp',
'parser/primitives.t.cpp', 'parser/primitives.t.cpp',
'parser/transform.t.cpp', 'parser/transform.t.cpp',
'parser/extrude.t.cpp', 'unit_tests_csg.main.cpp',
include_directories: [parser_inc], include_directories: [parser_inc],
dependencies: [catch2, cgal], dependencies: [catch2, cgal],
link_with: lib_csg_parser, link_with: lib_csg_parser,
... ...
......
File moved
File moved
#ifndef CSG_TYPES_H_ #ifndef CSG_TYPES_H_
#define CSG_TYPES_H_ #define CSG_TYPES_H_
#include "matrix_functions.hpp" #include "csg_matrix_functions.hpp"
#include <array> #include <array>
#include <memory> #include <memory>
... ...
......
...@@ -5,7 +5,17 @@ lib_inputs_parser = static_library( ...@@ -5,7 +5,17 @@ lib_inputs_parser = static_library(
'parser.cpp', 'parser.cpp',
'solver.cpp', 'solver.cpp',
'time.cpp', 'time.cpp',
include_directories: parser_inc,
dependencies: [pegtl], dependencies: [pegtl],
install : true) install : true)
executable(
'mfix-parser',
'mfix-parser.main.cpp',
include_directories: parser_inc,
link_with: [
lib_csg_parser,
lib_inputs_parser,
])
subdir('tests') subdir('tests')