summaryrefslogtreecommitdiff
path: root/src/qdoc/Qt5DocToolsConfig.cmake.in
blob: daa336127143d03dddbd9e647a1f230b781dd5a7 (plain)
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
if (CMAKE_VERSION VERSION_LESS 2.8.3)
    message(FATAL_ERROR \"Qt 5 requires at least CMake version 2.8.3\")
endif()

!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(_qt5_qdoctools_install_prefix \"$$[QT_INSTALL_PREFIX]\")
!!ELSE
get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
# Use original install prefix when loaded through a
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5DocTools\" REALPATH)
if(_realCurr STREQUAL _realOrig)
    get_filename_component(_qt5_qdoctools_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
else()
    get_filename_component(_qt5_qdoctools_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
endif()
unset(_realOrig)
unset(_realCurr)
unset(_IMPORT_PREFIX)
!!ENDIF
!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
get_filename_component(_qt5_qdoctools_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
!!ELSE
set(_qt5_qdoctools_install_prefix \"$$[QT_INSTALL_PREFIX]\")
!!ENDIF

macro(_qt5_DocTools_check_file_exists file)
    if(NOT EXISTS \"${file}\" )
        message(FATAL_ERROR \"The package \\\"Qt5DocTools\\\" references the file
   \\\"${file}\\\"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   \\\"${CMAKE_CURRENT_LIST_FILE}\\\"
but not all the files it references.
\")
    endif()
endmacro()

if (NOT TARGET Qt5::qdoc)
    add_executable(Qt5::qdoc IMPORTED)

!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
    set(imported_location \"${_qt5_qdoctools_install_prefix}/$${CMAKE_BIN_DIR}qdoc$$CMAKE_BIN_SUFFIX\")
!!ELSE
    set(imported_location \"$${CMAKE_BIN_DIR}qdoc$$CMAKE_BIN_SUFFIX\")
!!ENDIF
    _qt5_DocTools_check_file_exists(${imported_location})

    set_target_properties(Qt5::qdoc PROPERTIES
        IMPORTED_LOCATION ${imported_location}
    )
endif()