external-project

Unknown CMake command “ExternalProject_Add”

此生再无相见时 提交于 2019-11-29 09:20:55
I have following CMakeLists.txt file: cmake_minimum_required (VERSION 3.2 FATAL_ERROR) project (utils VERSION 1.0.0 LANGUAGES CXX) ExternalProject_Add(json-c GIT_REPOSITORY "https://github.com/json-c/json-c.git" UPDATE_COMMAND git pull "https://github.com/json-c/json-c.git" CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure --prefix=${SDL_INSTALL_DIR} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/json-c INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR} ) I want to add json-c library to my project, but when I run cmake I'm getting error: Unknown CMake command "ExternalProject_Add". My CMake

How to use CMake ExternalProject_Add or alternatives in a cross platform way?

狂风中的少年 提交于 2019-11-28 18:38:31
I would like to build a third-party project that already has CMake as part of my project's CMake strips. ExternalProject_Add is for this purpose, but I have found it can only be made to work with a specific generator, and I wanted to work on many platforms easily. For example here is my external project add script for zlib, which has its own CMakeLists.txt: set(USE_PROJECT_CMAKE_MODULE_PATH "-DCMAKE_MODULE_PATH=${MAKE_MODULE_PATH}") ExternalProject_Add(ZLIB SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/zlib DOWNLOAD_COMMAND "" UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE

Unknown CMake command “ExternalProject_Add”

╄→尐↘猪︶ㄣ 提交于 2019-11-27 23:23:01
问题 I have following CMakeLists.txt file: cmake_minimum_required (VERSION 3.2 FATAL_ERROR) project (utils VERSION 1.0.0 LANGUAGES CXX) ExternalProject_Add(json-c GIT_REPOSITORY "https://github.com/json-c/json-c.git" UPDATE_COMMAND git pull "https://github.com/json-c/json-c.git" CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure --prefix=${SDL_INSTALL_DIR} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/json-c INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR} ) I want to add json-c library to my

CMake ExternalProject_Add() and FindPackage()

青春壹個敷衍的年華 提交于 2019-11-27 06:59:40
Is there are proper way to find a library (via FindPackage() ) which was built with ExternalProject_Add() ? The problem is that CMake cannot find the library at CMake-time because the external library gets build at compile time. I know that it is possible to combine these two CMake function when building the library and the project in a superbuild but I want to use it in a normal CMake project. In fact I would like to build VTK 6 with ExternalProject_Add and find it with FindPackage all inside my CMake project. there is a way to do this. but it´s kind of hackish. you basically add a custom

How do I use CMake ExternalProject_Add or alternatives in a cross-platform way?

最后都变了- 提交于 2019-11-27 01:08:59
问题 I would like to build a third-party project that already has CMake as part of my project's CMake strips. ExternalProject_Add is for this purpose, but I have found it can only be made to work with a specific generator, and I wanted it to work on many platforms easily. For example, here is my external project with an added script for zlib, which has its own CMakeLists.txt: set(USE_PROJECT_CMAKE_MODULE_PATH "-DCMAKE_MODULE_PATH=${MAKE_MODULE_PATH}") ExternalProject_Add(ZLIB SOURCE_DIR ${CMAKE

CMake: How to build external projects and include their targets

巧了我就是萌 提交于 2019-11-26 23:45:25
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-targets.cmake) The problem is that the include file does not exist yet when CMakeLists of Project B is run.

How to build cmake ExternalProject while configurating main one?

一笑奈何 提交于 2019-11-26 21:45:36
问题 It can be a pain to refrence ExternalProjects when their install targets are messed up. So one may want to build and install ExternalProjects once before generating main project files for given project. Is it possible with CMake and how to do it? 回答1: You may use cmake call within execute_process for configure and build CMake project, which contains ExternalProject: other_project/CMakeLists.txt : project(other_project) include(ExternalProject) ExternalProject_Add(<project_name> <options...>)

CMake ExternalProject_Add() and FindPackage()

半城伤御伤魂 提交于 2019-11-26 17:36:38
问题 Is there are proper way to find a library (via FindPackage() ) which was built with ExternalProject_Add() ? The problem is that CMake cannot find the library at CMake-time because the external library gets build at compile time. I know that it is possible to combine these two CMake function when building the library and the project in a superbuild but I want to use it in a normal CMake project. In fact I would like to build VTK 6 with ExternalProject_Add and find it with FindPackage all