-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
47 lines (41 loc) · 1.93 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.5)
project(solucion)
set(CMAKE_CXX_STANDARD 14)
# Algunos flags para pasar al compilador (gnu++11 en vez de c++11 para que sea cross-plat)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -ggdb3 -g")
add_subdirectory(tests/google-test)
# Creamos el ejecutable para correr los tests
add_executable(base tests/test_base.cpp)
add_executable(ej1 tests/test_templates.cpp)
add_executable(ej2 tests/test_templates.cpp)
add_executable(ej3 tests/test_templates.cpp)
add_executable(ej4 tests/test_templates.cpp)
add_executable(ej5 tests/test_templates.cpp tests/test_diccionario.cpp)
add_executable(ej6 tests/test_templates.cpp tests/test_diccionario.cpp)
add_executable(ej7 tests/test_templates.cpp tests/test_diccionario.cpp
tests/test_multiconjunto.cpp)
add_executable(ej8 tests/test_templates.cpp tests/test_diccionario.cpp
tests/test_multiconjunto.cpp)
add_executable(ej9 tests/test_templates.cpp tests/test_diccionario.cpp
tests/test_multiconjunto.cpp)
# Definiciones por target
target_compile_definitions(ej1 PUBLIC EJ=1)
target_compile_definitions(ej2 PUBLIC EJ=2)
target_compile_definitions(ej3 PUBLIC EJ=3)
target_compile_definitions(ej4 PUBLIC EJ=4)
target_compile_definitions(ej5 PUBLIC EJ=5)
target_compile_definitions(ej6 PUBLIC EJ=6)
target_compile_definitions(ej7 PUBLIC EJ=7)
target_compile_definitions(ej8 PUBLIC EJ=8)
target_compile_definitions(ej9 PUBLIC EJ=9)
# Necesitamos asociar los archivos del framework de testing
target_link_libraries(base gtest gtest_main)
target_link_libraries(ej1 gtest gtest_main)
target_link_libraries(ej2 gtest gtest_main)
target_link_libraries(ej3 gtest gtest_main)
target_link_libraries(ej4 gtest gtest_main)
target_link_libraries(ej5 gtest gtest_main)
target_link_libraries(ej6 gtest gtest_main)
target_link_libraries(ej7 gtest gtest_main)
target_link_libraries(ej8 gtest gtest_main)
target_link_libraries(ej9 gtest gtest_main)