This recipe will build the "Hello, World" executable from the following source code (hello-world.cpp):
#include <cstdlib>
#include <iostream>
#include <string>
std::string say_hello() { return std::string("Hello, CMake superbuild world!"); }
int main() {
std::cout << say_hello() << std::endl;
return EXIT_SUCCESS;
}
The project is structured as follows, with a root CMakeLists.txt, and a src/CMakeLists.txt file:
.
├── CMakeLists.txt
└── src
├── CMakeLists.txt
└── hello-world.cpp