Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
QtOpenGL problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Fri Nov 19, 2010 11:12 pm    Post subject: QtOpenGL problem Reply with quote

Hi all!
I hope someone can help me with this problem here..

The problem itself seems to be either OpenGL or Qt .. or both?
I have installed:
equery l opengl
[ Searching for package 'opengl' in all categories among: ]
* installed packages
[I--] [ ] app-admin/eselect-opengl-1.1.1-r2 (0)
[I--] [ ] app-emulation/emul-linux-x86-opengl-20100915 (0)
[I--] [ ] dev-python/pyopengl-3.0.1 (0)
[I--] [ ] virtual/opengl-7.0 (0)
[I--] [ ] x11-libs/qt-opengl-4.6.3 (4)

equery l qt
[ Searching for package 'qt' in all categories among: ]
* installed packages
[I--] [ ] app-emulation/emul-linux-x86-qtlibs-20100915 (0)
[I--] [ ] dev-util/qt-creator-1.3.1-r1 (0)
[I--] [ ] sys-auth/polkit-qt-0.96.1 (0)
[I--] [ ] x11-libs/qt-assistant-4.6.3 (4)
[I--] [ ] x11-libs/qt-core-4.6.3 (4)
[I--] [ ] x11-libs/qt-dbus-4.6.3 (4)
[I--] [ ] x11-libs/qt-demo-4.6.3 (4)
[I--] [ ] x11-libs/qt-gui-4.6.3-r2 (4)
[I--] [ ] x11-libs/qt-multimedia-4.6.3 (4)
[I--] [ ] x11-libs/qt-opengl-4.6.3 (4)
[I--] [ ] x11-libs/qt-qt3support-4.6.3 (4)
[I--] [ ] x11-libs/qt-script-4.6.3 (4)
[I--] [ ] x11-libs/qt-sql-4.6.3-r2 (4)
[I--] [ ] x11-libs/qt-svg-4.6.3 (4)
[I--] [ ] x11-libs/qt-test-4.6.3 (4)
[I--] [ ] x11-libs/qt-webkit-4.6.3-r1 (4)
[I--] [ ] x11-libs/qt-xmlpatterns-4.6.3 (4)

And I'd like to compile a software that uses QtOpenGL
As far as I can tell - everything i need is already installed but .. somehow the software cannot find the QtOpenGL..
I already tried to find something but .. As I am not a programmer I don't know where to search.

conf.d tells me the /usr/lib64/qt4 is in the libpath and there is /usr/lib64/qt4 $ ls libQtOpe*
libQtOpenGL.prl libQtOpenGL.so.4 libQtOpenGL.so.4.6.3
libQtOpenGL.so libQtOpenGL.so.4.6

So it's obviously on my system .. but where are the screws to tell cmake where it is ..
I already tried to search in the CMakeLists.txt but .. don't know what to do..

The error i get is:
[ 95%] Building CXX object src/plugins/globe/CMakeFiles/globeplugin.dir/qrc_globe_plugin.cxx.o
Linking CXX shared module libglobeplugin.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtOpenGL
collect2: ld returned 1 exit status
make[2]: *** [src/plugins/globe/libglobeplugin.so] Error 1
make[1]: *** [src/plugins/globe/CMakeFiles/globeplugin.dir/all] Error 2
make: *** [all] Error 2

