Skip to content
ruslo edited this page Nov 9, 2013 · 33 revisions
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.

TMP_DIR      = ${HUNTER_BASE}/tmp/<name-tagged[-debug]> # unchanged
STAMP_DIR    = ${HUNTER_BASE}/Stamp/<name-tagged[-debug]> # unchanged
DOWNLOAD_DIR = ${HUNTER_BASE}/Download/<name> # use same source for all projects
SOURCE_DIR   = ${HUNTER_BASE}/Source/<name> # use same source for all projects
BINARY_DIR   = ${HUNTER_BASE}/Build/<name-tagged[-debug]> # unchanged
INSTALL_DIR  = ${HUNTER_BASE}/Install/<tag> # set in CMAKE_INSTALL_PREFIX

Default tag value is [default][1]

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
  • food-libcxx
  • foo-libstdcxx
  • food-libstdcxx
  • TMP_DIR:
  • ${HUNTER_BASE}/tmp/foo-libcxx
  • ${HUNTER_BASE}/tmp/foo-libstdcxx
  • ${HUNTER_BASE}/tmp/food-libcxx
  • ${HUNTER_BASE}/tmp/food-libstdcxx
  • STAMP_DIR:
  • ${HUNTER_BASE}/Stamp/foo-libcxx
  • ${HUNTER_BASE}/Stamp/foo-libstdcxx
  • ${HUNTER_BASE}/Stamp/food-libcxx
  • ${HUNTER_BASE}/Stamp/food-libstdcxx
  • DOWNLOAD_DIR:
  • ${HUNTER_BASE}/Download/foo
  • SOURCE_DIR:
  • ${HUNTER_BASE}/Source/foo
  • BINARY_DIR:
  • ${HUNTER_BASE}/Build/foo-libcxx
  • ${HUNTER_BASE}/Build/foo-libstdcxx
  • ${HUNTER_BASE}/Build/food-libcxx
  • ${HUNTER_BASE}/Build/food-libstdcxx
  • 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/foo.a;optimized;${HUNTER_BASE}/Install/libcxx/food.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/foo.a;optimized;${HUNTER_BASE}/Install/libstdcxx/food.a [1]: https://github.com/ruslo/polly#defaultcmake

Clone this wiki locally