From 48c294105f5123dc876fbad199ec1e0166d82a18 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 23 Dec 2025 11:59:45 +0100 Subject: build: Refactor CMake modules This moves the CMake build logic out of the source tree and splits it up into a more modular form. The tests now have a CMakeLists.txt file in their respective source directory. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- cmake/dependencies/systemlibraries.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cmake/dependencies/systemlibraries.cmake (limited to 'cmake/dependencies/systemlibraries.cmake') diff --git a/cmake/dependencies/systemlibraries.cmake b/cmake/dependencies/systemlibraries.cmake new file mode 100644 index 00000000..e00266d6 --- /dev/null +++ b/cmake/dependencies/systemlibraries.cmake @@ -0,0 +1,20 @@ +if (NOT APPLE) + find_library(LIBRT_LIBRARIES rt) + if (NOT LIBRT_LIBRARIES) + message(FATAL_ERROR "Could not find librt") + endif () +else () + set(LIBRT_LIBRARIES "") +endif () + +find_library(LIBPTHREAD_LIBRARIES pthread) +if (NOT LIBPTHREAD_LIBRARIES) + message(FATAL_ERROR "Could not find libpthread") +endif () + +find_library(LIBM_LIBRARIES m) +if (NOT LIBM_LIBRARIES) + message(FATAL_ERROR "Could not find libm") +endif () + +mark_as_advanced(LIBRT_LIBRARIES LIBPTHREAD_LIBRARIES LIBM_LIBRARIES) -- cgit v1.2.3