From 0bda084076179fe2e3eeee8f20282a107dc9bd18 Mon Sep 17 00:00:00 2001 From: Christian von Elm Date: Tue, 26 Sep 2023 15:46:29 +0200 Subject: [PATCH] Adjust CMake --- CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5926beaf..4aabb1fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,6 +242,19 @@ if(x86_energy_FOUND) endif() add_feature_info("x86_energy" x86_energy_FOUND "Provide additional power measurements using x86_energy") +# handle radare dependency +if (USE_RADARE) + if (Radare_FOUND) + target_compile_definitions(lo2s PUBLIC HAVE_RADARE) + target_link_libraries(lo2s PRIVATE PkgConfig::Radare) + target_sources(lo2s PRIVATE + src/radare.cpp + ) + else() + message(SEND_ERROR "Radare2 not found but requested.") + endif() +endif() + if (USE_SENSORS) if (Sensors_FOUND) target_compile_definitions(lo2s PUBLIC HAVE_SENSORS) @@ -263,19 +276,6 @@ if (USE_LIBAUDIT) endif() endif() -if (USE_RADARE) - if (Radare_FOUND) - target_compile_definitions(lo2s PUBLIC HAVE_RADARE) - target_link_libraries(lo2s PRIVATE PkgConfig::Radare) - target_sources(lo2s PRIVATE - src/radare.cpp - ) - target_include_directories(lo2s PRIVATE ${Radare_INCLUDE_DIRS}) - #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Radare_CFLAGS}") - else() - message(SEND_ERROR "Radare2 not found but requested.") - endif() -endif() # generate version string used in lo2s if(Git_FOUND)