From 71630179cf9adc552b1d996313cc9e2458b6ed84 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Wed, 20 Mar 2024 16:26:01 +0000 Subject: [PATCH] [Add] files for compilation --- aidge_learning-config.cmake.in | 5 +++++ unit_tests/CMakeLists.txt | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 aidge_learning-config.cmake.in create mode 100644 unit_tests/CMakeLists.txt diff --git a/aidge_learning-config.cmake.in b/aidge_learning-config.cmake.in new file mode 100644 index 0000000..fbd5327 --- /dev/null +++ b/aidge_learning-config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include(${CMAKE_CURRENT_LIST_DIR}/aidge_learning-config-version.cmake) + +include(${CMAKE_CURRENT_LIST_DIR}/aidge_learning-targets.cmake) diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt new file mode 100644 index 0000000..9d9f815 --- /dev/null +++ b/unit_tests/CMakeLists.txt @@ -0,0 +1,22 @@ +Include(FetchContent) + +FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.0.1 # or a later release +) + +FetchContent_MakeAvailable(Catch2) + +file(GLOB_RECURSE src_files "*.cpp") + +add_executable(tests${module_name} ${src_files}) + +target_link_libraries(tests${module_name} PUBLIC ${module_name}) + +target_link_libraries(tests${module_name} PRIVATE Catch2::Catch2WithMain) + +list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) +include(CTest) +include(Catch) +catch_discover_tests(tests${module_name}) -- GitLab