external-project

How do I set CMake policy and property on an external project added using ExternalProject_Add

谁都会走 提交于 2020-12-13 03:21:44
问题 I have a cmake project that uses an external project using CMake's ExternalProject_Add feature. Is there a way to set policy and property on the external project? I would like following policy and property that is set in my project to be forwarded also to external project so that static multi-threaded windows runtime libraries are used instead of dynamic ones. cmake_policy(SET CMP0091 NEW) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") 回答1: You can simply add those

How to configure ExternalProject during main project configuration?

∥☆過路亽.° 提交于 2020-01-12 04:43:27
问题 The CMake's ExternalProject allows to define how to an external project is going to be downloaded, configured, built and installed. All whose steps are going to be performed at the build time. I would like to perform the configuration step of an external project during configuration of the main project. When the external project configuration is done the description of imported targets are available so the external project can be loaded with find_package() function. Is it possible to build

Use ExternalProject_Add to include Opus in Android

怎甘沉沦 提交于 2019-12-22 18:17:32
问题 This is probably quite simple. I have an Android project that uses NDK. I will like to include the opus source code in the native code. I have tried using the ExternalProject_Add property of CMake but my native code still cannot import headers from the Opus library and fails to build. Below is my ExternalProject_Add definition: ExternalProject_Add(project_opus URL https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> BUILD

CMake - linking to library downloaded from ExternalProject_add()

我们两清 提交于 2019-12-17 07:12:16
问题 I am trying to use ExternalProject_add() to download/install dependencies. It installs fine, but I can't figure out how to actually link the libraries after they are downloaded. I want to call target_link_libraries() on the library that was just downloaded, but the path to the library will vary by system. If this were a system dependency, I could just call find_package() - but the packages weren't installed on the default search path. I don't think you can specify a search path for find

CMake: How to build external projects and include their targets

旧街凉风 提交于 2019-12-17 05:37:28
问题 I have a Project A that exports a static library as a target: install(TARGETS alib DESTINATION lib EXPORT project_a-targets) install(EXPORT project_a-targets DESTINATION lib/alib) Now I want to use Project A as an external project from Project B and include its built targets: ExternalProject_Add(project_a URL ...project_a.tar.gz PREFIX ${CMAKE_CURRENT_BINARY_DIR}/project_a CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> ) include(${CMAKE_CURRENT_BINARY_DIR}/lib/project_a/project_a

code builds cleanly with cmake, fails when added as an external project

扶醉桌前 提交于 2019-12-13 06:33:46
问题 Question summary. I have a project A that I build using CMake, which compiles cleanly. However, when I pull A into another project B using CMake's ExternalProject_Add command, compilation fails when it reaches the point of building A. The kind of errors I get. Compiling B gives errors like this one warning: rvalue references are a C++11 extension [-Wc++11-extensions] when it starts compiling A (which again, is brought in by ExternalProject_Add). Note that -std=c++11 is set in all involved

CMake: GLFW as ExternalProject

≯℡__Kan透↙ 提交于 2019-12-08 21:40:39
问题 Issue I am trying to make a project that uses GLFW. For this project I am using CMake as a build system. I would like to make it so the user just has to build my project with CMake, and as part of the process GLFW will get built and linked appropriately. To do this I am adding GLFW as a ExternalProject in my CMake file: EXTERNALPROJECT_ADD(glfw GIT_REPOSITORY https://github.com/glfw/glfw.git GIT_TAG 3.1 INSTALL_DIR "${PROJECT_BINARY_DIR}/libs/glfw" ) However when I generate the project(For

Forwarding current compiler to ExternalProject

时光毁灭记忆、已成空白 提交于 2019-12-08 01:03:35
问题 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 -DBENCHMARK_ENABLE_TESTING:BOOL=OFF SOURCE_DIR "${CMAKE_BINARY_DIR}/third_party/gbenchmark" INSTALL_DIR "${CMAKE_BINARY_DIR}/third_party" )` And there is an issue I've come up with: this module for some reason doesn't forward compiler, used in (parent) cmake, as well as CMAKE_BUILD_TYPE. I've tried to use CMAKE_CACHE

What is INSTALL_DIR useful for in ExternalProject_Add command?

試著忘記壹切 提交于 2019-12-05 13:11:44
问题 I don't understand the usage of INSTALL_DIR in ExternalProject_Add command. I try to use it but it does not seem to work. Here is an example of a CMakeLists.txt, using Eigen library which compiles quickly: cmake_minimum_required (VERSION 2.6) project (example CXX) include(ExternalProject) include(ProcessorCount) set(CMAKE_VERBOSE_MAKEFILE ON) ProcessorCount(N) if(NOT N EQUAL 0) set(CMAKE_BUILD_FLAGS -j${N}) endif() ExternalProject_Add ( mylib PREFIX myprefix DOWNLOAD_COMMAND wget http:/

What is INSTALL_DIR useful for in ExternalProject_Add command?

我们两清 提交于 2019-12-03 23:59:19
I don't understand the usage of INSTALL_DIR in ExternalProject_Add command. I try to use it but it does not seem to work. Here is an example of a CMakeLists.txt, using Eigen library which compiles quickly: cmake_minimum_required (VERSION 2.6) project (example CXX) include(ExternalProject) include(ProcessorCount) set(CMAKE_VERBOSE_MAKEFILE ON) ProcessorCount(N) if(NOT N EQUAL 0) set(CMAKE_BUILD_FLAGS -j${N}) endif() ExternalProject_Add ( mylib PREFIX myprefix DOWNLOAD_COMMAND wget http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz && tar xvzf 3.2.4.tar.gz -C mylib --strip-components=1 ) I chose