Templates for frameworks CMake files

Alexander Neundorf neundorf at kde.org
Tue Sep 24 17:52:01 UTC 2013


On Tuesday 24 September 2013, Stephen Kelly wrote:
> Aurélien Gâteau wrote:
> > Hi,
> > 
> > I have been playing around with itemviews CMake files and put together
> > some templates for the top level CMakeLists.txt and *Config.cmake.in. You
> > can find them attached there. Any one against me adding those to the
> > repository?
> > 
> > Aurélien
> > CMakeLists.txt
> > 
> >   cmake_minimum_required(VERSION 2.8.11)
> 
> This template will be out of date whenever we require a new cmake.
> 
> >  project(FooBar)
> >  
> >  find_package(ECM 0.0.8 REQUIRED NO_MODULE)
> 
> The latest ECM is 0.0.9
> 
> >  set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
> >  
> >  set(REQUIRED_QT_VERSION "5.2.0")
> 
> ECM and Qt version bumps are not as much an issue as the cmake one. The ECM
> and Qt version deps are not as likely to change.
> 
> >  # Required Qt5 components to build this framework
> >  # For example:
> >  # find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS
> >  # Widgets)
> 
> Simplify by putting NO_MODULE before REQUIRED and removing COMPONENTS:
> 
>  find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets)
> 
> >  if(NOT kdelibs_SOURCE_DIR)
> >  find_package(KF5 5.0.0 REQUIRED MODULE COMPONENTS CMake Compiler
> >  InstallDirs) # Required KF5 frameworks to build this framework
> 
> I still think this stuff is odd. We're building KF5, yet we need to find
> KF5 to do so.


If you have a better idea, feel free to change it.
Those files contain KDE-related stuff, the KDE compiler- and cmake settings 
and KDE install dirs.

There is no tier0 kde-cmake-modules repository, that was not wanted. Still, by 
finding (loading) FindKF5.cmake we load those settings, to avoid having a 
tier0 frameworks.

Alex


More information about the Kde-frameworks-devel mailing list