fixed and simplified install prefix handling with cmake
authorRomain Pokrzywka <romain@kdab.com>
Tue, 2 Feb 2010 23:12:30 +0000 (15:12 -0800)
committerRalf Habacker <ralf.habacker@freenet.de>
Sat, 6 Feb 2010 23:32:41 +0000 (00:32 +0100)
cmake/CMakeLists.txt

index 5b6c294..425f648 100644 (file)
@@ -200,14 +200,17 @@ ENABLE_TESTING()
 ########### basic vars ###############
 
 if (DBUSDIR)
-       set(DBUS_INSTALL_DIR "${DBUSDIR}" CACHE TYPE STRING)
-else (DBUSDIR)
-       set(DBUS_INSTALL_DIR "$ENV{DBUSDIR}" CACHE TYPE STRING)
+       set(DBUS_INSTALL_DIR "${DBUSDIR}")
 endif (DBUSDIR)
-
-if (NOT DBUS_INSTALL_DIR)
-       set(DBUS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE TYPE STRING)
-endif (NOT DBUS_INSTALL_DIR)
+if ($ENV{DBUSDIR})
+       set(DBUS_INSTALL_DIR "$ENV{DBUSDIR}")
+endif ($ENV{DBUSDIR})
+
+if (DBUS_INSTALL_DIR)
+       set(CMAKE_INSTALL_PREFIX "${DBUS_INSTALL_DIR}" CACHE TYPE PATH FORCE)
+else (DBUS_INSTALL_DIR)
+       set(DBUS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
+endif (DBUS_INSTALL_DIR)
 
 # TODO: setting EXPANDED_... has nothing to do with DBUS_INSTALL_SYSTEM_LIBS
 if (DBUS_INSTALL_SYSTEM_LIBS)