Skip to content

Instantly share code, notes, and snippets.

@Sibirtsev
Last active September 15, 2020 09:23
Show Gist options
  • Save Sibirtsev/cdeead5bd3ce1ecca93f01f42af539ab to your computer and use it in GitHub Desktop.
Save Sibirtsev/cdeead5bd3ce1ecca93f01f42af539ab to your computer and use it in GitHub Desktop.
CMake GTest Example
cmake_minimum_required(VERSION 3.11)
project(GoogleTestDemo)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_subdirectory(lib/googletest)
include_directories(lib/googletest/googletest/include)
include_directories(lib/googletest/googlemock/include)
set(SOURCE_FILES main.cpp) # *.cpp
add_executable(GoogleTestDemo ${SOURCE_FILES})
target_link_libraries(GoogleTestDemo gtest gtest_main gmock gmock_main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment