[CMake] ExternalProject_Add and inheritance

CHEVRIER, Marc marc.chevrier at sap.com
Fri Dec 11 02:44:38 EST 2015


With CMake, you can control compilation and link flags with the following environment variables:

  *   CC: specify C compiler
  *   CFLAGS: C compiler flags
  *   CXX: specify C++ compiler
  *   CXXFLAGS: C++ compiler flags
  *   LDFLAGS: linker flags

And to finish you can overload make command for generation using CMAKE_COMMAND option of ExternalProject_Add:
CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…” “${CMAKE_COMMAND}”



From: CMake <cmake-bounces at cmake.org<mailto:cmake-bounces at cmake.org>> on behalf of Cedric Doucet <cedric.doucet at inria.fr<mailto:cedric.doucet at inria.fr>>
Date: Thursday 10 December 2015 at 18:21
To: "cmake at cmake.org<mailto:cmake at cmake.org>" <cmake at cmake.org<mailto:cmake at cmake.org>>
Subject: [CMake] ExternalProject_Add and inheritance


Hello,

I use the ExternalProject_Add command to manage third-party libraries.
In the same time, I need to overcome some compatibility problems between GCC 4 and GCC 5 (strings are not defined in the same way in the STL).
The solution I use is the one given here:
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
It allows me to force to use the libstdc++.so given by the GCC repository given to the cmake command.

The problem is that trick does not work with the ExternalProject_Add command because configuration steps of third-party libraries are autonomous.
Do you know how to solve the problem?

For example, if I use the ExternalProject_Add command to manage a third-library whose configuration also depends on a cmake script, how could I tell this script to use the compilers and the libstdc++.so I provided to my own cmake script?

Best,

Cédric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151211/680ddf7f/attachment.html>


More information about the CMake mailing list