* CMakeLists.txt: Using PREFIX as a global variable turns out not to be
   a good idea; CMake generates a bunch of warnings because its internals
   use PREFIX for compiler feature checks, etc.


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1834407 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56bdd6e..30f6307 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,7 +30,6 @@
 
 
 # Build options
-option(PREFIX "Installation root directory" OFF)
 option(LIBDIR "Indstall directory for architecture-dependent libraries" OFF)
 option(APR "Path to APR's install area" OFF)
 option(APU "Path to APR-Util's install area" OFF)
@@ -184,16 +183,8 @@
 endif()
 
 # Process other build options
-if(PREFIX)
-  set(CMAKE_INSTALL_PREFIX ${PREFIX})
-else()
-  set(PREFIX ${CMAKE_INSTALL_PREFIX})
-endif()
-
 if(LIBDIR)
   message(WARNING "option LIBDIR is not implemented yet")
-else()
-  set(LIBDIR "${PREFIX}/lib")
 endif()
 
 if(DEBUG)
@@ -245,6 +236,10 @@
 if(NOT WINDOWS)
   # Use a separate variable scope for the substitutions in serf.pc.in.
   function(make_pkgconfig)
+    set(PREFIX ${CMAKE_INSTALL_PREFIX})
+    if(NOT LIBDIR)
+      set(LIBDIR "${PREIFX}/lib")
+    endif()
     set(VERSION ${SERF_VERSION})
     set(MAJOR ${SERF_MAJOR_VERSION})
     set(INCLUDE_SUBDIR "serf-${SERF_MAJOR_VERSION}")