forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Chapter 1 Demo
David Zemon edited this page Jul 6, 2018
·
5 revisions
For a brief introduction to CMake, let's create a project with the following goals:
- Build a library,
upperwhich takes in a string and returns the uppercase version. Source for this library should be in its own folder. - Build a second library,
useless, which concatenates a hardcoded string to an input parameter and then usesupperto convert the result to all uppercase characters prior to returning the result. Source for this library should be in its own folder. - The extra string in
uselessshould be stored in its own source file, therefore showcasing multiple source files for a single target - Build an executable,
HelloWorldthat usesuselessto print a useless "Hello, world!" message. Source for this executable can sit in the root directory. - Without modifying the build system, users of the build system should be able to turn on
-Wallcompile flag for all buid configurations, and-Wextraonly for debug configurations. These flags, when enabled, should be applied to all build targets. - Use CMake's transitive dependency resolution to ensure that
HelloWorldhas the simplest possible build system configuration. - Public header files can go in a shared
includefolder under the root directory.