This is what i have:
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop/gnome, gcc-4.4.4, glibc-2.11.2-r3, 2.6.34-gentoo-r12 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r12-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-1.12.14
Timestamp of tree: Fri, 19 Nov 2010 22:30:01 +0000
app-shells/bash: 4.1_p7
dev-java/java-config: 1.3.7-r1, 2.1.11-r1
dev-lang/python: 2.5.4-r4, 2.6.5-r3, 3.1.2-r4
dev-util/cmake: 2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox: 2.3-r1
sys-devel/autoconf: 2.13, 2.65-r1
sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils: 2.20.1-r1
sys-devel/gcc: 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool: 2.2.10
sys-devel/make: 3.81-r2
virtual/os-headers: 2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en de cz"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="R X a52 aac aalib acl acpi additions alsa amd64 amr automount bash-completion berkdb bineditor bl blender-game bluetooth bogofilter bonjour branding btrfs bzip2 cairo cdda cddb cdr clamav cli client-only consolekit cracklib crypt ctype cups curl cxx daap dbus dc1394 device-mapper dga dirac dri drm dts dv dvb dvd dvdnav dvdr dvi ecwj2k eds emboss enca encode evo examples exif extras faac faad fam fame fat ffmpeg fftw firefox firefox3 fits flac fontconfig fortran frei0r fts3 gd gdal gdbm gdm gdu gedit geos ggi gif gimp git github glitz gmail gmath gml gmtfull gmthigh gmtsuppl gmttria gnome gnome-keyring gnuplot gnutls gocr google gphoto2 gpm gps graphics grass gsl gstreamer gtk hal hddtemp hdf5 hdri hfs ical icons iconv icq id3 id3tag idea ieee1394 imap imlib iptc ipv6 jabber jadetex java jpeg jpeg2k kde lame largefile latex latex3 lcms ldap libburn libcaca libnotify lua lzo mad maps melt mikmod mjpeg mmap mmx mmxext mng modplug modules mono motif mp3 mp4 mpeg mplayer mudflap multilib multimedia musepack musicbrainz nautilus ncurses netcdf network nforce2 nls nptl nptlonly nsplugin ntfs nvidia obex objc objc++ objc-gc ocaml odbc ogdi ogg openal openexr opengl openmp osgapps pam pango pcre pdf perl png pnm policykit postgres ppds pppd pvr python qt3support qt4 qthelp quesoglc quicktime qwt rar raw readline reports rhythmbox rtc samba samples sasl scanner sdl session sift silc skins slang smp sndfile sox speex spell sql sqlite srt sse sse2 ssl ssse3 startup-notification subversion svg symlink sysfs szip tcpd teletext tga theora threads threadsafe tiff tk truetype udev unicode usb v4l2 videos vlm vnc vorbis wavpack webkit wfs wma wma-fixed wmf x264 xcb xcomposite xfs xine xml xmlpatterns xorg xrandr xscreensaver xulrunner xv xvid youtube zlib" ALSA_CARDS="hda-intel driver" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse joystick vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de cz" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Anyone has a clue whats going wrong here? where is the screw to handle this?

thx a lot for help
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
FranZ
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 212
Location: Enschede, Holland

PostPosted: Tue Nov 23, 2010 8:16 pm    Post subject: Reply with quote

The CMakeLists.txt has a line saying something like find_library(Qt4 REQUIRED ...). Does it say QtOpenGL there or doesn't it specify libraries?

If you can't figure it out: What software are you trying to build? I could have a look at it.
_________________
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

Ask Smart Questions
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Thu Nov 25, 2010 4:23 pm    Post subject: Reply with quote

hi!

thanks a lot for your answer .. unfortunately i cannot find anything like FIND_LIBRARY(Qt4) in that CMakeLists.txt ..
I'm trying to compile QGIS with the globe plugin enabled ..

It's the threading-globe branch from git://github.com/sourcepole/qgis.git

you have to unmask geos-3.2.2 and install the stable version of osgearth (could not find any ebuild for it)

after that you should be able to compile qgis .. but there is an error (during compile - not configure - don't know why it does not complain during configure) that it cannot find libQtOpenGL ..

Hope you are able to find the error .. best would be to correct it in the CMakeFiles - I will not believe that it is the error of gentoo ;)
Although i have to admit that it compiles well under ubuntu - so i'm really stuck here ..

thanks a lot for you help

regards
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
FranZ
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 212
Location: Enschede, Holland

PostPosted: Thu Nov 25, 2010 5:43 pm    Post subject: Reply with quote

There are some find_package(Qt4 REQUIRED) lines. I always get those two confused. I'll have a look at it asap. (depends on how long the other packages take :))
_________________
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

Ask Smart Questions
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Thu Nov 25, 2010 6:41 pm    Post subject: Reply with quote

RoeR wrote:
hi!

thanks a lot for your answer .. unfortunately i cannot find anything like FIND_LIBRARY(Qt4) in that CMakeLists.txt ..
I'm trying to compile QGIS with the globe plugin enabled ..

It's the threading-globe branch from git://github.com/sourcepole/qgis.git

you have to unmask geos-3.2.2 and install the stable version of osgearth (could not find any ebuild for it)

after that you should be able to compile qgis .. but there is an error (during compile - not configure - don't know why it does not complain during configure) that it cannot find libQtOpenGL ..

Hope you are able to find the error .. best would be to correct it in the CMakeFiles - I will not believe that it is the error of gentoo ;)
Although i have to admit that it compiles well under ubuntu - so i'm really stuck here ..

thanks a lot for you help

regards
RoeR


check the link in my signature, I have a CMakeList.txt with qt modules, just replace the xml one with opengl and your good to go.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
FranZ
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 212
Location: Enschede, Holland

PostPosted: Thu Nov 25, 2010 7:15 pm    Post subject: Reply with quote

Might be quicker :)
_________________
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

Ask Smart Questions
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Thu Nov 25, 2010 7:24 pm    Post subject: Reply with quote

RoeR wrote:
hi!

thanks a lot for your answer .. unfortunately i cannot find anything like FIND_LIBRARY(Qt4) in that CMakeLists.txt ..
I'm trying to compile QGIS with the globe plugin enabled ..

