summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
blob: 2d7f993c30c258e150590f34d855c23df3a6b057 (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
message("This script could run an external packaging tool")

function(expect_variable VAR)
  if(NOT ${VAR})
    message(FATAL_ERROR "${VAR} is unexpectedly not set")
  endif()
endfunction()

function(expect_file FILE)
  if(NOT EXISTS "${FILE}")
    message(FATAL_ERROR "${FILE} is unexpectedly missing")
  endif()
endfunction()

expect_variable(CPACK_COMPONENTS_ALL)
expect_variable(CPACK_TOPLEVEL_DIRECTORY)
expect_variable(CPACK_TEMPORARY_DIRECTORY)
expect_variable(CPACK_PACKAGE_DIRECTORY)
expect_variable(CPACK_PACKAGE_FILE_NAME)

expect_file(${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt)
expect_file(${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt)
expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt)
expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt)

message(STATUS "This status message is expected to be visible")