Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Created April 8, 2020 20:27
Show Gist options
  • Save Turupawn/e7a5064e99e124cc25b13ffb01ace5da to your computer and use it in GitHub Desktop.
Save Turupawn/e7a5064e99e124cc25b13ffb01ace5da to your computer and use it in GitHub Desktop.
CMakeLists.txt enable GTest
cmake_minimum_required(VERSION 3.5)
project(modio)
set (CMAKE_CXX_STANDARD 11)
IF( test AND test STREQUAL "on" )
message("Testing enabled")
file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
add_subdirectory(ext/googletest)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(runUnitTests ${TEST_SRC_FILES})
target_link_libraries(runUnitTests gtest gtest_main)
add_test(UnitTests runUnitTests)
ENDIF()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment