File: generate_cmake_toolchain_file.pro

package info (click to toggle)
qtwebkit-opensource-src 5.212.0~alpha4-30
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 126,360 kB
  • sloc: cpp: 1,399,204; javascript: 111,961; ansic: 29,742; perl: 19,510; python: 13,364; ruby: 10,299; xml: 9,342; asm: 5,078; yacc: 2,166; lex: 906; sh: 417; makefile: 34
file content (47 lines) | stat: -rw-r--r-- 1,477 bytes parent folder | download | duplicates (4)
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
load(functions)

TEMPLATE = aux

cross_compile {
    linux {
        SYSTEM_NAME = Linux
    } else: macos {
        # We don't support uikit platforms for now, and they certainly won't work
        # with the simplistic toolchain file we are generating here.
        SYSTEM_NAME = Darwin
    } else: win32 {
        SYSTEM_NAME = Windows
    } else: freebsd {
        SYSTEM_NAME = FreeBSD
    } else: netbsd {
        SYSTEM_NAME = NetBSD
    } else: openbsd {
        SYSTEM_NAME = OpenBSD
    } else {
        error("Unknown platform, cannot produce toolchain file for CMake")
    }

    TOOLCHAIN_FILE_VARS += \
        "CMAKE_SYSTEM_NAME $$SYSTEM_NAME" \
        "CMAKE_SYSTEM_PROCESSOR $$QT_ARCH"

    isEmpty(CMAKE_SYSROOT): CMAKE_SYSROOT = $$[QT_SYSROOT]
    !isEmpty(CMAKE_SYSROOT): TOOLCHAIN_FILE_VARS += \
        "CMAKE_FIND_ROOT_PATH $$CMAKE_SYSROOT" \
        "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER" \
        "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY" \
        "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY"
}

TOOLCHAIN_FILE_VARS += \
    "CMAKE_C_COMPILER \"$$QMAKE_CC\"" \
    "CMAKE_CXX_COMPILER \"$$QMAKE_CXX\""

for (var, TOOLCHAIN_FILE_VARS): TOOLCHAIN_FILE_CONTENTS += "set($$var)"

TOOLCHAIN_FILE = $$ROOT_BUILD_DIR/qmake_toolchain.cmake

!build_pass {
    log("$${EOL}Generating CMake toolchain file $$TOOLCHAIN_FILE $${EOL}$${EOL}"$$join(TOOLCHAIN_FILE_CONTENTS, $${EOL})$${EOL}$${EOL})
    write_file($$TOOLCHAIN_FILE, TOOLCHAIN_FILE_CONTENTS)|error()
}