find_package(PkgConfig QUIET)
pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
+if (PC_JEMALLOC_INCLUDE_DIRS)
+ find_path(JEMALLOC_INCLUDE_DIR
+ NAMES jemalloc/jemalloc.h
+ HINTS ${PC_JEMALLOC_INCLUDE_DIRS}
+ NO_DEFAULT_PATH
+ )
+endif()
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
- HINTS ${PC_JEMALLOC_INCLUDE_DIRS}
)
if ( STATIC_JEMALLOC )
- find_library(JEMALLOC_LIBRARY
- NAMES libjemalloc.a jemalloc
- HINTS ${PC_JEMALLOC_LIBRARY_DIRS}
-)
+ if (PC_JEMALLOC_LIBRARY_DIRS)
+ find_library(JEMALLOC_LIBRARY
+ NAMES libjemalloc.a jemalloc
+ HINTS ${PC_JEMALLOC_LIBRARY_DIRS}
+ NO_DEFAULT_PATH
+ )
+ endif()
+ find_library(JEMALLOC_LIBRARY
+ NAMES libjemalloc.a jemalloc
+ )
+
else()
+ if (PC_JEMALLOC_LIBRARY_DIRS)
+ find_library(JEMALLOC_LIBRARY
+ NAMES jemalloc
+ HINTS ${PC_JEMALLOC_LIBRARY_DIRS}
+ NO_DEFAULT_PATH
+ )
+ endif()
find_library(JEMALLOC_LIBRARY
NAMES jemalloc
- HINTS ${PC_JEMALLOC_LIBRARY_DIRS}
-)
+ )
endif()
if(JEMALLOC_INCLUDE_DIR)
--with-dnet-libraries=*)
append_cache_entry DNET_LIBRARIES_DIR_HINT PATH $optarg
;;
+ --with-jemalloc-includes=*)
+ append_cache_entry PC_JEMALLOC_INCLUDE_DIRS PATH $optarg
+ ;;
+ --with-jemalloc-libraries=*)
+ append_cache_entry PC_JEMALLOC_LIBRARY_DIRS PATH $optarg
+ ;;
--with-daq-includes=*)
append_cache_entry DAQ_INCLUDE_DIR_HINT PATH $optarg
;;