It's the threading-globe branch from git://github.com/sourcepole/qgis.git

you have to unmask geos-3.2.2 and install the stable version of osgearth (could not find any ebuild for it)

after that you should be able to compile qgis .. but there is an error (during compile - not configure - don't know why it does not complain during configure) that it cannot find libQtOpenGL ..

Hope you are able to find the error .. best would be to correct it in the CMakeFiles - I will not believe that it is the error of gentoo ;)
Although i have to admit that it compiles well under ubuntu - so i'm really stuck here ..

thanks a lot for you help

regards
RoeR


here
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Fri Nov 26, 2010 7:52 am    Post subject: Reply with quote

Hi again ..
I took a look at your CMakeLists.txt and copied the things into my own CMakeLists.txt:

after edit:
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)

before edit:
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)


but ...
[ 95%] Building CXX object src/plugins/globe/CMakeFiles/globeplugin.dir/qrc_globe_plugin.cxx.o
Linking CXX shared module libglobeplugin.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtOpenGL
collect2: ld returned 1 exit status
make[2]: *** [src/plugins/globe/libglobeplugin.so] Error 1
make[1]: *** [src/plugins/globe/CMakeFiles/globeplugin.dir/all] Error 2
make: *** [all] Error 2

No success again .. :(

Any other suggestion? or did i do something wrong..

thanks for you help
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Fri Nov 26, 2010 8:54 am    Post subject: Reply with quote

RoeR wrote:
Hi again ..
I took a look at your CMakeLists.txt and copied the things into my own CMakeLists.txt:

after edit:
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)

before edit:
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)


but ...
[ 95%] Building CXX object src/plugins/globe/CMakeFiles/globeplugin.dir/qrc_globe_plugin.cxx.o
Linking CXX shared module libglobeplugin.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtOpenGL
collect2: ld returned 1 exit status
make[2]: *** [src/plugins/globe/libglobeplugin.so] Error 1
make[1]: *** [src/plugins/globe/CMakeFiles/globeplugin.dir/all] Error 2
make: *** [all] Error 2

No success again .. :(

Any other suggestion? or did i do something wrong..

thanks for you help
RoeR

that is the original CMakeList.txt from the project you've posted, mine can be found here

also, the after of that project should be like this:
Quote:
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)

_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Fri Nov 26, 2010 9:04 am    Post subject: Reply with quote

so you mean adding this line:
SET(QT_USE_QTOPENGL 1)
should be enough?

cause this was my first try and it did not work either .. :(

so I added the COMPONENTS in FIND_PACKAGE also - but still no success..

it's always this line:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtOpenGL
appearing during linking (compiling seems to be ok)

what else can i do there?

thanks
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Fri Nov 26, 2010 10:40 am    Post subject: Reply with quote

RoeR wrote:
so you mean adding this line:
SET(QT_USE_QTOPENGL 1)
should be enough?

cause this was my first try and it did not work either .. :(

so I added the COMPONENTS in FIND_PACKAGE also - but still no success..

it's always this line:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lQtOpenGL
appearing during linking (compiling seems to be ok)

what else can i do there?

thanks
RoeR

is x11-libs/qt-opengl installed on your system? what cmake version are you using?
I've added QtOpenGL to CMakeList.txt, and it links ok although maybe because I'm not using any code from that lib
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Fri Nov 26, 2010 11:28 am    Post subject: Reply with quote

Hi!

I've this here:
found build # equery l cmake
[ Searching for package 'cmake' in all categories among: ]
* installed packages
[I--] [ ] dev-util/cmake-2.8.1-r2 (0)
[I--] [ ] x11-misc/gccmakedep-1.0.2 (0)
found build # equery l qt-opengl
[ Searching for package 'qt-opengl' in all categories among: ]
* installed packages
[I--] [ ] x11-libs/qt-opengl-4.6.3 (4)
found build #

and of course [I--] [ ] virtual/opengl-7.0 (0)

does that help in any way?
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Fri Nov 26, 2010 11:59 am    Post subject: Reply with quote

RoeR wrote:
Hi!

I've this here:
found build # equery l cmake
[ Searching for package 'cmake' in all categories among: ]
* installed packages
[I--] [ ] dev-util/cmake-2.8.1-r2 (0)
[I--] [ ] x11-misc/gccmakedep-1.0.2 (0)
found build # equery l qt-opengl
[ Searching for package 'qt-opengl' in all categories among: ]
* installed packages
[I--] [ ] x11-libs/qt-opengl-4.6.3 (4)
found build #

and of course [I--] [ ] virtual/opengl-7.0 (0)

does that help in any way?

mmmmm strange, can you post your full CMakeList.txt?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
ComaWhite
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 125

PostPosted: Fri Nov 26, 2010 1:02 pm    Post subject: Reply with quote

Well from I have used of Qt with CMake, those set(QT_USE* TRUE) need to be before the find_package()
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Fri Nov 26, 2010 1:21 pm    Post subject: Reply with quote

my currently used CMakeLists.txt is:
Code:

SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "5")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
SET(RELEASE_NAME "Trunk")
SET(PROJECT_VERSION ${COMPLETE_VERSION})
PROJECT(qgis${PROJECT_VERSION})

# Note the version no is Mmmpp for Major/minor/patch, 0-padded, thus '10100' for 1.1.0
MATH(EXPR QGIS_VERSION_INT "${CPACK_PACKAGE_VERSION_MAJOR}*10000+${CPACK_PACKAGE_VERSION_MINOR}*100+${CPACK_PACKAGE_VERSION_PATCH}")
MESSAGE(STATUS "Quantum GIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSION_INT})")

# TODO:
# - install includes for libs
# - nice output when configured
# - rename *.ui files to have the same filename as their implementation
#   e.g. instead of blahblahbase.ui use blahblah.ui
#   because it's more common in Qt4
# Note on last point above by Tim Sutton - I prefer to have the base suffix
# as it indicates the ui generated class will be a base class for the widget.

#############################################################
# CMake settings

# 2.6 required for QtWebkit
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_COLOR_MAKEFILE ON)

# set path to additional CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

# in generated makefiles use relative paths so the project dir is moveable
# Note commented out since it cause problems but it would be nice to resolve these and enable
#
# issue is caused by INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) near the end of this file generating incorrect path
#SET (CMAKE_USE_RELATIVE_PATHS ON)

# it's possible to set PLUGINS_ALSO_BINARIES to TRUE
# then some plugins that can run as standalone apps will be built
# also as standalone apps
SET (PLUGINS_ALSO_BINARIES FALSE)


# try to configure and build GRASS plugin by default
SET (WITH_GRASS TRUE CACHE BOOL "Determines whether GRASS plugin should be built")
IF (WITH_GRASS)
  SET (GRASS_PREFIX "" CACHE PATH "Path to GRASS base directory")
ENDIF (WITH_GRASS)

# try to configure and build POSTGRESQL support
SET (WITH_POSTGRESQL TRUE CACHE BOOL "Determines whether POSTGRESQL support should be built")
IF (WITH_POSTGRESQL)
  SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
ENDIF (WITH_POSTGRESQL)

SET (WITH_QWT TRUE CACHE BOOL "Determines whether QWT support should be included (currently used for GPS widget)")

SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")

IF (WITH_SPATIALITE)
  SET (WITH_INTERNAL_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
  IF(WITH_INTERNAL_SPATIALITE)
    SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
    SET(HAVE_SPATIALITE TRUE)
    IF(WIN32 OR APPLE)
      FIND_PACKAGE(Iconv REQUIRED)
    ENDIF(WIN32 OR APPLE)
  ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF (WITH_SPATIALITE)

# try to configure and build python bindings by default
SET (WITH_BINDINGS TRUE CACHE BOOL "Determines whether python bindings should be built")
IF (WITH_BINDINGS)
  # By default bindings will be installed only to QGIS directory
  # Someone might want to install it to python site-packages directory
  # as otherwise user has to use PYTHONPATH environemnt variable to add
  # QGIS bindings to package search path
  SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
ENDIF (WITH_BINDINGS)

SET (WITH_GLOBE TRUE CACHE BOOL "Determines whether Globe plugin should be built")
IF (WITH_GLOBE)
  FIND_PACKAGE(OSGEARTH)
ENDIF (WITH_GLOBE)

# Compile flag. Make it possible to turn it off.
SET (PEDANTIC FALSE CACHE BOOL "Determines if we should compile in pedantic mode.")

# whether unit tests should be build
SET (ENABLE_TESTS FALSE CACHE BOOL "Build unit tests?")

# hide this variable because building of python bindings might fail
# if set to other directory than expected
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH)

#############################################################
# check if lexer and parser are not missing
# http://www.mail-archive.com/cmake@cmake.org/msg02861.html

INCLUDE(Flex)

FIND_FLEX()

IF (NOT FLEX_EXECUTABLE)
  MESSAGE(FATAL_ERROR "Couldn't find Flex")
ENDIF (NOT FLEX_EXECUTABLE)

INCLUDE(Bison)

FIND_BISON()

IF (NOT BISON_EXECUTABLE)
  MESSAGE(FATAL_ERROR "Couldn't find Bison")
ENDIF (NOT BISON_EXECUTABLE)

#############################################################
# search for dependencies

IF(NOT WIN32)
  INCLUDE(CheckFunctionExists)
  CHECK_FUNCTION_EXISTS(openpty OPENPTY_IN_LIBC)
  IF(NOT OPENPTY_IN_LIBC)
    SET(CMAKE_REQUIRED_INCLUDES util.h)
    SET(CMAKE_REQUIRED_LIBRARIES util)
    CHECK_FUNCTION_EXISTS(openpty NEED_LIBUTIL)
    IF(NEED_LIBUTIL)
      SET(OPENPTY_LIBRARY util)
    ELSE(NEED_LIBUTIL)
      MESSAGE (SEND_ERROR "openpty not found!")
    ENDIF(NEED_LIBUTIL)
  ENDIF(NOT OPENPTY_IN_LIBC)
ENDIF(NOT WIN32)

# required
FIND_PACKAGE(Proj)
FIND_PACKAGE(Expat)    # GPS importer plugin
FIND_PACKAGE(GSL)      # Georeferencer
FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)

IF (NOT WITH_INTERNAL_SPATIALITE)
  FIND_PACKAGE(Sqlite3)
  IF (NOT SQLITE3_FOUND)
    MESSAGE (SEND_ERROR "sqlite3 dependency was not found (try compiling with internal spatialite)!")
  ENDIF (NOT SQLITE3_FOUND)
ENDIF (NOT WITH_INTERNAL_SPATIALITE)

# optional
IF (WITH_POSTGRESQL)
  FIND_PACKAGE(Postgres) # PostgreSQL provider, SPIT plugin
ENDIF (WITH_POSTGRESQL)
IF (WITH_GRASS)
  FIND_PACKAGE(GRASS)    # GRASS plugin
ENDIF (WITH_GRASS)
IF (WITH_QWT)
  FIND_PACKAGE(QWT)
ENDIF(WITH_QWT)

IF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
  FIND_PACKAGE(SPATIALITE)
ENDIF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)

IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
  MESSAGE (SEND_ERROR "Some dependencies were not found!")
ENDIF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)

IF (POSTGRES_FOUND)
  # following variable is used in qgsconfig.h
  SET (HAVE_POSTGRESQL TRUE)
ENDIF (POSTGRES_FOUND)

IF (SPATIALITE_FOUND)
  # following variable is used in qgsconfig.h
  SET (HAVE_SPATIALITE TRUE)
ENDIF (SPATIALITE_FOUND)

#############################################################
# search for Qt4
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)

IF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR NOT QT_QTWEBKIT_FOUND)
  MESSAGE(SEND_ERROR "Some Qt4 modules haven't been found!")
ENDIF ()

IF (ENABLE_TESTS)
  SET( QT_USE_QTTEST  TRUE )
  ENABLE_TESTING()
ENDIF (ENABLE_TESTS)


INCLUDE( ${QT_USE_FILE} )

# Disable automatic conversion from QString to ASCII 8-bit strings (char *)
# (Keeps code compatible with Qt/Mac/64bit)
ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII)

FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
    NAMES lrelease
    PATHS ${QT_BINARY_DIR}
    NO_DEFAULT_PATH
    )

#############################################################
# enable warnings

IF (PEDANTIC)
  MESSAGE (STATUS "Pedantic compiler settings enabled")
  IF(MSVC)
    ADD_DEFINITIONS( /W4 )

    # disable warnings
    ADD_DEFINITIONS( /wd4100 )  # unused formal parameters
    ADD_DEFINITIONS( /wd4127 )  # constant conditional expressions (used in Qt template classes)
    ADD_DEFINITIONS( /wd4510 )  # default constructor could not be generated (sqlite3_index_info, QMap)
    ADD_DEFINITIONS( /wd4512 )  # assignment operator could not be generated (sqlite3_index_info)
    ADD_DEFINITIONS( /wd4610 )  # user defined constructor required (sqlite3_index_info)
    ADD_DEFINITIONS( /wd4706 )  # assignment within conditional expression (pal)
  ELSE (MSVC)
    ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security -Wno-strict-aliasing )
    # Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
    # ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
  ENDIF (MSVC)
ENDIF (PEDANTIC)

IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
  MESSAGE (STATUS "Debug output enabled")
  ADD_DEFINITIONS(-DQGISDEBUG=1)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

#############################################################
# platform specific stuff

IF (WIN32)
  SET (DEFAULT_LIB_SUBDIR     lib)
  SET (DEFAULT_DATA_SUBDIR    .)
  SET (DEFAULT_PLUGIN_SUBDIR  plugins)
  SET (DEFAULT_INCLUDE_SUBDIR include)
 
  IF (MSVC)
    SET (DEFAULT_BIN_SUBDIR bin)
    # put all the build products into a single directory
    # under build (doesnt affect install target) to make for
    # easier debugging.
    #tell msvc compiler to use main instead of winmain as the
    #application entry point
    #SET(QT_USE_QTMAIN TRUE)
    # Turn on defines for non standard maths stuff
    ADD_DEFINITIONS(-D_USE_MATH_DEFINES)

    # Turn off deprecation warnings
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
    ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
   
    IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
      MESSAGE (STATUS "Generating browse files")
      ADD_DEFINITIONS( /FR )
    ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

    IF (INSTALL_DEPS)
      INSTALL(DIRECTORY ${INSTALL_DEPS} DESTINATION .)
    ENDIF (INSTALL_DEPS)
  ELSE(MSVC)
    SET (DEFAULT_BIN_SUBDIR .)
  ENDIF(MSVC)
ELSE (WIN32)

  IF (APPLE)
    # for Mac OS X, everything is put inside an application bundle
    SET (CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/MacOS)
    # path for library references
    SET (CMAKE_INSTALL_NAME_DIR @executable_path/lib)
    #this will define ${APP_SERVICES_LIBRARY}
    FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
  ENDIF (APPLE)

  # common for MAC and UNIX
  SET (DEFAULT_BIN_SUBDIR     bin)
  SET (DEFAULT_LIB_SUBDIR     lib${LIB_SUFFIX})
  SET (DEFAULT_DATA_SUBDIR    share/qgis)
  SET (DEFAULT_PLUGIN_SUBDIR  lib${LIB_SUFFIX}/qgis)
  SET (DEFAULT_INCLUDE_SUBDIR include/qgis)

ENDIF (WIN32)


#assume we have excaped compiler directives
#eventually we want to change this to new
#since we don't need to jump through so many
#hoops to escape compiler directives then
IF(COMMAND cmake_policy)
  cmake_policy(SET CMP0003 NEW)
  cmake_policy(SET CMP0005 OLD)
ENDIF(COMMAND cmake_policy)

IF (WIN32)
  # expect that classes are being imported
  # Note: MSVC doesn't like when the macros are quotes
  # and MSYS doesn't like them unqouted (bacause of braces)
  IF (MSVC)
    ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllimport)")
    ADD_DEFINITIONS("-DGUI_EXPORT=__declspec(dllimport)")
    ADD_DEFINITIONS("-DPYTHON_EXPORT=__declspec(dllimport)")
    ADD_DEFINITIONS("-DANALYSIS_EXPORT=__declspec(dllimport)")
  ELSE (MSVC)
    ADD_DEFINITIONS("\"-DCORE_EXPORT=__declspec(dllimport)\"")
    ADD_DEFINITIONS("\"-DGUI_EXPORT=__declspec(dllimport)\"")
    ADD_DEFINITIONS("\"-DPYTHON_EXPORT=__declspec(dllimport)\"")
    ADD_DEFINITIONS("\"-DANALYSIS_EXPORT=__declspec(dllimport)\"")
  ENDIF (MSVC)
ELSE (WIN32)
  # other compilers don't use that MSVC construct
  ADD_DEFINITIONS(-DCORE_EXPORT=)
  ADD_DEFINITIONS(-DGUI_EXPORT=)
  ADD_DEFINITIONS(-DPYTHON_EXPORT=)
  ADD_DEFINITIONS(-DANALYSIS_EXPORT=)
ENDIF (WIN32)

#############################################################
# user-changeable settings which can be used to customize
# layout of QGIS installation
# (default values are platform-specific)

SET (QGIS_BIN_SUBDIR     ${DEFAULT_BIN_SUBDIR}     CACHE STRING "Subdirectory where executables will be installed")
SET (QGIS_LIB_SUBDIR     ${DEFAULT_LIB_SUBDIR}     CACHE STRING "Subdirectory where libraries will be installed")
SET (QGIS_DATA_SUBDIR    ${DEFAULT_DATA_SUBDIR}    CACHE STRING "Subdirectory where QGIS data will be installed")
SET (QGIS_PLUGIN_SUBDIR  ${DEFAULT_PLUGIN_SUBDIR}  CACHE STRING "Subdirectory where plugins will be installed")
SET (QGIS_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING "Subdirectory where header files will be installed")

# mark *_SUBDIR variables as advanced as this is not something
# that an average user would use
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_LIB_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)

# full paths for the installation
SET (QGIS_BIN_DIR     ${QGIS_BIN_SUBDIR})
SET (QGIS_LIB_DIR     ${QGIS_LIB_SUBDIR})
SET (QGIS_DATA_DIR    ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR  ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})

# manual page - makes sense only on unix systems
IF (UNIX)
  SET (DEFAULT_MANUAL_SUBDIR  man)
  SET (QGIS_MANUAL_SUBDIR  ${DEFAULT_MANUAL_SUBDIR}  CACHE STRING "Subdirectory where manual files will be installed")
  MARK_AS_ADVANCED (QGIS_MANUAL_SUBDIR)
  SET (QGIS_MANUAL_DIR  ${CMAKE_INSTALL_PREFIX}/${QGIS_MANUAL_SUBDIR})
ENDIF (UNIX)

#############################################################
# Python bindings

IF (WITH_BINDINGS)

  # python support: check for interpreter, sip, pyqt4
  FIND_PACKAGE(PythonInterp REQUIRED)
  FIND_PACKAGE(PythonLibrary REQUIRED)
  FIND_PACKAGE(SIP REQUIRED)
  FIND_PACKAGE(PyQt4 REQUIRED)
  INCLUDE(PythonMacros)
  INCLUDE(SIPMacros)
  INCLUDE(PyQt4Macros)

  # setup SIP variables
  separate_arguments(PYQT4_SIP_FLAGS) # convert space separated values to a list
  set(SIP_INCLUDES ${PYQT4_SIP_DIR} ${CMAKE_SOURCE_DIR}/python)
  set(SIP_CONCAT_PARTS 4)
  set(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS})

  IF (NOT BINDINGS_GLOBAL_INSTALL)
    set(PYTHON_SITE_PACKAGES_DIR ${QGIS_DATA_DIR}/python)
  ENDIF (NOT BINDINGS_GLOBAL_INSTALL)

ENDIF (WITH_BINDINGS)

#############################################################
# create qgsconfig.h

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/qgsconfig.h.in ${CMAKE_BINARY_DIR}/qgsconfig.h)
INSTALL(FILES ${CMAKE_BINARY_DIR}/qgsconfig.h DESTINATION ${QGIS_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})

# Added by Jef to prevent python core and gui libs linking to other qgisCore and qgisGui libs
# that may be in the same install prefix
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)

#############################################################
# create qgssvnversion.h

FIND_FILE(SVN_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.svn)

IF (SVN_MARKER)
  # See if we have svn installed
  FIND_PROGRAM(SVNVERSION svnversion PATHS c:/cygwin/bin)

  IF(SVNVERSION)
    IF(MSVC)
   ADD_CUSTOM_COMMAND(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
      COMMAND for /f usebackq %%a in "(`\"${SVNVERSION}\"`)" do echo \#define QGSSVNVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
      MAIN_DEPENDENCY ${SVN_MARKER}
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
   )
    ELSE(MSVC)
   ADD_CUSTOM_COMMAND(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
      COMMAND echo \\\#define QGSSVNVERSION \\\"`${SVNVERSION}`\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
      MAIN_DEPENDENCY ${SVN_MARKER}
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
   )
    ENDIF(MSVC)
  ELSE(SVNVERSION)
    MESSAGE(STATUS "svnversion not found - version will be unknown")
    FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"unknown\"")
  ENDIF (SVNVERSION)
ELSE (SVN_MARKER)
  FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"exported\"")
ENDIF (SVN_MARKER)

ADD_CUSTOM_TARGET(svnversion ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h)

#############################################################
# process subdirs

SUBDIRS(src doc images resources i18n)

IF (WITH_BINDINGS)
  SUBDIRS (python)
ENDIF (WITH_BINDINGS)

IF (ENABLE_TESTS)
  #create a variable to specify where our test data is
  #so that unit tests can use TEST_DATA_DIR to locate
  #the test data. See CMakeLists in test dirs for more info
  SET (TEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata")
  SUBDIRS(tests)
ENDIF (ENABLE_TESTS)

#############################################################
# install stuff

INSTALL (FILES AUTHORS CONTRIBUTORS SPONSORS DONORS TRANSLATORS INSTALL CODING
         DESTINATION ${QGIS_DATA_DIR}/doc)

# manual page - makes sense only on unix systems
IF (UNIX)
  INSTALL (FILES qgis.1 qgis_help.1
           DESTINATION ${QGIS_MANUAL_DIR}/man1)
ENDIF (UNIX)


#############################################################
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_templates/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

ADD_CUSTOM_TARGET(uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

#############################################################
# Enable packaging

INCLUDE(InstallRequiredSystemLibraries)

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Quantum GIS")
SET(CPACK_PACKAGE_VENDOR "Open Source Geospatial Foundation")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Quantum GIS ${COMPLETE_VERSION}")
IF(WIN32 AND NOT UNIX)
  # There is a bug in NSI that does not handle full unix paths properly. Make
  # sure there is at least one set of four (4) backslashes.
  SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/win_build\\\\sidebar.bmp")
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\qgis.exe")
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} Quantum GIS")
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\qgis.org")
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\qgis.org")
  SET(CPACK_NSIS_CONTACT "tim@linfiniti.com")
  SET(CPACK_NSIS_MODIFY_PATH ON)

#  SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "  !include \\\"${CMAKE_SOURCE_DIR}\\\\win_build\\\\extra.nsh\\\"")
ELSE(WIN32 AND NOT UNIX)
  #SET(CPACK_STRIP_FILES "Quantum GIS")
  #SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "qgis" "QGIS")
INCLUDE(CPack)


It's just the original git - with the changes i read in this thread ..

and still . -lQtOpenGL cannot be found .. :(
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Fri Nov 26, 2010 2:46 pm    Post subject: Reply with quote

this
Code:

#############################################################
# search for Qt4
SET(QT_MIN_VERSION 4.4.0)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)

or
Code:

#############################################################
# search for Qt4
SET(QT_MIN_VERSION 4.4.0)
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
SET(QT_USE_QTSVG 1)
SET(QT_USE_QTSQL 1)
SET(QT_USE_QTWEBKIT 1)
SET(QT_USE_QTOPENGL 1)
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)

doesn't work for you?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Wed Jan 05, 2011 12:20 pm    Post subject: Reply with quote

sorry for replying such late .. busy around new year :(
already tried both version with no success ..
there seems to be something wrong with opengl :(

anything i can emerge to test it?

regards and many thanks
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
Lustmored
Apprentice
Apprentice


Joined: 28 May 2010
Posts: 206
Location: Poland

PostPosted: Thu Jan 06, 2011 1:01 am    Post subject: Reply with quote

You don't have "egl" flag set, don't you?
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Thu Jan 06, 2011 1:20 am    Post subject: Reply with quote

to be honest - i even dont know what the egl flag is but it were not set ..
i set it - and tried to emerge -DavuN world - but no packages were emerged ..
so i tried to compile the program (and thought that setting the egl flag would help in any way) but without any success

shall i do a emerge -e system after setting the egl flag or what else can i do?
as i already said i did not even know that egl exists and still dont know what it is for .. but it seems to have no effect at all

any other suggestions?

thanks for your help anyway ..

regars
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Thu Jan 06, 2011 6:13 am    Post subject: Reply with quote

I don't have egl flag set and have no problem.

is it possible to d/l the code from somewhere so I can try compiling it on my computer?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Thu Jan 06, 2011 9:26 am    Post subject: Reply with quote

Sure ..

there is http://www.qgis.org/wiki/Using_Git
Where you can find the description under "Using a git mirror of QGIS"
It's the threading-globe branch of qgis ..
On my ubuntu notebook everything compiles fine - but with my 64bit gentoo desktop there is this damn problem with not finding QtOpenGl.

Hope you'll find the bug ..

thanks a lot
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
Lustmored
Apprentice
Apprentice


Joined: 28 May 2010
Posts: 206
Location: Poland

PostPosted: Thu Jan 06, 2011 1:41 pm    Post subject: Reply with quote

"egl" flag so far usually breaks packages rather than fixing, so it' better to stay off with it :wink:
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5338

PostPosted: Thu Jan 06, 2011 7:44 pm    Post subject: Reply with quote

cannot help much, it fails compilation:
Code:
[ 52%] Building CXX object src/app/CMakeFiles/qgis.dir/qgsmanageconnectionsdialog.cpp.o           
[ 52%] Building CXX object src/app/CMakeFiles/qgis.dir/composer/qgsattributeselectiondialog.cpp.o
[ 52%] Building CXX object src/app/CMakeFiles/qgis.dir/composer/qgscomposer.cpp.o                 
/home/dagg/temp1/qgis/src/app/composer/qgscomposer.cpp: In member function ‘void QgsComposer::restoreWindowState()’:
/home/dagg/temp1/qgis/src/app/composer/qgscomposer.cpp:1051:44: error: cannot call constructor ‘QVariant::QVariant’ directly
/home/dagg/temp1/qgis/src/app/composer/qgscomposer.cpp:1051:44: error:   for a function-style cast, remove the redundant ‘::QVariant’
make[2]: *** [src/app/CMakeFiles/qgis.dir/composer/qgscomposer.cpp.o] Error 1
make[1]: *** [src/app/CMakeFiles/qgis.dir/all] Error 2
make: *** [all] Error 2

_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
RoeR
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 99
Location: Vienna, Austria

PostPosted: Mon Jan 10, 2011 10:00 pm    Post subject: Reply with quote

hmm
well - it a bit complicated ..
you need osgearth and a few other things to compile it ..
so if its too much effort just leave it ..
it compiles well on any other linux i use - its just the 64bit gentoo here where i have to opengl problem ..
as i already mentioned the solution (to edit one file "on the fly" during compile) i can live with it - it's just not nice to know that there is something wrong with the system ..

thanks a lot anyway for trying it ..

kind regards
RoeR
_________________
Unix is user friendly, it's just very picky about who its friends are.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum