Skip to content

Commit 46a2d12

Browse files
author
wonder
committed
Merged refactoring branch back to trunk.
git-svn-id: http://svn.osgeo.org/qgis/trunk@6415 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent faf7b0a commit 46a2d12

File tree

632 files changed

+36076
-15940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

632 files changed

+36076
-15940
lines changed

.cvsignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
ID
12
autogen.sh
23
Makefile
34
Makefile.in
5+
Makefile.win.rules
46
aclocal.m4
57
compile
68
config.guess
@@ -14,3 +16,11 @@ qgis.spec
1416
qgsconfig.h
1517
qgsconfig.h.in
1618
stamp-h1
19+
*.pcs
20+
*.kdevses
21+
*.loT
22+
*.in
23+
*.swp
24+
*~
25+
.deps
26+
.libs

CMakeLists.txt

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
2+
PROJECT(qgis)
3+
4+
# TODO:
5+
# - install includes for libs
6+
# - nice output when configured
7+
# - rename *.ui files to have the same filename as their implementation
8+
# e.g. instead of blahblahbase.ui use blahblah.ui
9+
# because it's more common in Qt4
10+
11+
#############################################################
12+
# CMake settings
13+
14+
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3)
15+
16+
SET(CMAKE_COLOR_MAKEFILE ON)
17+
18+
# set path to additional CMake modules
19+
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
20+
21+
# it's possible to set PLUGINS_ALSO_BINARIES to TRUE
22+
# then some plugins that can run as standalone apps will be built
23+
# also as standalone apps
24+
SET (PLUGINS_ALSO_BINARIES FALSE)
25+
26+
27+
#############################################################
28+
# check if lexer and parser are not missing
29+
# http://www.mail-archive.com/cmake@cmake.org/msg02861.html
30+
31+
INCLUDE(Flex)
32+
33+
FIND_FLEX()
34+
35+
IF (NOT FLEX_EXECUTABLE)
36+
MESSAGE(FATAL_ERROR "Couldn't find Flex")
37+
ENDIF (NOT FLEX_EXECUTABLE)
38+
39+
INCLUDE(Bison)
40+
41+
FIND_BISON()
42+
43+
IF (NOT BISON_EXECUTABLE)
44+
MESSAGE(FATAL_ERROR "Couldn't find Bison")
45+
ENDIF (NOT BISON_EXECUTABLE)
46+
47+
#############################################################
48+
# search for dependencies
49+
50+
# required
51+
FIND_PACKAGE(Proj)
52+
FIND_PACKAGE(Sqlite3)
53+
FIND_PACKAGE(GEOS)
54+
FIND_PACKAGE(GDAL)
55+
56+
# optional
57+
FIND_PACKAGE(Postgres) # PostgreSQL provider, SPIT plugin
58+
FIND_PACKAGE(Expat) # GPS importer plugin
59+
FIND_PACKAGE(GSL) # Georeferencer
60+
FIND_PACKAGE(GRASS) # GRASS plugin
61+
FIND_PACKAGE(PythonLibs) # MapServer export tool
62+
FIND_PACKAGE(PythonInterp) # test for sip and PyQt4
63+
64+
IF (NOT PROJ_FOUND OR NOT SQLITE3_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
65+
MESSAGE (SEND_ERROR "Some dependencies were not found!")
66+
ENDIF (NOT PROJ_FOUND OR NOT SQLITE3_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
67+
68+
IF (POSTGRES_FOUND)
69+
# following variable is used in qgsconfig.h
70+
SET (HAVE_POSTGRESQL TRUE)
71+
ENDIF (POSTGRES_FOUND)
72+
73+
74+
#############################################################
75+
# python support
76+
77+
MACRO (TRY_RUN_PYTHON RESULT CMD)
78+
IF (PYTHONINTERP_FOUND)
79+
80+
EXEC_PROGRAM(${PYTHON_EXECUTABLE} ARGS -c "\"${CMD}\""
81+
OUTPUT_VARIABLE out
82+
RETURN_VALUE retval)
83+
IF (retval EQUAL 0)
84+
SET (${RESULT} TRUE)
85+
ELSE (retval EQUAL 0)
86+
SET (${RESULT} FALSE)
87+
ENDIF (retval EQUAL 0)
88+
89+
ELSE (PYTHONINTERP_FOUND)
90+
SET (${${RESULT}} FALSE)
91+
ENDIF (PYTHONINTERP_FOUND)
92+
ENDMACRO (TRY_RUN_PYTHON)
93+
94+
95+
# enable/disable python support (mapserver export tool and bindings)
96+
IF (PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
97+
SET (PYTHON_FOUND TRUE)
98+
MESSAGE(STATUS "Python libraries found")
99+
100+
# TODO: should not be needed, report it to CMake devs
101+
IF (UNIX)
102+
SET (PYTHON_LIBRARIES ${PYTHON_LIBRARIES} util)
103+
ENDIF (UNIX)
104+
105+
# check for SIP
106+
TRY_RUN_PYTHON (HAVE_SIP_MODULE "from sip import wrapinstance")
107+
FIND_PROGRAM (SIP_BINARY_PATH sip)
108+
109+
# check for PyQt4
110+
TRY_RUN_PYTHON (HAVE_PYQT4 "from PyQt4 import QtCore, QtGui")
111+
112+
# if SIP and PyQt4 are found, enable bindings
113+
IF (HAVE_SIP_MODULE AND SIP_BINARY_PATH AND HAVE_PYQT4)
114+
SET (HAVE_PYTHON TRUE)
115+
MESSAGE(STATUS "Python bindings enabled")
116+
ELSE (HAVE_SIP_MODULE AND SIP_BINARY_PATH AND HAVE_PYQT4)
117+
SET (HAVE_PYTHON FALSE)
118+
MESSAGE(STATUS "Python bindings disabled")
119+
ENDIF (HAVE_SIP_MODULE AND SIP_BINARY_PATH AND HAVE_PYQT4)
120+
121+
ENDIF (PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
122+
123+
124+
125+
#############################################################
126+
# search for Qt4
127+
128+
SET( QT_USE_QT3SUPPORT TRUE )
129+
SET( QT_USE_QTXML TRUE )
130+
SET( QT_USE_QTNETWORK TRUE )
131+
SET( QT_USE_QTSVG TRUE )
132+
133+
FIND_PACKAGE(Qt4 REQUIRED)
134+
135+
INCLUDE( ${QT_USE_FILE} )
136+
137+
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
138+
NAMES lrelease
139+
PATHS ${QT_BINARY_DIR}
140+
NO_DEFAULT_PATH
141+
)
142+
143+
#############################################################
144+
# enable warnings
145+
146+
ADD_DEFINITIONS( -Wall )
147+
148+
IF (CMAKE_BUILD_TYPE MATCHES Debug)
149+
ADD_DEFINITIONS(-DQGISDEBUG=1)
150+
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
151+
152+
#############################################################
153+
# platform specific stuff
154+
155+
IF (WIN32)
156+
157+
SET (QGIS_BIN_DIR ${CMAKE_INSTALL_PREFIX})
158+
SET (QGIS_DATA_DIR ${CMAKE_INSTALL_PREFIX})
159+
SET (QGIS_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/plugins)
160+
161+
ELSE (WIN32)
162+
163+
# common for MAC and UNIX
164+
SET (QGIS_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
165+
SET (QGIS_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/qgis)
166+
SET (QGIS_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/qgis)
167+
168+
IF (UNIX)
169+
ADD_DEFINITIONS(-DPREFIX=\\"${CMAKE_INSTALL_PREFIX}\\")
170+
ADD_DEFINITIONS(-DPLUGINPATH=\\"${QGIS_PLUGIN_DIR}\\")
171+
ADD_DEFINITIONS(-DPKGDATAPATH=\\"${QGIS_DATA_DIR}\\")
172+
ENDIF (UNIX)
173+
174+
ENDIF (WIN32)
175+
176+
177+
IF (WIN32)
178+
# expect that classes are being imported
179+
# Note: MSVC doesn't like when the macros are quotes
180+
# and MSYS doesn't like them unqouted (bacause of braces)
181+
IF (MSVC)
182+
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllimport)")
183+
ADD_DEFINITIONS("-DGUI_EXPORT=__declspec(dllimport)")
184+
ELSE (MSVC)
185+
ADD_DEFINITIONS("\"-DCORE_EXPORT=__declspec(dllimport)\"")
186+
ADD_DEFINITIONS("\"-DGUI_EXPORT=__declspec(dllimport)\"")
187+
ENDIF (MSVC)
188+
ELSE (WIN32)
189+
# other compilers don't use that MSVC construct
190+
ADD_DEFINITIONS(-DCORE_EXPORT=)
191+
ADD_DEFINITIONS(-DGUI_EXPORT=)
192+
ENDIF (WIN32)
193+
194+
195+
#############################################################
196+
# create qgsconfig.h
197+
198+
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/qgsconfig.h.in ${CMAKE_SOURCE_DIR}/qgsconfig.h)
199+
200+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
201+
202+
#############################################################
203+
# create qgssvnversion.h
204+
205+
# this is useful variable for developers
206+
SET (QGIS_NO_SVNVERSION FALSE CACHE BOOL "Set to true if you don't want qgssvnversion.h to be regenerated every make")
207+
208+
IF (QGIS_NO_SVNVERSION)
209+
210+
ADD_CUSTOM_TARGET(svnversion
211+
echo '\#define QGSSVNVERSION \"\"' > qgssvnversion.h
212+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
213+
214+
ELSE (QGIS_NO_SVNVERSION)
215+
216+
IF (WIN32)
217+
# TODO: create qgssvnversion.h properly
218+
ADD_CUSTOM_TARGET(svnversion echo "#define QGSSVNVERSION \"svn\"" > qgssvnversion.h
219+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
220+
ELSE (WIN32)
221+
ADD_CUSTOM_TARGET(svnversion ALL
222+
QGSSVNDEF='\#define QGSSVNVERSION \"'`svnversion .`'\"' &&
223+
if [ \"`grep QGSSVNVERSION qgssvnversion.h 2>/dev/null`\" != \"$$QGSSVNDEF\" ]; then
224+
echo $$QGSSVNDEF > qgssvnversion.h \; fi
225+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
226+
)
227+
228+
ENDIF (WIN32)
229+
230+
ENDIF (QGIS_NO_SVNVERSION)
231+
232+
#############################################################
233+
# process subdirs
234+
235+
SUBDIRS(src doc images resources i18n tools)
236+
237+
IF (HAVE_PYTHON)
238+
SUBDIRS (python)
239+
ENDIF (HAVE_PYTHON)
240+
241+
242+
#############################################################
243+
# install stuff
244+
245+
INSTALL (FILES AUTHORS SPONSORS
246+
DESTINATION ${QGIS_DATA_DIR}/doc)
247+
248+
# manual page... install also on windows?
249+
INSTALL (FILES qgis.man
250+
DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)

Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ EXTRA_DIST = \
1515
ChangeLog \
1616
COPYING \
1717
create_qm_files.sh \
18-
doc \
1918
INSTALL \
2019
$(man1_MANS) \
2120
NEWS \

acinclude.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ if test x${GEOS_CONFIG} = xno ; then
9191
AC_MSG_ERROR([geos-config not found! Supply it with --with-geos=PATH])
9292
else
9393
ac_geos_version=`${GEOS_CONFIG} --version`
94-
if test `echo ${ac_geos_version} | sed -e 's#[2-9]\.[0-9].*#OK#'` != OK ; then
95-
AC_MSG_ERROR([Geos Version 2.x.x or greater is needed, but you have $ac_geos_version!])
94+
if test `echo ${ac_geos_version} | sed -e 's#2\.[0-9].*#OK#'` != OK ; then
95+
AC_MSG_ERROR([Geos Version 2.x.x is needed, but you have $ac_geos_version!])
9696
else
9797
AC_MSG_CHECKING([GEOS_CFLAGS])
9898
GEOS_CFLAGS=`$GEOS_CONFIG --cflags`

cmake/Bison.cmake

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# use bison for .yy files
2+
3+
# search for bison
4+
MACRO(FIND_BISON)
5+
IF(NOT BISON_EXECUTABLE)
6+
FIND_PROGRAM(BISON_EXECUTABLE bison)
7+
IF (NOT BISON_EXECUTABLE)
8+
MESSAGE(FATAL_ERROR "Bison not found - aborting")
9+
ENDIF (NOT BISON_EXECUTABLE)
10+
ENDIF(NOT BISON_EXECUTABLE)
11+
ENDMACRO(FIND_BISON)
12+
13+
MACRO(ADD_BISON_FILES _sources )
14+
FIND_BISON()
15+
16+
FOREACH (_current_FILE ${ARGN})
17+
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
18+
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)
19+
20+
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
21+
22+
23+
# bison options:
24+
# -t add debugging facilities
25+
# -d produce additional header file (used in parser.l)
26+
# -v produce additional *.output file with parser states
27+
28+
ADD_CUSTOM_COMMAND(
29+
OUTPUT ${_out}
30+
COMMAND ${BISON_EXECUTABLE}
31+
ARGS
32+
-o${_out} -d -v -t
33+
${_in}
34+
DEPENDS ${_in}
35+
)
36+
37+
SET(${_sources} ${${_sources}} ${_out} )
38+
ENDFOREACH (_current_FILE)
39+
ENDMACRO(ADD_BISON_FILES)

cmake/FindExpat.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# CMake module to search for Expat library
3+
# (library for parsing XML files)
4+
#
5+
# If it's found it sets EXPAT_FOUND to TRUE
6+
# and following variables are set:
7+
# EXPAT_INCLUDE_DIR
8+
# EXPAT_LIBRARY
9+
10+
11+
FIND_PATH(EXPAT_INCLUDE_DIR expat.h /usr/local/include /usr/include)
12+
13+
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat PATH /usr/local/lib /usr/lib)
14+
15+
IF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
16+
SET(EXPAT_FOUND TRUE)
17+
ENDIF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
18+
19+
20+
IF (EXPAT_FOUND)
21+
22+
IF (NOT EXPAT_FIND_QUIETLY)
23+
MESSAGE(STATUS "Found Expat: ${EXPAT_LIBRARY}")
24+
ENDIF (NOT EXPAT_FIND_QUIETLY)
25+
26+
ELSE (EXPAT_FOUND)
27+
28+
IF (EXPAT_FIND_REQUIRED)
29+
MESSAGE(FATAL_ERROR "Could not find Expat")
30+
ELSE (EXPAT_FIND_REQUIRED)
31+
IF (NOT EXPAT_FIND_QUIETLY)
32+
MESSAGE(STATUS "Could not find Expat")
33+
ENDIF (NOT EXPAT_FIND_QUIETLY)
34+
ENDIF (EXPAT_FIND_REQUIRED)
35+
36+
ENDIF (EXPAT_FOUND)

0 commit comments

Comments
 (0)