Questions tagged [external-project]

CMake's support for obtaining, building and installation of projects distinct from the one currently being processed.

The build management tool CMake supports obtaining, building and installing projects - distinct and separate from the current one it is processing - using the ExternalProjcect() command.

Use this tag for questions regarding this feature.

106 questions
3
votes
0 answers

get_property could not find TARGET, from ExternalProject

I'm running into a CMake issue that I am a little stumped by. It involves a CMake project that builds dependencies for an application I develop at work. I now have to add a new dependency, libnest2d, which itself also has three dependencies, of…
Ghostkeeper
  • 2,830
  • 1
  • 15
  • 27
3
votes
1 answer

CMake ExternalProject_Add rebuilds every time

I have OpenSSL as a part of my CMake project. Since it does not have its own CMake file I build it as an ExternalProject. Unfortunately every time I rebuild my project the ExternalProject is also rebuilt and it is the biggest and slowest part by…
3
votes
2 answers

Error linking library built with ExternalProject_Add to project configured with CMAKE_CXX_COMPILER

My CMake project uses the gtest library which I add using the ExternalProject module. This normally works but when I configure the project to use the Clang 3.8 tool chain, e.g.: cmake -DCMAKE_CXX_COMPILER=clang++-3.8 .. cmake --build . I receive…
John McFarlane
  • 5,528
  • 4
  • 34
  • 38
3
votes
1 answer

CMake: How to build an external project using all cores on *nix systems?

I'm working on a CMake based project that has a dependency on a gigantic third party codebase that also uses CMake. I'm including the third party project via the ExternalProject_Add mechanism. That project defaults to using Makefiles, although the…
acronce
  • 383
  • 4
  • 9
3
votes
1 answer

How to add libraries installed with ExternalProject_Add to target includes

I'm trying to include external libraries to a cmake project through ExternalProject_Add. To try out this feature I've created a minimal working example that involves adding pugixml to the project with ExternalProject_Add. However, I'm having…
RAM
  • 2,257
  • 2
  • 19
  • 41
3
votes
1 answer

How to make a multi-config generator behave like a single-config generator in a project using ExternalProjects?

I am using CMake to build a cross-platform (e.g. Linux/Windows) application which uses also thirdparty libraries as external projects. I'm aware of the fact that MSVC is a multi-configuration environment, hence CMAKE_BUILD_TYPE is not used, instead…
harsszegi
  • 369
  • 2
  • 15
3
votes
1 answer

How to set command argument in externalproject_add

I want to create a cmake script to build the zlib automatically in my project. I added externalproject_add(zlib PREFIX . # download step GIT_REPOSITORY git@github.com:madler/zlib.git GIT_TAG v1.2.8 # configure step SOURCE_DIR zlib …
David S.
  • 10,578
  • 12
  • 62
  • 104
3
votes
1 answer

How to use existing QMake project (.pro project file) as "external project" in CMake?

Is there a concise doc or example for how to use an existing QMake project with .pro project file as an "external project" in CMake? This can somewhat be done in qtcreator by marking one project as dependency of another, but it would be nice to…
peter karasev
  • 2,578
  • 1
  • 28
  • 38
3
votes
2 answers

How to do Parallel CMake ExternalProject Builds

When building a CMake project (e.g. on Windows), I can perform a parallel build by executing the following command: cmake --build . -- /m The /m switch is passed to msbuild and I get parallelized builds. However, if I have some external project in…
3
votes
1 answer

How to specify target with ExternalProject_Add?

Is it possible to build only a specific target when using ExternalProject? In particular, I need to download and build only the MPI version of the OpenCoarrays library. I tried ExternalProject_Add( OpenCoarrays-fallback EXCLUDE_FROM_ALL 1 URL…
Raul Laasner
  • 1,475
  • 1
  • 17
  • 30
3
votes
1 answer

Use shell command as INSTALL_COMMAND to ExternalProject_Add

Is it possible to use any shell command for the INSTALL_COMMAND phase of cmake's ExternalProject_Add? e.g. ExternalProject_Add(leveldb GIT_REPOSITORY git@github.com:google/leveldb.git GIT_TAG v1.18 CONFIGURE_COMMAND…
zcourts
  • 4,863
  • 6
  • 49
  • 74
2
votes
0 answers

Install IPOPT locally into C++ codebase with CMake ExternalProject

I would like to use Ipopt in a CMake-based project using ExternalProject. The library should be installed locally and automatically in the build folder so that the user must not go through any hassle. I can do this for simple enough repositories…
fdev
  • 127
  • 12
2
votes
0 answers

Why doesn't CMake's `ExternalProject_Add` command build this autotools library?

I'm trying to use CMake's ExternalProject_Add command to build an Autotools project on Ubuntu 18.04 using cmake 3.15.7. Here is the command I'm using: set(THIRD_PARTY_DIRS ${CMAKE_SOURCE_DIR}/third_party) set(RAPTOR_SOURCE_DIR…
CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106
2
votes
1 answer

Getting external dependency with cmake

I am writing a small library in c++ with no external dependencies, except for testing where I want to use catch2. So I'd rather not include the project and thought I could just download it when needed with cmake, but so far it looks like cmake only…
ZerataX
  • 43
  • 5
2
votes
1 answer

CMake: Download and unpack multiple files in ExternalProject_Add

I would like to compile OpenSSL automatically on Windows using the ExternalProject features of CMake. In the configuration, I can specify one download URL. But I need multiple additional files which I'd like to be unpacked into the same source…
Frank Blabu
  • 181
  • 13