-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
78 lines (62 loc) · 2.38 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
#[[
/***********************************************************************************
* Copyright (c) 2015-2021 Lenguaje-Latino, programación con sintaxis al Español. *
* *
* CMake_Root de Latino-UI *
***********************************************************************************/
]]
#
# >>> CMAKE configuraciones
cmake_minimum_required(VERSION 3.13)
set(INSTALL_LIB_UNIX ${CMAKE_INSTALL_PREFIX}/lib)
set(INSTALL_LIB_APPL ${CMAKE_INSTALL_PREFIX}/usr/local/lib)
project(latino-ui)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -Wall -std=c11 -rdynamic -ldl -fPIC")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -D_GNU_SOURCE -g -O0 -Wall -std=c11 -rdynamic -ldl -fPIC")
#
# >>> MS_WINDOWS
if (WIN32)
#
# Arquitectura del build
set(TARGET_ARCH_REGEX "^.*-march[= ]([^ ]+).*$")
string(REGEX MATCH "${TARGET_ARCH_REGEX}" TARGET_ARCH_MATCH ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS})
if(TARGET_ARCH_MATCH)
string(REGEX REPLACE "${TARGET_ARCH_REGEX}" "\\1" TARGET_ARCH ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS})
else()
set(TARGET_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
#
# Variable
set(LATINO_PATH "C:/Program Files/Latino" CACHE FILEPATH "Ruta de instalacion de latino")
#
# Enlazar
include_directories(${LATINO_PATH}/include)
link_directories(${LATINO_PATH}/lib)
#
# Mensajes
message(STATUS "ARQUITECTURA .................. ${TARGET_ARCH}")
message(STATUS "DIRECTORIO .................... ${LATINO_PATH}")
message(STATUS "INCLUDE ....................... ${LATINO_PATH}/include")
message(STATUS "LIB ........................... ${LATINO_PATH}/lib")
endif()
# #
# # >>> macOS
# if(APPLE)
# link_directories(/usr/local/lib)
# include_directories("/usr/local/include")
# endif()
# #
# # >>> LINUX
# if(UNIX)
# include_directories(include)
# endif()
include_directories(include)
add_library(latino-ui SHARED src/latino-ui.c)
target_link_libraries(latino-ui latino)
# #
# # >>> instalacion
# if(UNIX)
# install(TARGETS latino-ui DESTINATION ${INSTALL_LIB_UNIX})
# elseif(APPLE)
# install(TARGETS latino-ui DESTINATION ${INSTALL_LIB_APPL})
# endif()