[CMake] Platform Finding modules

Eric Noulard eric.noulard at gmail.com
Tue Nov 29 14:37:15 EST 2011


2011/11/29 Alexander Neundorf <a.neundorf-work at gmx.net>:
> On Tuesday 29 November 2011, Laszlo Papp wrote:
>> Hi,
>>
>> Are there any modules to realize the fact what platform I build on top
>> of ? I could imagine something like
>> Find{Harmattan,Fremantle,Maemo,MeeGo,Tizen,AnyPlatform}.cmake in wider
>> usage.
>
> No, currently not.
> These are basically different Linux distributions, is this an acceptable
> approach ?
> If so, maybe to Platforms/Linux.cmake code for detecting the distribution
> could be added, and some variable could be set, e.g.
> CMAKE_LINUX_DISTRIBUTION_NAME or something like this.

I use the attached file in order to build "SPECIFIC" system informations
like;

SPECIFIC_COMPILER_NAME  the name of the compiler used.
SPECIFIC_SYSTEM_VERSION_NAME the system version "name", WinXP, Debian,
SuSE etc...
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR the CPack that is "usually"
used on this specific system
 Debian or Ubuntu --> DEB, Windows --> NSIS, Fedora, RedHat, SuSE --> RPM etc...

For linux distros I use "lsb_release" if it is found or "/etc/issue"
as a fallback
may be you can pick-up some code in there.

The file is meant to be included in a CMakeLists.txt for which the
"project" command
has already been called.

> Does that sound reasonable ?

Looks reasonable for me since I use similar feature.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list