Skip to content
Ruslan Baratov edited this page Jul 6, 2014 · 33 revisions

Layout for project <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>

Tagged layout

See hunter_download.cmake.in. Layout of 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_ROOT}/Download/<name> # use same source for all projects, HUNTER_PACKAGE_DOWNLOAD_DIR (see below)
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> # value of CMAKE_INSTALL_PREFIX, HUNTER_PACKAGE_INSTALL_DIR

HUNTER_BASE is a directory inside HUNTER_ROOT:

${HUNTER_ROOT}/Base # EP_BASE for all projects, HUNTER_BASE
${HUNTER_ROOT}/Download # see above, HUNTER_PACKAGE_DOWNLOAD_DIR
${HUNTER_ROOT}/Source # Hunter project itself source
${HUNTER_ROOT}/Source/.git # if cloned by git
${HUNTER_ROOT}/Source/cmake/Hunter # master file
${HUNTER_ROOT}/Source/cmake/config.cmake # https://github.com/ruslo/hunter/blob/master/cmake/config.cmake
${HUNTER_ROOT}/Source/cmake/version.cmake # https://github.com/ruslo/hunter/blob/master/cmake/version.cmake
  • tag HUNTER_INSTALL_TAG. Default tag value is default. Setted in [master] (https://github.com/ruslo/hunter/blob/master/cmake/Hunter) file
  • name HUNTER_PACKAGE_NAME
  • component HUNTER_PACKAGE_COMPONENT need to control install components separately. Otherwise if project have build one component next component will not be build because corresponding Stamp/<name>-install already touched.
  • debug release ... HUNTER_PACKAGE_VARIANTS. For optimization, do not generate/run project if Stamp/<name>-install already touched
  • HUNTER_PACKAGE_BASENAME: <name[-component]-tag>

Additionally directory Toolchains hold some cached info about used toolchain:

${HUNTER_BASE}/Toolchains/<tag>/default_generator.info
${HUNTER_BASE}/Toolchains/<tag>/toolchain.info

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_ROOT}/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