1

I'm currently building Boost via ExternalProject_Add with this command:

ExternalProject_Add(Boost
  PREFIX workspace/Boost
  URL http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
  URL_MD5 51528a0e3b33d9e10aaa311d9eb451e3
  UPDATE_COMMAND ./bootstrap.sh
  CONFIGURE_COMMAND ""
  BUILD_COMMAND ./b2 --layout=tagged link=static -s NO_BZIP2=1 cxxflags="-std=c++11" install
  INSTALL_COMMAND ""
  BUILD_IN_SOURCE 1
)

The problem is that this will always build both release and debug variants/configurations for boost, no matter which configuration I actually want to build. How can I "pass" the current configuration to the ExternalProject_Add command in this case?

This seems to just work when the "internal" build tool, i.e. the one called by ExternalProject_Add is also CMake. I have no idea how to pass that information to Boost's b2, however.

The above sample is for Windows / VisualStudio2013, so a multi configuration CMake target, but ideally, I'd have something that works for single configuration targets as well.

ltjax
  • 15,837
  • 3
  • 39
  • 62
  • 1
    `*_COMMAND` arguments for [ExternalProject_Add](https://cmake.org/cmake/help/v3.4/module/ExternalProject.html) accepts [generator expressions](https://cmake.org/cmake/help/v3.4/manual/cmake-generator-expressions.7.html). Using these expressions you may specify any configuration-dependent options for `BUILD_COMMAND`, so it will build proper type of boost. – Tsyvarev Feb 20 '16 at 12:09

0 Answers0