Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit cd4211b

Browse files
Merge pull request #38 from umr-dbs/test-fix
Test Fix
2 parents 695cd2d + 4db91a6 commit cd4211b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project(mapping_core
55

66
# CMake Settings
77
cmake_minimum_required(VERSION 3.7)
8+
cmake_policy(SET CMP0079 NEW)
89
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
910

1011
## Debug
@@ -47,8 +48,15 @@ download_project(PROJ cpptoml
4748
)
4849
add_subdirectory(${cpptoml_SOURCE_DIR} ${cpptoml_BINARY_DIR} EXCLUDE_FROM_ALL)
4950

51+
# Modules
52+
set(MAPPING_CORE_PATH ${CMAKE_SOURCE_DIR} CACHE PATH "This is the mapping-core directory." FORCE)
53+
foreach (mapping_module IN ITEMS ${MAPPING_MODULES})
54+
message(STATUS "Loading Module `${mapping_module}`")
55+
add_subdirectory(${MAPPING_MODULE_PATH}/${mapping_module} target/modules/${mapping_module})
56+
endforeach (mapping_module)
57+
5058
add_subdirectory(src)
5159

5260
include(CTest)
5361
enable_testing()
54-
add_subdirectory(test)
62+
add_subdirectory(test)

src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,6 @@ find_package(Fcgi++ REQUIRED)
290290
target_link_libraries(mapping_core_services_lib ${Fcgi++_LIBRARIES})
291291
target_include_directories(mapping_core_services_lib PRIVATE ${Fcgi++_INCLUDE_DIRS})
292292

293-
# Modules
294-
set(MAPPING_CORE_PATH ${CMAKE_SOURCE_DIR} CACHE PATH "This is the mapping-core directory." FORCE)
295-
foreach (mapping_module IN ITEMS ${MAPPING_MODULES})
296-
message(STATUS "Loading Module `${mapping_module}`")
297-
add_subdirectory(../${MAPPING_MODULE_PATH}/${mapping_module} target/modules/${mapping_module})
298-
endforeach (mapping_module)
299293
## Base
300294
foreach (mapping_core_addition IN ITEMS ${MAPPING_ADD_TO_BASE_OBJECTS})
301295
message(STATUS "Adding ${mapping_core_addition} to base.")

test/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
5757
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
5858
target_link_libraries(mapping_core_unittests_lib gtest)
5959

60+
61+
foreach (mapping_test_addition IN ITEMS ${MAPPING_ADD_TO_UNITTESTS_LIBRARIES_INTERNAL})
62+
message(STATUS "Adding ${mapping_test_addition} to tests.")
63+
# Provide dependencies to foreign test library
64+
target_link_libraries_internal(${mapping_test_addition} mapping_core_unittests_lib)
65+
# Append foregin tests to unit tests
66+
target_link_libraries_internal(mapping_unittests ${mapping_test_addition})
67+
endforeach(mapping_test_addition)
68+
6069
# Define the build of the test executables as one of the tests s.t. they are built on `make test`
6170
# TODO: use multiple threads for building
6271
add_test(NAME build_mapping_unittests COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR}

0 commit comments

Comments
 (0)