[QGIS Commit] r15278 - trunk/qgis/cmake

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Feb 27 14:38:25 EST 2011


Author: jef
Date: 2011-02-27 11:38:25 -0800 (Sun, 27 Feb 2011)
New Revision: 15278

Modified:
   trunk/qgis/cmake/FindQGIS.cmake
Log:
FindQGIS.cmake cleanup

Modified: trunk/qgis/cmake/FindQGIS.cmake
===================================================================
--- trunk/qgis/cmake/FindQGIS.cmake	2011-02-27 19:35:54 UTC (rev 15277)
+++ trunk/qgis/cmake/FindQGIS.cmake	2011-02-27 19:38:25 UTC (rev 15278)
@@ -11,44 +11,64 @@
 
 #MESSAGE("Searching for QGIS")
 IF(WIN32)
-  #MESSAGE("Searching for QGIS in C:/program files/Quantum GIS")
+  #MESSAGE("Searching for QGIS in $ENV{PROGRAMFILES}/Quantum GIS")
   IF (MINGW)
-  FIND_PATH(QGIS_PLUGIN_DIR libnortharrowplugin.dll 
-	  "C:/Program Files/Quantum GIS/plugins" 
-	  )
-  FIND_PATH(QGIS_INCLUDE_DIR qgsapplication.h 
-	  "C:/Program Files/Quantum GIS/include" 
-	  )
-  FIND_LIBRARY(QGIS_CORE_LIBRARY NAMES qgis_core PATHS 
-	  "C:/Program Files/Quantum GIS/" 
-	  )
-  FIND_LIBRARY(QGIS_GUI_LIBRARY NAMES qgis_gui PATHS 
-	  "C:/Program Files/Quantum GIS/" 
-	  )
+    FIND_PATH(QGIS_PLUGIN_DIR
+      NAMES libnortharrowplugin.dll
+      PATHS
+        "$ENV{PROGRAMFILES}/Quantum GIS/plugins"
+    )
+    FIND_PATH(QGIS_INCLUDE_DIR
+      NAMES qgsapplication.h 
+      PATHS
+        "$ENV{PROGRAMFILES}/Quantum GIS/include" 
+    )
+    FIND_LIBRARY(QGIS_CORE_LIBRARY
+      NAMES qgis_core
+      PATHS
+        "$ENV{PROGRAMFILES}/Quantum GIS/"
+    )
+    FIND_LIBRARY(QGIS_GUI_LIBRARY
+      NAMES qgis_gui
+      PATHS
+        "$ENV{PROGRAMFILES}/Quantum GIS/"
+    )
   ENDIF (MINGW)
 
   IF (MSVC)
-  FIND_PATH(QGIS_PLUGIN_DIR libnortharrowplugin.dll 
-    "C:/OSGeo4W/app/qgis/plugins"
-	  "C:/Program Files/Quantum GIS/lib/qgis" 
-	  )
-  FIND_PATH(QGIS_INCLUDE_DIR qgsapplication.h 
-    "C:/OSGeo4W/include"
-	  "$ENV{LIB_DIR}/include/qgis" 
-	  )
-  FIND_LIBRARY(QGIS_CORE_LIBRARY NAMES qgis_core PATHS 
-    "C:/OSGeo4W/lib"
-	  "$ENV{LIB_DIR}/lib/" 
-	  )
-  FIND_LIBRARY(QGIS_GUI_LIBRARY NAMES qgis_gui PATHS 
-    "C:/OSGeo4W/lib"
-	  "$ENV{LIB_DIR}/lib/" 
-	  )
+    FIND_PATH(QGIS_PLUGIN_DIR
+      NAMES northarrowplugin.dll
+      PATHS
+        "$ENV{OSGEO4W_ROOT}/apps/qgis/plugins"
+        "$ENV{PROGRAMFILES}/Quantum GIS/plugins"
+    )
+    FIND_PATH(QGIS_INCLUDE_DIR 
+      NAMES qgsapplication.h 
+      PATHS
+        "$ENV{INCLUDE}" 
+        "$ENV{LIB_DIR}/include/qgis" 
+        "$ENV{OSGEO4W_ROOT}/include"
+        "$ENV{PROGRAMFILES}/Quantum GIS/include"
+    )
+    FIND_LIBRARY(QGIS_CORE_LIBRARY
+      NAMES qgis_core
+      PATHS 
+        "$ENV{LIB_DIR}/lib/" 
+        "$ENV{LIB}" 
+        "$ENV{OSGEO4W_ROOT}/lib"
+        "$ENV{PROGRAMFILES}/Quantum GIS/lib"
+    )
+    FIND_LIBRARY(QGIS_GUI_LIBRARY
+      NAMES qgis_gui
+      PATHS 
+        "$ENV{LIB_DIR}" 
+        "$ENV{LIB}" 
+        "$ENV{OSGEO4W_ROOT}/lib"
+        "$ENV{PROGRAMFILES}/Quantum GIS/lib"
+    )
   ENDIF (MSVC)
