Skip to content

A CMake C++17 Template project. Google Test is downloaded. Doxygen is configured.

Notifications You must be signed in to change notification settings

genedelisa/cppGoogleTestDLProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake C++ Google Test Project template

GitHub last commit

GitHub release GitHub release date

C++17 Platforms macOS license

Sponsors Twitter @GeneDeLisaDev GitHub followers

What's this?

This is a CMake 3 configured C++ project.

There is one C++ class and it is shoved into a static library.

  • src contains the source for the library. Surprise!
  • include contains the headers.
  • test contains the Google test.
  • app contains a command line app that uses the library.

The executable and a test runner are built in build/bin.

Google Test/Mock are downloaded if an option is set.

Doxygen is run to generate documentation if an option is set. You need to download and install it first. I suggest you run the app to reconfigure doc/Doxyfile.in

There are Visual Studio Code tasks defined.

There is a script to generate an Xcode project.

Building

You run cmake from the build directory.

You might want to clean the build directory first.

rm -rf build/*

The normal build incantation is this:

cd build && cmake -D USE_UNIT_TESTING=ON -D GENERATE_DOC=ON .. && make all

Visual Studio Tasks defined

make all

Runs make all in the build directory

make doc

Runs make doc in the build directory

cd build && make doc

cmake

You probably want to run cmake once. Then when your code is updated, run make.

This task cleans the build directory, goes into it, runs cmake, then runs make all.

rm -rf build/* && cd build && cmake -D USE_UNIT_TESTING=ON -D GENERATE_DOC=ON .. && make all

clean build

Removes everything from the build directory.

rm -rf build/*

cmake just docs

Skips downloading Google Test and building the C++ code. Instead it does just the Doxygen guff.

rm -rf build/* && cd build && cmake -D USE_UNIT_TESTING=OFF -D GENERATE_DOC=ON .. && make doc

Blog post for this example

Blog post coming coon

Buy my kitty Giacomo some cat food

If you find this useful, my kitty likes snacks.

paypal

Giacomo Kitty

Licensing

MIT

Please read the LICENSE for details.

Credits

About

A CMake C++17 Template project. Google Test is downloaded. Doxygen is configured.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published