Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created January 16, 2023 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorTorres/747ea0b79da35d8fb4e6f25cc7dd6e67 to your computer and use it in GitHub Desktop.
Save HectorTorres/747ea0b79da35d8fb4e6f25cc7dd6e67 to your computer and use it in GitHub Desktop.
# Se requiere definir una version minima de cmake, por compatibilidad
cmake_minimum_required(VERSION 3.22)
# Se requiere definir un nombre de proyecto.
project("Gtest")
# Buscar el paquete GTest
find_package(GTest REQUIRED)
# Vincular el archivo de salida con el de pruebas
add_executable(a.out test.cpp)
# Vincular las bibliotecas requeridas
target_link_libraries(a.out ${GTEST_LIBRARIES})
# Probar de manera automatica
enable_testing()
add_test(add a.out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment