Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d3e995
add getter-function declarations
merakulix Mar 6, 2025
e487874
update getter functions
merakulix Mar 6, 2025
4aea7ae
update function for classes with optional uid
merakulix Apr 8, 2025
22b351a
update reference file to test sequence
merakulix Jul 7, 2025
e6ba578
Update cmake.yml
merakulix Jul 7, 2025
40565ae
Merge pull request #2 from DLR-SC/update-actions
joergbrech Jul 7, 2025
bf52f35
Merge pull request #1 from merakulix/issue59_add_uid_getters
joergbrech Jul 7, 2025
e083eb6
Remove the boost dependency
svengoldberg Jul 23, 2025
3a64342
Edit cmake.yml
svengoldberg Jul 29, 2025
f93f5a4
Include <functional> in CodeGen.cpp
svengoldberg Jul 29, 2025
7ec7ebb
Remove hard-wired gtest source code, download from GitHub
svengoldberg Jul 29, 2025
f643753
Remove relicts from boost package
svengoldberg Jul 30, 2025
b393713
Remove warning in test due to missing namespace in .xsd
svengoldberg Jul 30, 2025
3449b1f
Empty dummy files to avoid warnings in tests
svengoldberg Jul 30, 2025
afee6a2
Edit README.md
svengoldberg Jul 30, 2025
a833153
Remove absolete .yml files from old CI
svengoldberg Jul 30, 2025
6813843
Change type of MappingTable::find() to std::optional<...>
svengoldberg Aug 1, 2025
b0afcf1
Make code DRY by rewriting lambda to function
svengoldberg Aug 1, 2025
994fbba
Edit README.md (compiler for C++17 needed)
svengoldberg Aug 1, 2025
b50fc8a
Replace v.end() by std::end()
svengoldberg Aug 1, 2025
4b62209
Remove std::move() in constructor
svengoldberg Aug 1, 2025
016b668
Reactivate std::move() in constructor
svengoldberg Aug 1, 2025
ae039e0
Merge pull request #4 from DLR-SC/remove_boost_dependency
svengoldberg Aug 26, 2025
762d3ad
remove UniquePtr, use std::uniqe_ptr
joergbrech May 18, 2026
ecf2deb
use lambda in TixiReadElements
joergbrech May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: CMake

on: [push]
#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
on:
pull_request:
branches: [ master ]
workflow_dispatch:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -26,19 +24,20 @@ jobs:
curl http://download.opensuse.org/repositories/science:/dlr/xUbuntu_18.04/Release.key | sudo apt-key add -
echo "deb http://download.opensuse.org/repositories/science:/dlr/xUbuntu_18.04/ /" | sudo tee -a /etc/apt/sources.list
sudo apt-get update -qq
sudo apt-get install -y libboost-all-dev libtixi3-dev cmake cmake-data
sudo apt-get install -y libtixi3-dev cmake cmake-data

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
working-directory: ${{github.workspace}}/build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: make VERBOSE=1

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ./tests
run: ./tests
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

43 changes: 17 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# CPACSGen cmake project
# author: Bernhard Manfred Gruber

cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.11.0)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(CPACSGen)

# cache variables
set(BOOST_ROOT "" CACHE PATH "Boost installation prefix")
set(TIXI_PATH "" CACHE PATH "Tixi installation prefix")
set(TIGL_PATH "" CACHE PATH "Tigl installation prefix")

Expand All @@ -22,12 +21,6 @@ if (SYSTEM_RHEL7)
endif()
endif()

# find boost
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Find static or dynamic libs. Static libs require lib prefix.")
find_package (Boost REQUIRED COMPONENTS system filesystem date_time regex unit_test_framework)
mark_as_advanced(CLEAR BOOST_ROOT) # find module for boost marks these variables as advanced
mark_as_advanced(CLEAR Boost_USE_STATIC_LIBS)

# find tixi
set(CMAKE_PREFIX_PATH "${TIXI_PATH};${CMAKE_PREFIX_PATH}")
find_package(tixi3 3.0.3 REQUIRED)
Expand All @@ -42,9 +35,6 @@ target_compile_definitions(lib${PROJECT_NAME} PUBLIC
-DCPACS_GEN
)

target_include_directories(lib${PROJECT_NAME} PUBLIC
${Boost_INCLUDE_DIRS}
)

