diff options
author | Brad King <brad.king@kitware.com> | 2018-12-10 13:16:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-12-10 13:17:06 (GMT) |
commit | d99e1cca20a58abce5c300dbfef98e1180e3c7bf (patch) | |
tree | 837a619eb11dca4a8f5de79db2e15d5080ec70a7 | |
parent | 5f3b067bee1b30b6d74ef48f31e9e2bbb27cd27a (diff) | |
parent | 4a3ae1710ecefedef8c345cd00599b335bc164d2 (diff) | |
download | CMake-d99e1cca20a58abce5c300dbfef98e1180e3c7bf.zip CMake-d99e1cca20a58abce5c300dbfef98e1180e3c7bf.tar.gz CMake-d99e1cca20a58abce5c300dbfef98e1180e3c7bf.tar.bz2 |
Merge topic 'cpack-status-callback'
4a3ae1710e CPack/External: Fix status messages of staging scripts
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2696
-rw-r--r-- | Source/CPack/cpack.cxx | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 7cf69fc..4e49727 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -89,6 +89,15 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, return 1; } +static void cpackProgressCallback(const char* message, float progress, + void* clientdata) +{ + (void)progress; + (void)clientdata; + + std::cout << "-- " << message << std::endl; +} + // this is CPack. int main(int argc, char const* const* argv) { @@ -202,6 +211,7 @@ int main(int argc, char const* const* argv) cmake cminst(cmake::RoleScript); cminst.SetHomeDirectory(""); cminst.SetHomeOutputDirectory(""); + cminst.SetProgressCallback(cpackProgressCallback, nullptr); cminst.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator cmgg(&cminst); cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot()); diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index e308ccb..2d7f993 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake @@ -22,3 +22,5 @@ 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") diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt new file mode 100644 index 0000000..37d635f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt @@ -0,0 +1 @@ +-- This status message is expected to be visible |