[CMake] ExternalProject and install dir

Hans van den Bogert hansbogert at gmail.com
Wed Aug 13 08:03:09 EDT 2014


Hi, 

I’m using ExternalProject, but the documentation does not really reflect what I am witnessing

I have a Project X which is included through ExternalProject in Project A

Project X has no PREFIX set in its CMakeLists

I include project X like this:
  
  include(ExternalProject)
  ExternalProject_Add(x
    PREFIX x
    URL ${CMAKE_CURRENT_SOURCE_DIR}/externals/x
  )

Now according to the documentation the installed files should be available in the top of the prefix-dir, in this case ${CMAKE_BINARY_DIR}/x/ [installed files], though I can only see the src dir of ‘x’ and when looking at the output of the make of ‘x’ I can see its trying to install to default directories in this case '/usr/local’.

In the documentation, doesn’t the install_dir not mean the same as the install directory where project ‘x’ will install its files? Because one would think so because BINARY_DIR does have these semantics.

For reference from the documentation:

  The *_DIR options specify directories for the project, with default directories computed as follows. If the PREFIX option is given to ExternalProject_Add() or the EP_PREFIX directory property is set, then an external project is built and installed under the specified prefix:

  TMP_DIR      = <prefix>/tmp
  STAMP_DIR    = <prefix>/src/<name>-stamp
  DOWNLOAD_DIR = <prefix>/src
  SOURCE_DIR   = <prefix>/src/<name>
  BINARY_DIR   = <prefix>/src/<name>-build
  INSTALL_DIR  = <prefix>




More information about the CMake mailing list