# driver
file(GLOB DRIVER_INPUTS src/driver/*.cpp *src/driver/*.h *.md)
Expand All @@ -53,32 +43,33 @@ source_group(" " FILES ${DRIVER_INPUTS})

target_link_libraries(${PROJECT_NAME}
lib${PROJECT_NAME}
${Boost_LIBRARIES}
)

# tests
message(STATUS "Build gtest Testsuite")

enable_testing()
option(gtest_force_shared_crt "" ON)
mark_as_advanced(gtest_force_shared_crt gtest_build_tests gtest_build_samples gtest_disable_pthreads)

set(BUILD_GMOCK OFF)
set(INSTALL_GTEST OFF)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
message(STATUS "Download and configure the TIGL gtest Testsuite")
include(AddGoogleTest)
message(STATUS "Download and configure the TIGL gtest Testsuite - Success")

set(DATA_DIR ${CMAKE_SOURCE_DIR}/test/data)
configure_file(test/paths.h.in ${CMAKE_BINARY_DIR}/test/paths.h)

file(GLOB TEST_INPUTS test/*.cpp test/*.h)
list(APPEND TEST_INPUTS ${CMAKE_BINARY_DIR}/test/paths.h)
add_executable(tests ${TEST_INPUTS})
source_group(" " FILES ${TEST_INPUTS})

if(NOT Boost_USE_STATIC_LIBS)
target_compile_definitions(tests PUBLIC
-DBOOST_TEST_DYN_LINK
)
endif()

target_link_libraries(tests PRIVATE gtest gtest_main libCPACSGen)
target_include_directories(tests PUBLIC
${CMAKE_BINARY_DIR}/test
)

target_link_libraries(tests
lib${PROJECT_NAME}
${Boost_LIBRARIES}
)
add_test(NAME tests COMMAND tests)

# generate target
if(TIGL_PATH)
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ https://github.com/RISCSoftware/cpacs_tigl_gen
The following components are required to build and run CPACSGen
* A working copy of CPACSGen
* CMake
* C\++11/C++14 compliant compiler (VS2017 is currently used and tested)
* C\++17 compliant compiler (VS2017 is currently used and tested)
* TIXI library (https://github.com/DLR-SC/tixi)
* Boost libraries (v1.55 or higher)
* A working copy of TiGL with CPACSGen input files (https://github.com/DLR-SC/tigl)

## Input files
Expand All @@ -42,9 +41,8 @@ For each subdirectory, CPACSGen runs an additional pass, putting the generated f
1. Clone the CPACSGen repository from Github
2. Clone the TiGL repository Github
3. Use CMake to configure CPACSGen
1. Set BOOST_ROOT
2. Set TIXI_PATH
3. Set TIGL_PATH to the directory of your TiGL clone
1. Set TIXI_PATH, if the TiXI package is not already installed in the current conda environment
2. Set TIGL_PATH to the directory of your TiGL clone
4. Build CPACSGen
5. Build target generate
executes CPACSGen.exe $\{TIGL_DIR}/cpacs_gen_input $\{CPACSGEN_DIR}/src $\{TIGL_DIR}/src/generated
Expand Down Expand Up @@ -107,7 +105,3 @@ The classes generated by CPACSGen depend upon the following helper files, which
Wrappers over TIXI functions providing a C++ friendly interface (references, std::string, exceptions, ...).
Is used by the ReadCPACS and WriteCPACS implementation.

* UniquePtr.hpp
Contains tigl\::unique_ptr\<T> which defaults to std\::unique_ptr\<T> if C++11 is available, otherwise provides a custom type based on std\::auto_ptr\<T>.
Furthermore, the generated classes may require boost::optional\<T>, which is part of TiGL, and some internal TiGL files.

17 changes: 0 additions & 17 deletions appveyor.yml

This file was deleted.

69 changes: 69 additions & 0 deletions cmake/AddGoogleTest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
#
# Downloads GTest and provides a helper macro to add tests. Add make check, as well, which
# gives output on failed tests without having to set an environment variable.
#
#
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

include(FetchContent)
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.17.0)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE BOOL "")
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
unset(CMAKE_SUPPRESS_DEVELOPER_WARNINGS)
endif()


if(CMAKE_CONFIGURATION_TYPES)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
--force-new-ctest-process --output-on-failure
--build-config "$<CONFIGURATION>")
else()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
--force-new-ctest-process --output-on-failure)
endif()
set_target_properties(check PROPERTIES FOLDER "Scripts")

#include_directories(${gtest_SOURCE_DIR}/include)

# More modern way to do the last line, less messy but needs newish CMake:
# target_include_directories(gtest INTERFACE ${gtest_SOURCE_DIR}/include)


if(GOOGLE_TEST_INDIVIDUAL)
include(GoogleTest)
endif()

# Target must already exist
macro(add_gtest TESTNAME)
target_link_libraries(${TESTNAME} PUBLIC gtest gtest_main)

if(GOOGLE_TEST_INDIVIDUAL)
gtest_discover_tests(${TESTNAME}
TEST_PREFIX "${TESTNAME}."
PROPERTIES FOLDER "Tests")
else()
add_test(${TESTNAME} ${TESTNAME})
set_target_properties(${TESTNAME} PROPERTIES FOLDER "Tests")
endif()

endmacro()

mark_as_advanced(
gmock_build_tests
gtest_build_samples
gtest_build_tests
gtest_disable_pthreads
gtest_force_shared_crt
gtest_hide_internal_symbols
BUILD_GMOCK
BUILD_GTEST
)

set_target_properties(gtest gtest_main
PROPERTIES FOLDER "Extern")
5 changes: 2 additions & 3 deletions src/driver/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <boost/filesystem.hpp>
#include <filesystem>
#include <iostream>
#include <iomanip>

Expand All @@ -9,12 +9,11 @@
#include "../lib/Filesystem.h"
#include "../lib/NotImplementedException.h"

namespace fs = boost::filesystem;
namespace fs = std::filesystem;

namespace tigl {
const auto runtimeFiles = {
"TixiHelper.h",
"UniquePtr.h",
};

void processDirectory(const std::string& inputDirectory, const std::string& runtimeDirectory, const std::string& outputDirectory, const std::string& typeSystemGraphVisFile, Filesystem& fs, const std::string& ns = "") {
Expand Down
Loading
Loading