Skip to content

Commit c953d43

Browse files
committedFeb 25, 2024
fix: Add lbt folder to includes and adapt files to not use relative includes, fix bug with initialization of testing fixtures
1 parent 6995102 commit c953d43

File tree

161 files changed

+409
-415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+409
-415
lines changed
 

‎CMakeLists.txt

+13-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ else()
1616
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
1717
endif()
1818

19-
# Set compilation flags
2019
set(CMAKE_BUILD_TYPE Release)
2120
set(CMAKE_CXX_STANDARD 17) # The vast majority of code is written for C++17 but certain tests require C++20
2221
set(CMAKE_CXX_STANDARD_REQUIRED True)
@@ -46,24 +45,26 @@ else()
4645
message(WARNING "OpenMP not found: Multi-threading disabled!")
4746
endif()
4847

49-
include_directories(
50-
include
51-
)
52-
53-
# Add executable
5448
add_library(lbt_obj OBJECT
5549
src/general/disclaimer.cpp
5650
src/general/openmp_manager.cpp
5751
src/general/timer.cpp
5852
src/general/vtk_utilities.cpp
5953
src/geometry/vtk_import.cpp
6054
)
55+
target_include_directories(lbt_obj PUBLIC
56+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
57+
$<INSTALL_INTERFACE:include>
58+
)
59+
6160
add_executable(lbt
6261
$<TARGET_OBJECTS:lbt_obj>
6362
src/main.cpp
6463
)
65-
66-
# Link executable to libraries
64+
target_include_directories(lbt PUBLIC
65+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
66+
$<INSTALL_INTERFACE:include>
67+
)
6768
set(LBT_LIBRARIES ${VTK_LIBRARIES} nlohmann_json::nlohmann_json)
6869
if(OpenMP_CXX_FOUND)
6970
set(LBT_LIBRARIES ${LBT_LIBRARIES} OpenMP::OpenMP_CXX)
@@ -79,7 +80,6 @@ include(GoogleTest)
7980
if (NOT GTest_FOUND)
8081
set(LBT_TEST_LIBRARIES ${LBT_LIBRARIES} gtest pthread)
8182

82-
# Add executable
8383
add_library(lbt_test_obj OBJECT
8484
test/constexpr_math/constexpr_math_test.cpp
8585
test/continuum/simple_continuum_test.cpp
@@ -109,6 +109,10 @@ if (NOT GTest_FOUND)
109109
test/converter_test.cpp
110110
test/simulation_test.cpp
111111
)
112+
target_include_directories(lbt_test_obj PUBLIC
113+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
114+
$<INSTALL_INTERFACE:include>
115+
)
112116
add_executable(run_lbt_tests
113117
$<TARGET_OBJECTS:lbt_obj>
114118
$<TARGET_OBJECTS:lbt_test_obj>
@@ -123,7 +127,6 @@ if (NOT GTest_FOUND)
123127
)
124128
set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
125129

126-
# Link executable to libraries
127130
target_link_libraries(lbt_test_obj ${LBT_TEST_LIBRARIES})
128131
target_link_libraries(run_lbt_tests ${LBT_TEST_LIBRARIES})
129132
else()

‎include/constexpr_math/constexpr_math.hpp

-23
This file was deleted.

0 commit comments

Comments
 (0)