forked from lenguaje-latino/latino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
89 lines (68 loc) · 2.73 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#[[
/***********************************************************************************
* Copyright (c) 2015-2021 Lenguaje-Latino, programación con sintaxis al Español. *
* *
* CMake_Root de Latino *
***********************************************************************************/
]]
#
# CMAKE configuraciones
cmake_minimum_required(VERSION 3.13)
set(NOT latCore TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/latino-core/cmake/Modules/")
project(latino)
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build [Debug]" FORCE) # Default to a Debug build
endif()
# set(CMAKE_BUILD_TYPE "Debug")
# if(CMAKE_COMPILER_IS_GNUCXX)
# target_link_libraries(${PROJECT_TEST_NAME} gcov)
# endif()
set(program_files "$ENV{ProgramFiles}")
#
# Mensajes de construcion
include(LatLogo)
message(STATUS ".............................................." )
message(STATUS ">>>>>> Latino ")
message(STATUS ".............................................." )
message(STATUS "Generador .............. ${CMAKE_GENERATOR}" )
message(STATUS "Tipo de Build .......... ${CMAKE_BUILD_TYPE}" )
include(GetLatVersion)
message(STATUS "Latino Version ......... ${LATINO_VERSION}" )
include(ResourceUpdate)
include(BuildLatOptions)
#
# Codigo Fuente
add_subdirectory(latino-core/src)
#
# Opciones
if(LAT_EJEMPLOS)
endif(LAT_EJEMPLOS)
#
# Extras
#find_path(GLIB_INCLUDE_DIR NAMES glib.h PATH_SUFFIXES glib-2.0)
#IF(UNIX)
# execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/tools/install_deps.sh)
# execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/tools/key.sh)
#ENDIF(UNIX)
enable_testing()
#se comentan los test que requieren entrada de datos leer()
add_test(NAME coverage COMMAND latino ejemplos/coverage.lat)
#if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
# include(CodeCoverage)
# setup_target_for_coverage(${PROJECT}_coverage ${PROJECT_TEST_NAME} coverage)
#
# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage -coverage")
# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage -coverage")
#endif() #CMAKE_BUILD_TYPE STREQUAL "Coverage"
set(GCOV "gcov")
if(DEFINED ENV{GCOV})
set(GCOV $ENV{GCOV})
endif()
add_custom_target(coverage
COMMAND lcov --gcov-tool ${GCOV} --capture --directory . --output-file coverage.info
COMMAND lcov --gcov-tool ${GCOV} --remove coverage.info "/usr/*" "*/test/*" --output-file coverage.info
COMMAND lcov --gcov-tool ${GCOV} --list coverage.info
COMMAND genhtml coverage.info --output-directory ./coverage
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
VERBATIM)