changeset 12642:479b96e84e98

Set the NUMA include and library directories. Make sure that check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2) finds the numa.h file and libnuma in case NUMA is installed into a non-standard directory. If find_package(Numa) found the library, the header and library directories are stored in the NUMA_INCLUDE_DIR and NUMA_LIBRARY_DIR CMake variables. Fixes Issue #540.
author Szabolcs Andrasi <andrasi.szabolcs@gmail.com>
date Wed, 01 Apr 2020 19:49:11 -0700
parents 1d2f556ffb12
children 6bb2d88029c2
files source/CMakeLists.txt
diffstat 1 files changed, 2 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- a/source/CMakeLists.txt	Tue Mar 31 16:43:30 2020 +0530
+++ b/source/CMakeLists.txt	Wed Apr 01 19:49:11 2020 -0700
@@ -101,6 +101,8 @@ if(UNIX)
         if(NUMA_FOUND)
             link_directories(${NUMA_LIBRARY_DIR})
             list(APPEND CMAKE_REQUIRED_LIBRARIES numa)
+            list(APPEND CMAKE_REQUIRED_INCLUDES ${NUMA_INCLUDE_DIR})
+            list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-L${NUMA_LIBRARY_DIR}")
             check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2)
             if(NUMA_V2)
                 add_definitions(-DHAVE_LIBNUMA)