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
2
votes
2 answers

How can I prevent a CMake external project from updating & reinstalling whenever I make?

After much agony, I've successfully arranged for my CMake project to use some library via ExternalProject. I cmake, I make, it works - life is good. However, if I make again, it performs the Update and Install steps for the external project. I…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
2
votes
1 answer

CMake declare dependency of function on ExternalProject_Add

TLDR: My problem is that CMake starts executing this function before downloading the repository. I would like to declare a dependency for that function on ExternalProject_Add so that CMake understands that it should download, build and then…
Pejman
  • 1,328
  • 1
  • 18
  • 26
2
votes
0 answers

cmake's ExternalProject_Add: how to set source, build and install directories

I want to use ExternalProject_Add function to install cmake enabled projects. I need to control the building and installation processes. More specifically, I want that cmake build and install in specific directories. There is an option to select a…
jvtrudel
  • 1,235
  • 3
  • 15
  • 28
2
votes
1 answer

cmake: How do I correctly set variables to precede make in an external project?

I am working on setting up a cross compile project for libraries I need in a pi project. I want to cross the latest mosquitto library and I have figured out what I need to pass to make for it to build correctly. Unfortunately when I define my…
2
votes
1 answer

Forwarding current compiler to ExternalProject

I was trying to use ExternalProject module: ExternalProject_Add( googlebenchmark GIT_REPOSITORY "https://github.com/google/benchmark.git" TLS_VERIFY ON CMAKE_CACHE_DEFAULT_ARGS…
MPogoda
  • 138
  • 1
  • 7
2
votes
0 answers

Dependencies as git submodule with no configured cmake project

I have a project with cmake as its build system. I want project's dependencies to be pulled as git submodules and their build process to be integrated into one cmake build process for whole project. If a dependency is also using cmake as it's build…
2
votes
1 answer

How to get ExternalProject_Add to download library?

I put together a simple CMakeLists.txt file that has a single call to ExternalProject_Add, but the project is never downloaded. Do I need to add something more to the file? cmake_minimum_required(VERSION 3.2) include(ExternalProject) # Download and…
Andrej Pavlovic
  • 364
  • 4
  • 12
2
votes
1 answer

missing project after using ExternalProject_Add

I'm using VS2012+cmake2.8.12. My problem is that CMake failed to generate the correct path to my external project. For example: Project("{...}") = "external", "external.vcxproj", "..." whereas 'external.vcxproj' should be something like…
user11869
  • 1,083
  • 2
  • 14
  • 29
1
vote
1 answer

CMake run custom command with externalproject's target

I have a subproject in my project for generating code used in the project, however i want to include it using ExternalProject so it can be built and ran regardless of the toolchain i use for the main project. It mostly works except i can't figure…
mat
  • 314
  • 1
  • 3
  • 9
1
vote
1 answer

Integrate pre-compiled libraries into C++ codebase with CMake ExternalProject

I want to integrate CasADi into a CMake-based C++ codebase as an ExternalProject. For this purpose, I would like to use pre-compiled libraries because building from source is not recommended. So far, I have only managed to write the…
fdev
  • 127
  • 12
1
vote
0 answers

Import targets from external CMakeLists.txt file, having already built the external source

I am trying to integrate the Refinitiv Real-Time SDK into my own application. I have downloaded the source code and built the libraries. Typically you would then expect there to be an INSTALL target, which would install the libraries and headers…
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
1
vote
2 answers

ExternalProject_Add for Makefile project error during build

I am trying to add Postgresql as a dependency for my project for which I am using ExternalProject module to download the source from github and build, but the build step fails when running from cmake (cmake --build .). Configure step seems to…
Eqbal
  • 4,722
  • 12
  • 38
  • 47
1
vote
1 answer

CMake: Best practices for differing lib paths with ExternalProject_Add

I have a small project whose CMakeLists.txt looks something like this: include(ExternalProject) ExternalProject_Add(gainput_project PREFIX gainput GIT_REPOSITORY https://github.com/jkuhlmann/gainput.git GIT_TAG…
0x5453
  • 12,753
  • 1
  • 32
  • 61
1
vote
1 answer

CMake - unwanted rebuilding when there are no changes

I am working on a project that uses ExternalProject, with BUILD_IN_SOURCE=TRUE, and the entire project (all of the sources and targets) are rebuilt every time, as though make is unable to see that the files already exist. My implementation looks…
Ryan
  • 203
  • 2
  • 9
1
vote
1 answer

How to use CMake to download specific header file from git to create a new interface target?

I'm not sure if this is even the right command, but every google search brings me back to ExternalProject_Add. I thought, based on the documentation, that the only thing I would have to do to download a specific file from a git repository would be…
Krupip
  • 4,404
  • 2
  • 32
  • 54