aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/rpath-test/portfile.cmake
blob: 481a9353fad51dc43b84e2cf7a6a7ada33e851c3 (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
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

foreach(dir IN ITEMS tools/rpath-test-binaries manual-tools/rpath-test-binaries)
    string(REPLACE "/" "_" logname "execute-rel-${dir}")
    vcpkg_execute_required_process(
        COMMAND "${CURRENT_INSTALLED_DIR}/${dir}/rpath-test-tool"
        WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
        OUTPUT_VARIABLE output
        OUTPUT_STRIP_TRAILING_WHITESPACE
        LOGNAME "${logname}"
    )
    if(NOT output STREQUAL "release")
        message(SEND_ERROR "${dir}: $Actual: '${output}', expected: 'release'")
    endif()
endforeach()

if(NOT VCPKG_BUILD_TYPE)
    foreach(dir IN ITEMS tools/rpath-test-binaries/debug manual-tools/rpath-test-binaries/debug debug/tools/rpath-test-binaries)
        string(REPLACE "/" "_" logname "execute-dbg-${dir}")
        vcpkg_execute_required_process(
            COMMAND "${CURRENT_INSTALLED_DIR}/${dir}/rpath-test-tool"
            WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
            OUTPUT_VARIABLE output
            OUTPUT_STRIP_TRAILING_WHITESPACE
            LOGNAME "${logname}"
        )
        if(NOT output STREQUAL "debug")
            message(SEND_ERROR "${dir}: Actual: '${output}', expected: 'debug'")
        endif()
    endforeach()
endif()