-
 ELSE(WIN32)
   IF(UNIX) 
-
     # try to use bundle on mac
     IF (APPLE)
       #MESSAGE("Searching for QGIS in /Applications/QGIS.app/Contents/MacOS")
@@ -63,44 +83,51 @@
       SET(QGIS_GUI_LIBRARY ${QGIS_LIB_DIR}/libqgis_gui.dylib CACHE STRING INTERNAL)
     ELSE (APPLE)
       #MESSAGE("Searching for QGIS in /usr/bin; /usr/local/bin")
-      FIND_PATH(QGIS_PLUGIN_DIR libnortharrowplugin.so
-        /usr/lib64/qgis/plugins
-      	/usr/lib/qgis
-        /usr/local/lib/qgis/plugins
-	      "$ENV{LIB_DIR}/lib/qgis/plugins" 
-	      "$ENV{LIB_DIR}/lib/qgis" 
+      FIND_PATH(QGIS_PLUGIN_DIR
+        NAMES libnortharrowplugin.so
+        PATHS
+          /usr/lib64/qgis/plugins
+          /usr/lib/qgis
+          /usr/local/lib/qgis/plugins
+          "$ENV{LIB_DIR}/lib/qgis/plugins" 
+          "$ENV{LIB_DIR}/lib/qgis" 
       )
-      FIND_PATH(QGIS_INCLUDE_DIR qgis.h 
-       /usr/include/qgis
-       /usr/local/include/qgis
-	     "$ENV{LIB_DIR}/include/qgis" 
-       )
-      FIND_LIBRARY(QGIS_CORE_LIBRARY NAMES qgis_core PATHS 
-       /usr/lib64
-       /usr/lib
-       /usr/local/lib
-	     "$ENV{LIB_DIR}/lib/" 
-       )
-       FIND_LIBRARY(QGIS_GUI_LIBRARY NAMES qgis_gui PATHS 
-       /usr/lib64
-       /usr/lib
-       /usr/local/lib
-	     "$ENV{LIB_DIR}/lib/" 
-       )
+      FIND_PATH(QGIS_INCLUDE_DIR
+        NAMES qgis.h 
+        PATHS
+          /usr/include/qgis
+          /usr/local/include/qgis
+          "$ENV{LIB_DIR}/include/qgis" 
+      )
+      FIND_LIBRARY(QGIS_CORE_LIBRARY
+        NAMES qgis_core
+        PATHS 
+          /usr/lib64
+          /usr/lib
+          /usr/local/lib
+          "$ENV{LIB_DIR}/lib/" 
+      )
+      FIND_LIBRARY(QGIS_GUI_LIBRARY
+        NAMES qgis_gui
+        PATHS 
+          /usr/lib64
+          /usr/lib
+          /usr/local/lib
+          "$ENV{LIB_DIR}/lib/" 
+      )
     ENDIF (APPLE)
   ENDIF(UNIX)
 ENDIF(WIN32)
 
-
 IF (QGIS_INCLUDE_DIR AND QGIS_CORE_LIBRARY AND QGIS_GUI_LIBRARY)
    SET(QGIS_FOUND TRUE)
 ENDIF (QGIS_INCLUDE_DIR AND QGIS_CORE_LIBRARY AND QGIS_GUI_LIBRARY)
 
 IF (QGIS_FOUND)
    IF (NOT QGIS_FIND_QUIETLY)
-     MESSAGE(STATUS "Found QGIS Core: ${QGIS_CORE_LIBRARY}")
-     MESSAGE(STATUS "Found QGIS Gui: ${QGIS_GUI_LIBRARY}")
-     MESSAGE(STATUS "Found QGIS Plugins Dir: ${QGIS_PLUGIN_DIR}")
+     MESSAGE(STATUS "Found QGIS core: ${QGIS_CORE_LIBRARY}")
+     MESSAGE(STATUS "Found QGIS gui: ${QGIS_GUI_LIBRARY}")
+     MESSAGE(STATUS "Found QGIS plugins directory: ${QGIS_PLUGIN_DIR}")
    ENDIF (NOT QGIS_FIND_QUIETLY)
 ELSE (QGIS_FOUND)
    IF (QGIS_FIND_REQUIRED)



More information about the QGIS-commit mailing list