Created
April 8, 2020 20:27
-
-
Save Turupawn/e7a5064e99e124cc25b13ffb01ace5da to your computer and use it in GitHub Desktop.
CMakeLists.txt enable GTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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