https://github.com/sarcasm/cmake-superbuild
CMake SuperBuild template using External_Projects
https://github.com/sarcasm/cmake-superbuild
Last synced: 9 months ago
JSON representation
CMake SuperBuild template using External_Projects
- Host: GitHub
- URL: https://github.com/sarcasm/cmake-superbuild
- Owner: Sarcasm
- License: mit
- Created: 2014-01-12T22:40:29.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-15T14:43:43.000Z (over 12 years ago)
- Last Synced: 2025-04-30T16:44:17.760Z (about 1 year ago)
- Language: C++
- Size: 156 KB
- Stars: 85
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cmake-superbuild
================
CMake SuperBuild template using External_Projects
How does it work?
-----------------
The top-level CMakeLists.txt works in a has 2 stages:
1. `USE_SUPERBUILD=ON` [the default]: Deleguates the generation to
SuperBuild.cmake which will download and build the dependencies and then
re-invoke the top-level CMakeLists.txt but this time with `USE_SUPERBUILD`
set to `OFF`.
2. This step, when `USE_SUPERBUILD=OFF`, is the usual CMakeLists of the project,
in a SuperBuild mode this will reside in the subdirectory blah of the
SuperBuild directory.
Example using with the default method `USE_SUPERBUILD=ON`:
$ mkdir super-build && cd super-build
$ cmake ..
$ # assuming the Unix Makefile generator was the default
$ make
$ # the project build directory is resides in blah/
$ cd blah/
$ pwd
<...>/cmake-superbuild/build/blah
$ ./bin/blah
Hello World!
Example without the superbuild, the dependencies are taken care in some other
ways:
$ mkdir build && cd build
$ # assuming a proper version of Boost has been built and resides
$ # in ~/pkg/boost_1_55_0
$ cmake -DUSE_SUPERBUILD=OFF -DBOOST_ROOT=~/pkg/boost_1_55_0 ..
$ make
$ ./bin/blah
Hello World!