Skip to content
Snippets Groups Projects
Commit 43baa247 authored by kongr45gpen's avatar kongr45gpen
Browse files

Better organisation of CMake project

parent b55a38d9
No related branches found
No related tags found
No related merge requests found
...@@ -13,15 +13,25 @@ add_custom_target(check ...@@ -13,15 +13,25 @@ add_custom_target(check
COMMAND ./clang-tidy.sh COMMAND ./clang-tidy.sh
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/ci") WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/ci")
# Specify the .cpp files common across all targets
add_library(common OBJECT
src/Message.cpp
src/Services/RequestVerificationService.cpp
src/Services/TestService.cpp)
# Specify the .cpp files for the executables # Specify the .cpp files for the executables
add_executable(ecss_services src/main.cpp src/Message.cpp src/Service.cpp add_executable(ecss_services
src/Services/TestService.cpp src/Services/RequestVerificationService.cpp) src/main.cpp
$<TARGET_OBJECTS:common>
src/Platform/x86/Service.cpp)
IF (EXISTS "${PROJECT_SOURCE_DIR}/lib/Catch2/CMakeLists.txt") IF (EXISTS "${PROJECT_SOURCE_DIR}/lib/Catch2/CMakeLists.txt")
# Gather all the .cpp files corresponding to tests
file(GLOB test_SRC "test/**/*.cpp")
add_subdirectory(lib/Catch2) add_subdirectory(lib/Catch2)
add_executable(tests src/Message.cpp src/Services/TestService.cpp add_executable(tests
src/Services/RequestVerificationService.cpp test/tests.cpp $<TARGET_OBJECTS:common>
test/Message.cpp test/TestPlatform.cpp test/Services/TestService.cpp ${test_SRC})
test/Services/RequestVerificationService.cpp)
target_link_libraries(tests Catch2::Catch2) target_link_libraries(tests Catch2::Catch2)
ENDIF () ENDIF ()
This folder contains platform-specific files:
- **x86**: Files to be run on a PC with a proper operating system
\ No newline at end of file
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment