On Wednesday 07 August 2013 14:55:40 Jan Kundrát wrote:
> On Wednesday, 7 August 2013 07:34:54 CEST, Pali Rohár wrote:
> > Can you test to compile my gsoc branch (with decreased cmake
> > version) on your target systems? Myabe
> > POSITION_INDEPENDENT_CODE property will also work with
> > older cmake...
> 
> As you said, the POSITION_INDEPENDENT_CODE property got added
> in cmake 2.8.9.
> 
> Using commit ea142719e01f729fcbdfd7fd888008f3ef31f1c5, cmake
> 2.8.7, and the following changes on top of your code:
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 65c1d38..ff2433c 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -1,5 +1,5 @@
>  # The Qt5's qt5_use_modules and POSITION_INDEPENDENT_CODE is
> only available on 2.8.9 or later -- sweet, isn't it?
> -cmake_minimum_required(VERSION 2.8.9)
> +cmake_minimum_required(VERSION 2.8.7)
>  project(trojita)
>  SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
> 
> I can confirm that this version builds; however, the compiler
> is invoked without -fPIC:
> 
> [  2%] Building CXX object
> CMakeFiles/Common.dir/src/Common/DeleteAfter.cpp.o
> /usr/bin/c++   -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB
> -DQT_TEST_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
> -DQT_STRICT_ITERATORS -DTROJITA_HAVE_ZLIB -DHAS_GITVERSION
> -Wall -g -fvisibility=hidden -fvisibility-inlines-hidden
> -I/usr/include/qt4 -I/usr/include/qt4/QtWebKit
> -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtTest
> -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtNetwork
> -I/usr/include/qt4/QtCore
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/src
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/bui
> ld -I/usr/share/qt4/mkspecs/default
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/src/
> Gui
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/src
> /mimetypes-qt4/io
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/src
> /Harmattan/qmlapplicationviewer
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/tes
> ts
> -I/home/jkt/work/prog/_trojita-build/scratch/pali-trojita/tes
> ts/test_LibMailboxSync -o
> CMakeFiles/Common.dir/src/Common/DeleteAfter.cpp.o -c
> /home/jkt/work/prog/_trojita-build/scratch/pali-trojita/src/C
> ommon/DeleteAfter.cpp
> 

Ok, then POSITION_INDEPENDENT_CODE is really on 2.8.9+

> 
> Furtermore, when I try to build with -DWITH_KDE=1, cmake
> errors out because my version of KDE apparently requires
> newer cmake:
> 
> -- Building the desktop version
> CMake Error at
> /usr/share/apps/cmake/modules/FindKDE4Internal.cmake:350
> (cmake_minimum_required):
>   CMake 2.8.9 or higher is required.  You are running version
> 2.8.7 Call Stack (most recent call first):
>   /opt/cmake-2.8.7/share/cmake-2.8/Modules/FindKDE4.cmake:95
> (FIND_PACKAGE) CMakeLists.txt:18 (find_package)
> 
> It might be interesting to see what KDE version ships with
> Ubuntu 12.04 (as used on the CI machines).
> 
> What KDE versions and what distribution versions would you
> like to support for the KDE integration?
> 

KDE code which is in Trojita should work on any KDE4 version. 
Only Akonadi needs KDE4.5+.

> Anyway, here are my suggestions:
> 
> - Set the POSITION_INDEPENDENT_CODE on a global basis to
> prevent excess cmake clutter. Some distributions (Fedora)
> strongly suggest to enable -fPIC on applications which
> process untrusted input, and Trojita qualifies.
> 
> - When running on old cmake, check for gcc or clang and if
> that is the case, manually add -fPIC to $CMAKE_CXX_FLAGS.
> 
> Cheers,
> Jan

Ok.

-- 
Pali Rohár
pali.ro...@gmail.com

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to