From 4103e5c2354cadcc79c853de9b30187dd7b5da45 Mon Sep 17 00:00:00 2001 From: Dave B Date: Thu, 17 May 2018 12:55:17 -0400 Subject: [PATCH] Honor the -DCMAKE_INSTALL_PREFIX directive --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b0caf141..548b74ccd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,9 +189,17 @@ endif(NOT ${OPENMP_FOUND}) #------------------------------------------------------------------------------- # default installation prefix #------------------------------------------------------------------------------- -set(INSTALL_PREFIX /usr/local CACHE PATH "Installation prefix") -set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE INTERNAL "Installation prefix" FORCE) -set(DEFAULT_LIBRARIES dl pthread) +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation prefix") +endif() +if(NOT DEFINED INSTALL_PREFIX) + set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE INTERNAL "Installation prefix" FORCE) +endif() +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES pthread) +else(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(DEFAULT_LIBRARIES dl pthread) +endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") #------------------------------------------------------------------------------- # LIBCurl support