File: Libraries.cmake

package info (click to toggle)
ausweisapp2 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,632 kB
  • sloc: cpp: 114,622; python: 2,833; xml: 1,426; java: 923; sh: 186; makefile: 7
file content (112 lines) | stat: -rw-r--r-- 2,990 bytes parent folder | download
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
if("Vanilla" IN_LIST NAMES)
	message(STATUS "Use libraries: System")
	return()
elseif("Qt" IN_LIST NAMES)
	message(STATUS "Use libraries: Qt")
	find_program(AQT aqt REQUIRED)
else()
	message(STATUS "Use libraries: Governikus")
	if(DEFINED ENV{JENKINS_HOME})
		message(STATUS "Use libraries: Jenkins")
		return()
	endif()
endif()

if(EXISTS ${T_LIBS_DIR})
	step(${CMAKE_COMMAND} -E rm -r ${T_LIBS_DIR})
endif()

if(AQT)
	if(NOT QT)
		message(FATAL_ERROR "Provide version via -DQT=")
	endif()
	step(${AQT} install-qt -O ${T_LIBS_DIR} linux desktop ${QT} --modules qtwebsockets qtscxml qtconnectivity)
	step(${CMAKE_COMMAND} -E create_symlink ${QT}/gcc_64 ${T_LIBS_DIR}/dist)
	return()
endif()



if("FreeBSD" IN_LIST NAMES)
	set(PRESET ci-debug)
elseif("Android" IN_LIST NAMES)
	set(PRESET ci-android)
elseif("iOS" IN_LIST NAMES)
	if("Simulator" IN_LIST NAMES)
		set(PRESET ci-ios-simulator)
		if("x86" IN_LIST NAMES AND "64" IN_LIST NAMES)
			set(PRESET ${PRESET}-x86_64)
		elseif("arm64" IN_LIST NAMES)
			set(PRESET ${PRESET}-arm64)
		endif()
	else()
		set(PRESET ci-ios)
	endif()

	step(security unlock-keychain $ENV{KEYCHAIN_CREDENTIALS} $ENV{HOME}/Library/Keychains/login.keychain-db)
elseif("Win" IN_LIST NAMES)
	if("GNU" IN_LIST NAMES)
		set(PRESET ci-gnu-release)
	else()
		set(VCVARS cmd /c vcvarsall.bat amd64 && call)
		if("dev" IN_LIST NAMES)
			set(PRESET ci-msvc-debug)
		else()
			set(PRESET ci-msvc-release)
		endif()
	endif()
else()
	set(PRESET ci-release)
endif()

CALC_CHECKSUM(SALT ${CMAKE_CURRENT_LIST_FILE})
if(CMAKE_PARENT_LIST_FILE STREQUAL CMAKE_SCRIPT_MODE_FILE)
	set(LIBRARIES_SCRIPT_ONLY ON)
endif()

if(LIBRARIES_SCRIPT_ONLY OR PROPAGATE)
	set(cfg ${T_CFG_LIBS})
else()
	set(cfg ${T_CFG_LIBS_DEPS})
endif()

if(DEFINED OPENSSL)
	list(APPEND CUSTOM_VERSION -DOPENSSL=${OPENSSL})
endif()
if(DEFINED QT)
	list(APPEND CUSTOM_VERSION -DQT=${QT})
endif()

step(${VCVARS} ${cfg} --preset ${PRESET} -DSALT=${SALT} ${CUSTOM_VERSION} NO_ECHO)
find_package(Governikus REQUIRED PATHS ${T_LIBS_DIR} NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
set(CACHED_TARBALL ${CACHE_DIR}/${LIBS_TARBALL})

block()
	include(Files)
endblock()

if(EXISTS "${CACHED_TARBALL}")
	message(STATUS "Use cached libraries: ${LIBS_TARBALL}")
elseif(NOT PROVIDER_NO_DOWNLOAD)
	download_pkg_libs("${CACHED_TARBALL}")
endif()

if(NOT EXISTS "${CACHED_TARBALL}" AND NOT PROVIDER_NO_BUILD)
	message(STATUS "Build libraries...")
	if("Win" IN_LIST NAMES)
		set(OPTIONAL_PATH PATH ${WORKSPACE}/${T_LIBS_DIR}/dist/bin)
	endif()

	step(${VCVARS} ${CMAKE_COMMAND} --build ${T_LIBS_DIR} --target compress ${OPTIONAL_PATH})
	step(${CMAKE_COMMAND} -E copy_if_different "${T_LIBS_DIR}/${LIBS_TARBALL}" "${CACHED_TARBALL}")
	if(DEFINED ENV{GITLAB_CI})
		upload_pkg_libs("${CACHED_TARBALL}")
	endif()
endif()

step(${CMAKE_COMMAND} -E rm -r ${T_LIBS_DIR})

if(NOT LIBRARIES_SCRIPT_ONLY)
	step(${CMAKE_COMMAND} -E make_directory ${T_LIBS_DIR})
	step(${CMAKE_COMMAND} -E tar xf "${CACHED_TARBALL}" CHDIR ${T_LIBS_DIR})
endif()