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
0
votes
1 answer

cmake FetchContent SOURCE_DIR

I am trying to use a small subproject in a cmake master project using the FetchContent method. Specifically, in the CMakeLists.txt of my master project, I have the lines include(FetchContent) FetchContent_Declare(subproject GIT_REPOSITORY…
hfhc2
  • 4,182
  • 2
  • 27
  • 56
0
votes
0 answers

How to import spdlog into a CMake project?

I'm desperately trying to understand how cmake works. I inherited a project that uses cmake, and needs spdlog, but I simply cannot make cmake be able to generate the makefiles, because I cannot produce a working Findspdlog.cmake for find_package to…
Gergely Nagy
  • 73
  • 1
  • 5
0
votes
0 answers

CMake with external projects adds LDFLAGS too early

Cmake on my project uses external projects. I want to recompile everything, but I want to pass -llikwid flag too all linking commands, including all external project. I exported LDFLAGS="-llikwid", but it's not working. The LDFLAGS gets added too…
Bogi
  • 2,274
  • 5
  • 26
  • 34
0
votes
0 answers

Using FetchContent with interdependent libraries yields "prefixed in the build directory" error

Consider the following: I have a project which depends on libwebsockets which is itself dependends on mbedtls. I pull everything in from github using FetchContent, which establishes the dependencies in the build folder (_deps). As I want to build…
glades
  • 3,778
  • 1
  • 12
  • 34
0
votes
1 answer

Installing openssl 3.0.5 in windows 10 using CMake externalproject failing due to config.com file

I was trying to install openssl in external project using CMake in ubuntu , android and Windows. Its working fine in ubuntu . but in windows , Its failing with the following line Performing configure step for 'openssl_external' This version of…
0
votes
1 answer

Bazel doesn't exit after build when called from CMake (ExternalProject_Add)

I am trying to build an external project that uses Bazel as its build system from CMake with Ninja. I am doing this by using ExternalProject_Add ExternalProject_Add(bazel_proj SOURCE_DIR "${bazel_proj_DIR}" CONFIGURE_COMMAND : …
Amin Ya
  • 1,515
  • 1
  • 19
  • 30
0
votes
1 answer

CMake: Can I wrap an ExternalProject in some object that I can just link to my target?

I'm including this library as an external project. Based on the documentation, with some small tweaks, I have this: # LIEF dependency # =========================== set(LIEF_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/LIEF") set(LIEF_INSTALL_DIR …
itzjackyscode
  • 970
  • 9
  • 27
0
votes
1 answer

CMake SWIG dependency on headers of external project

I have a project "A" that depends on another project "B". ProjectB installs some headers, for example B1.h, B2.h. ProjectA tries to create a Python wrapper of B1.h and B2.h, using SWIG. ProjectA uses : ExternalProject_Add(ProjectB ...) to compile…
ConanLord
  • 73
  • 5
0
votes
0 answers

What is a proper way to handle multiple level dependency of third-party libraries in CMake

I am developing a CMake project depending on multiple third-party libraries, and these libraries may further depend on other third-party libraries. The dependencies are all built as static libraries. I use ExternalProject to download and compile the…
Harper
  • 1,794
  • 14
  • 31
0
votes
0 answers

Building external dependency with CMake

I'm trying to compile a C++ project which depends on a 3rd party library, called Foo for example. I'm using the ExternalProject_Add() command in a CMakeLists.txt file for this purpose. However, this library has a dependency, called Bar for example,…
Erwan
  • 41
  • 6
0
votes
0 answers

ExternalProject_Add: how to use build dependencies in your project?

I am trying to build a 3rd-party dependency using ExternalProject_Add (in this case libpqxx): ExternalProject_Add(libpqxx_ext GIT_REPOSITORY https://github.com/jtv/libpqxx GIT_TAG tags/7.4.1 GIT_SHALLOW true …
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
0
votes
0 answers

How to make ExternalProject_Add default build not invoke install

I am adding CMake build support to a make based project. I am using ExternalProject_Add for this. EVerything up to INSTALL_COMMAND works fine. But I want the default target (I guess all target) to not include install. Basically I want default target…
Osada Lakmal
  • 891
  • 2
  • 8
  • 22
0
votes
0 answers

preventing 'make clean' from ExternalProject or add a custom clean with CMake

My project has an external project that I add with its own CMake with the CMake ExternalProject_Add command. Every time I add flags or do a rebuild the external project is also rebuilt and it takes a long time (rebuild of the external project…
0
votes
0 answers

Add slow external project to cmake

I am using an external dependency that is shipped as a tar archive inside the source tree. I am building the autotools project by using ExternalProject_Add This project will almost never change but takes multiple minutes to compile (way longer than…
mame98
  • 1,271
  • 12
  • 26
0
votes
1 answer

How to build projects that aren't in the Visual Studio Solution?

Is there a way to tell Visual Studio to build projects that aren't part of its solution? We've been looking into many different options without success such as nested projects, shared projects, and build events. Example architecture: Project…
DMX David Cardinal
  • 599
  • 2
  • 7
  • 19