Skip to content

Example CMake Shared Library with install / export support and unit testing using Google Test

License

Notifications You must be signed in to change notification settings

alessiosacco/cmake-shared-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake Shared Library

This project can be used as a starting template to create a shared library (.dll on Windows / .so on Linux).

The notable features of this template are the following:

  • CMakePresets.json to configure the build environment. CMake version 3.19 is required in order to support this functionality:
    • Visual Studio has added support since version 16.10
    • CLion has added support since version 2021.2
  • install and export support;
  • GoogleTest unit testing using FetchContent which downloads the external library automatically on configure;

How to build

cmake --preset <preset-name> 
cmake --build --preset <preset-name>
cmake --build --preset <preset-name> -t <install-target-name>
cmake --preset msvc-x86-debug
cmake --build --preset msvc-x86-debug
cmake --build --preset msvc-x86-debug -t INSTALL

About

Example CMake Shared Library with install / export support and unit testing using Google Test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published