Search Nodes in system paths

This commit is contained in:
Rodrigo Arias 2023-05-19 10:04:00 +02:00
parent 49307a708a
commit 7139d903a8

View File

@ -1,14 +1,8 @@
include(GNUInstallDirs) include(GNUInstallDirs)
if(DEFINED ENV{NODES_HOME}) find_library(NODES_LIBRARY NAMES nodes)
set(NODES_HOME "$ENV{NODES_HOME}") find_path(NODES_INCLUDE_DIR nodes.h)
else() find_file(NODES_WRAPPER NAMES nodes-main-wrapper.o PATH_SUFFIXES "lib")
message(STATUS "NODES_HOME not set, refusing to search")
endif()
find_library(NODES_LIBRARY NAMES nodes PATHS "${NODES_HOME}/lib" NO_DEFAULT_PATH)
find_file(NODES_WRAPPER NAMES nodes-main-wrapper.o PATHS "${NODES_HOME}/lib" NO_DEFAULT_PATH)
find_path(NODES_INCLUDE_DIR nodes.h PATHS "${NODES_HOME}/include" NO_DEFAULT_PATH)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)