From 4ec0d3c5cb67e0b331cf06d2de6f3bb640fa0c13 Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 16 Dec 2025 14:38:57 +0100 Subject: [PATCH] Switched to find_package --- CMakeLists.txt | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f2a8c5..077aa3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,9 @@ option( OFF ) +set(CMAKE_PREFIX_PATH "$ENV{MIDASSYS}") +find_package(Midas REQUIRED) + set( DRIVERS $ENV{MIDASSYS}/drivers/bus/null.cxx @@ -31,8 +34,9 @@ set(SYS_LIBS ) set(MIDAS_LIBS - midas - mscb + midas::mfe + midas::midas + midas::mscb ) set(LIBS ${SYS_LIBS} ${MIDAS_LIBS}) @@ -58,18 +62,6 @@ target_include_directories( hvr401 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE - $ENV{MIDASSYS}/drivers - $ENV{MIDASSYS}/include - # This is redundant if MIDASSYS =/ Midas repo, but needed if MIDAS has been - # installed in the repo directory, since the CMake file of MIDAS doesn't - # copy the headers into $ENV{MIDASSYS}/include in the latter case. - $ENV{MIDASSYS}/include/mscb -) - -target_link_directories( - hvr401 - PUBLIC $ENV{MIDASSYS}/lib ) target_link_libraries( @@ -100,18 +92,11 @@ if(${BUILD_FRONTEND}) hvr401_fe PRIVATE $ENV{MIDASSYS}/drivers - $ENV{MIDASSYS}/include - ) - - target_link_directories( - hvr401_fe - PUBLIC $ENV{MIDASSYS}/lib ) target_link_libraries( hvr401_fe hvr401 - mfe ) endif()