https://github.com/dubzzz/gtest-using-cmake-example
Example of how defining a CMakeLists.txt in order to run unit-tests using Google Test framework on travis-ci and appveyor
https://github.com/dubzzz/gtest-using-cmake-example
appveyor cmakelists gtest travis
Last synced: 9 months ago
JSON representation
Example of how defining a CMakeLists.txt in order to run unit-tests using Google Test framework on travis-ci and appveyor
- Host: GitHub
- URL: https://github.com/dubzzz/gtest-using-cmake-example
- Owner: dubzzz
- License: mit
- Created: 2016-12-25T23:14:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-09T12:41:45.000Z (over 9 years ago)
- Last Synced: 2025-06-12T08:06:08.278Z (12 months ago)
- Topics: appveyor, cmakelists, gtest, travis
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Test using CMake -- example [](https://travis-ci.org/dubzzz/gtest-using-cmake-example)[](https://ci.appveyor.com/project/dubzzz/gtest-using-cmake-example/branch/master)
This repository provides a very simple example of how defining a CMakeLists.txt in order to run unit-tests using Google Test framework.
The build system cross-platform (GNU/linux, Windows) and cross-compilers (clang, g++ and visual studio) is also considered.
- .travis.yml: configuration to build such projects on Unix-based platforms with clang or g++.
- appveyor.yml: configuration to build such projects on Windows platforms using Visual Studio compiler
## Compiling and linking against Google Test under Windows
As stated on Google Test official repository, at https://github.com/google/googletest/blob/master/googletest/README.md, `gtest-md.sln` solution build the dynamic version of GTest while the other is to consider for a static linkage.
> The msvc\ folder contains two solutions with Visual C++ projects. Open the gtest.sln or gtest-md.sln file using Visual Studio, and you are ready to build Google Test the same way you build any Visual Studio project. Files that have names ending with -md use DLL versions of Microsoft runtime libraries (the /MD or the /MDd compiler option). Files without that suffix use static versions of the runtime libraries (the /MT or the /MTd option). Please note that one must use the same option to compile both gtest and the test code. If you use Visual Studio 2005 or above, we recommend the -md version as /MD is the default for new projects in these versions of Visual Studio.