File: LeathermanConfig.cmake.in

package info (click to toggle)
leatherman 1.4.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,944 kB
  • sloc: cpp: 14,555; python: 3,105; sh: 45; makefile: 9; ruby: 1
file content (57 lines) | stat: -rw-r--r-- 2,255 bytes parent folder | download | duplicates (3)
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
get_filename_component(current_directory ${CMAKE_CURRENT_LIST_FILE} DIRECTORY)
list(APPEND CMAKE_MODULE_PATH "${current_directory}/cmake")
include(leatherman_config)
include(options)
include("${current_directory}/LeathermanLibraries.cmake")

get_filename_component(LEATHERMAN_PREFIX "${current_directory}/../../../" ABSOLUTE)

@LEATHERMAN_COMPONENTS@

set(LEATHERMAN_HAVE_LOCALES @LEATHERMAN_USE_LOCALES@)

if (LEATHERMAN_USE_LOCALES AND NOT LEATHERMAN_HAVE_LOCALES)
    message(SEND_ERROR "You requested locale support, but leatherman was built without it")
endif()

set(LEATHERMAN_SHARED @LEATHERMAN_SHARED@)

debug("Selected components: ${Leatherman_FIND_COMPONENTS}")
foreach(component ${Leatherman_FIND_COMPONENTS})
    string(TOUPPER "${component}" id_upper)
    set(exclude_var "LEATHERMAN_EXCLUDE_${id_upper}")
    set(include_var "LEATHERMAN_${id_upper}_INCLUDE")
    set(lib_var "LEATHERMAN_${id_upper}_LIB")
    set(deps_var "LEATHERMAN_${id_upper}_DEPS")
    set(libs_var "LEATHERMAN_${id_upper}_LIBS")
    debug("Exclude variable ${exclude_var} is ${${exclude_var}}")
    if(${${exclude_var}})
        debug("Excluding values for ${id_upper}")
        debug("* include is ${include_var}: ${${include_var}}")
        debug("* library is ${libs_var}: ${${libs_var}}")
    else()
        debug("Appending values for ${id_upper} to common vars")
        debug("* include is ${${include_var}}")
        debug("* library is ${${libs_var}}")
        list(APPEND LEATHERMAN_INCLUDE_DIRS ${${include_var}})
        if (NOT "" STREQUAL "${${lib_var}}")
            # Prepend leatherman libraries, as later libs may depend on earlier libs.
            list(INSERT LEATHERMAN_LIBS 0 ${${lib_var}})
        endif()
        if (${LEATHERMAN_SHARED})
            # Created with shared libraries, ignore dependencies as they're compiled-in.
            set(${libs_var} ${${lib_var}})
        else()
            append_new(LEATHERMAN_DEPS ${${deps_var}})
        endif()
    endif()
endforeach()

if (LEATHERMAN_LIBS OR LEATHERMAN_DEPS)
    set(LEATHERMAN_LIBRARIES ${LEATHERMAN_LIBS} ${LEATHERMAN_DEPS})
endif()

if (LEATHERMAN_INCLUDE_DIRS)
    list(REMOVE_DUPLICATES LEATHERMAN_INCLUDE_DIRS)
endif()
set(LEATHERMAN_MODULE_DIR "${current_directory}/cmake")