Skip to content
ruslo edited this page Dec 16, 2013 · 33 revisions

Project with name <name>

TMP_DIR      = <base>/tmp/<name>
STAMP_DIR    = <base>/Stamp/<name>
DOWNLOAD_DIR = <base>/Download/<name>
SOURCE_DIR   = <base>/Source/<name>
BINARY_DIR   = <base>/Build/<name>
INSTALL_DIR  = <base>/Install/<name>

http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:ExternalProject

Tagged layout

See hunter_download.cmake.in. Project with name <name[-component]-tag[-debug|-release]>

TMP_DIR      = ${HUNTER_BASE}/tmp/<name[-component]-tag[-debug|-release]> # unchanged
STAMP_DIR    = ${HUNTER_BASE}/Stamp/<name[-component]-tag[-debug|-release]> # unchanged
DOWNLOAD_DIR = ${HUNTER_BASE}/Download/<name> # use same source for all projects, HUNTER_PACKAGE_DOWNLOAD_DIR
SOURCE_DIR   = ${HUNTER_BASE}/Source/<name> # use same source for all projects, HUNTER_PACKAGE_SOURCE_DIR
BINARY_DIR   = ${HUNTER_BASE}/Build/<name[-component]-tag[-debug|-release]> # unchanged
INSTALL_DIR  = ${HUNTER_BASE}/Install/<tag> # see CMAKE_INSTALL_PREFIX, HUNTER_PACKAGE_INSTALL_DIR

Default tag value is default.

  • tag = HUNTER_INSTALL_TAG
  • name = HUNTER_PACKAGE_NAME

component need to control install components separately. Otherwise if project build one component next will not be build because corresponding stamps already touched.

Example

  • library foo
  • CMAKE_DEBUG_POSTFIX equal d
  • generator Unix Makefiles (Release and Debug builded separately)
  • toolchains: libcxx and libstdcxx

Result will be:

  • create external projects:
  • foo-libcxx-release
  • foo-libcxx-debug
  • foo-libstdcxx-release
  • foo-libstdcxx-debug
  • TMP_DIR:
  • ${HUNTER_BASE}/tmp/foo-libcxx-release
  • ${HUNTER_BASE}/tmp/foo-libstdcxx-release
  • ${HUNTER_BASE}/tmp/foo-libcxx-debug
  • ${HUNTER_BASE}/tmp/foo-libstdcxx-debug
  • STAMP_DIR:
  • ${HUNTER_BASE}/Stamp/foo-libcxx-release
  • ${HUNTER_BASE}/Stamp/foo-libstdcxx-release
  • ${HUNTER_BASE}/Stamp/foo-libcxx-debug
  • ${HUNTER_BASE}/Stamp/foo-libstdcxx-debug
  • DOWNLOAD_DIR:
  • ${HUNTER_BASE}/Download/foo
  • SOURCE_DIR:
  • ${HUNTER_BASE}/Source/foo
  • BINARY_DIR:
  • ${HUNTER_BASE}/Build/foo-libcxx-release
  • ${HUNTER_BASE}/Build/foo-libstdcxx-release
  • ${HUNTER_BASE}/Build/foo-libcxx-debug
  • ${HUNTER_BASE}/Build/foo-libstdcxx-debug
  • INSTALL_DIR:
  • ${HUNTER_BASE}/Install/libcxx
  • ${HUNTER_BASE}/Install/libstdcxx

When using toolchain libcxx:

  • FOO_ROOT will be setted to ${HUNTER_BASE}/Install/libcxx
  • find_package will return foo_LIBRARIES as debug;${HUNTER_BASE}/Install/libcxx/food.a;optimized;${HUNTER_BASE}/Install/libcxx/foo.a

... using toolchain libstdcxx:

  • FOO_ROOT will be setted to ${HUNTER_BASE}/Install/libstdcxx
  • find_package will return foo_LIBRARIES as debug;${HUNTER_BASE}/Install/libstdcxx/food.a;optimized;${HUNTER_BASE}/Install/libstdcxx/foo.a

Clone this wiki locally