diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bc747f904..bf7a793910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,11 +294,15 @@ if ( NOT BIFCL_EXE_PATH ) add_subdirectory(auxil/bifcl) endif () -if (ENABLE_JEMALLOC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - find_package(JeMalloc) +if (ENABLE_JEMALLOC) + if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(JEMALLOC_FOUND true) + else () + find_package(JeMalloc) - if (NOT JEMALLOC_FOUND) - message(FATAL_ERROR "Could not find requested JeMalloc") + if (NOT JEMALLOC_FOUND) + message(FATAL_ERROR "Could not find requested JeMalloc") + endif() endif() endif ()