Only search for Nanos6 and NODES in *_HOME vars

This commit is contained in:
Rodrigo Arias 2023-05-22 18:52:46 +02:00
parent dd04c180a7
commit fd1282863e
2 changed files with 18 additions and 6 deletions

View File

@ -1,8 +1,14 @@
include(GNUInstallDirs) include(GNUInstallDirs)
find_library(NANOS6_LIBRARY NAMES nanos6) if(DEFINED ENV{NANOS6_HOME})
find_path(NANOS6_INCLUDE_DIR nanos6.h) set(NANOS6_HOME "$ENV{NANOS6_HOME}")
find_file(NANOS6_WRAPPER NAMES nanos6-main-wrapper.o PATH_SUFFIXES "lib") 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) include(FindPackageHandleStandardArgs)

View File

@ -1,8 +1,14 @@
include(GNUInstallDirs) include(GNUInstallDirs)
find_library(NODES_LIBRARY NAMES nodes) if(DEFINED ENV{NODES_HOME})
find_path(NODES_INCLUDE_DIR nodes.h) set(NODES_HOME "$ENV{NODES_HOME}")
find_file(NODES_WRAPPER NAMES nodes-main-wrapper.o PATH_SUFFIXES "lib") 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) include(FindPackageHandleStandardArgs)