From fd1282863e874345989064d44000c948f428d228 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 22 May 2023 18:52:46 +0200 Subject: [PATCH] Only search for Nanos6 and NODES in *_HOME vars --- cmake/FindNanos6.cmake | 12 +++++++++--- cmake/FindNodes.cmake | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cmake/FindNanos6.cmake b/cmake/FindNanos6.cmake index 67a82d9..c4673a0 100644 --- a/cmake/FindNanos6.cmake +++ b/cmake/FindNanos6.cmake @@ -1,8 +1,14 @@ include(GNUInstallDirs) -find_library(NANOS6_LIBRARY NAMES nanos6) -find_path(NANOS6_INCLUDE_DIR nanos6.h) -find_file(NANOS6_WRAPPER NAMES nanos6-main-wrapper.o PATH_SUFFIXES "lib") +if(DEFINED ENV{NANOS6_HOME}) + set(NANOS6_HOME "$ENV{NANOS6_HOME}") +else() + message(STATUS "NANOS6_HOME not set, refusing to search") +endif() + +find_library(NANOS6_LIBRARY NAMES nanos6 PATHS "${NANOS6_HOME}/lib" NO_DEFAULT_PATH) +find_path(NANOS6_INCLUDE_DIR nanos6.h PATHS "${NANOS6_HOME}/include" NO_DEFAULT_PATH) +find_file(NANOS6_WRAPPER NAMES nanos6-main-wrapper.o PATHS "${NANOS6_HOME}/lib" NO_DEFAULT_PATH) include(FindPackageHandleStandardArgs) diff --git a/cmake/FindNodes.cmake b/cmake/FindNodes.cmake index 1b16407..49ba1aa 100644 --- a/cmake/FindNodes.cmake +++ b/cmake/FindNodes.cmake @@ -1,8 +1,14 @@ include(GNUInstallDirs) -find_library(NODES_LIBRARY NAMES nodes) -find_path(NODES_INCLUDE_DIR nodes.h) -find_file(NODES_WRAPPER NAMES nodes-main-wrapper.o PATH_SUFFIXES "lib") +if(DEFINED ENV{NODES_HOME}) + set(NODES_HOME "$ENV{NODES_HOME}") +else() + message(STATUS "NODES_HOME not set, refusing to search") +endif() + +find_library(NODES_LIBRARY NAMES nanos6 PATHS "${NODES_HOME}/lib" NO_DEFAULT_PATH) +find_file(NODES_WRAPPER NAMES nanos6-main-wrapper.o PATHS "${NODES_HOME}/lib" NO_DEFAULT_PATH) +find_path(NODES_INCLUDE_DIR nanos6.h PATHS "${NODES_HOME}/include" NO_DEFAULT_PATH) include(FindPackageHandleStandardArgs)