summaryrefslogtreecommitdiffstats
path: root/Source/CPack/bills-comments.txt
blob: c3b4ee8e71bc8aed960da13a6f084abb58038dd7 (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
57
58
59
60
61
62
63
64
65
66
67
68
cpack.cxx

cmCPackGenerators  -- creates cmCPackGenericGenerator's via NewGenerator
  - a cmCPackGenericGenerator factory


cmCPackGenericGenerator::Initialize
   this->InitializeInternal
     CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off


// binary package run
cmCPackGenericGenerator::ProcessGenerator   // DoPackage
  cmCPackGenericGenerator::PrepareNames  -- sets a bunch of CPACK_vars
  cmCPackGenericGenerator::InstallProject
     run preinstall  (make preinstall/fast)
     call ReadListFile(cmake_install.cmake)
  glob recurse in install directory to get list of files
     this->CompressFiles with the list of files


// source package run
cmCPackGenericGenerator::ProcessGenerator   // DoPackage
  cmCPackGenericGenerator::PrepareNames  -- sets a bunch of CPACK_vars
  cmCPackGenericGenerator::InstallProject  -->
     if set CPACK_INSTALLED_DIRECTORIES
        glob the files in that directory
        copy those files to the tmp install directory _CPack something
  glob recurse in install directory to get list of files
     this->CompressFiles with the list of files


cmCPackGenericGenerator::InstallProject is used for both source and binary
packages.  It is controled based on values set in CPACK_ variables.


InstallProject
   1. CPACK_INSTALL_COMMANDS       - a list of commands used to install the package

   2. CPACK_INSTALLED_DIRECTORIES  - copy this directory to CPACK_TEMPORARY_DIRECTORY

   3. CPACK_INSTALL_CMAKE_PROJECTS - a cmake install script
         - run make preinstall
         - run cmake_install.cmake
             - set CMAKE_INSTALL_PREFIX to the temp directory
             - CPACK_BUILD_CONFIG check this and set the BUILD_TYPE to it
              - ReadListFile on the install script  cmake_install.cmake
         - run strip on the executables and libraries if CPACK_STRIP_FILES is TRUE

Recommendations:

rename cmCPackGenerators  to cmCPackGeneratorFactory

rename cmCPackGenericGenerator  -->  cmCPackGenerator

rename cmCPackGenericGenerator::ProcessGenerator  -> cmCPackGenerator::DoPackage


break up cmCPackGenerator::InstallProject so it calls the following:

// run user provided install commands
  cmCPackGenerator::RunInstallCommands();
// copy entire directories that need no processing like source trees
  cmCPackGenerator::CopyPreInstalledDirectories();
// run the cmake install scripts if provided
  cmCPackGenerator::RunCMakeInstallScripts()

-
>Tests/RunCMake/no_install_prefix/do_test.cmake2
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt18
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix.cmake2
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix.cmake2
10 files changed, 46 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 97bf14d..99a0fb3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -109,6 +109,7 @@ add_RunCMake_test(CMP0004)
add_RunCMake_test(TargetPolicies)
add_RunCMake_test(alias_targets)
add_RunCMake_test(interface_library)
+add_RunCMake_test(no_install_prefix)
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
new file mode 100644
index 0000000..2923449
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
@@ -0,0 +1,15 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix")
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/prefix")
+run_cmake(with_install_prefix)
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_FIND_NO_INSTALL_PREFIX=1")
+run_cmake(no_install_prefix)
diff --git a/Tests/RunCMake/no_install_prefix/do_test.cmake b/Tests/RunCMake/no_install_prefix/do_test.cmake
new file mode 100644
index 0000000..340c7dc
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/do_test.cmake
@@ -0,0 +1,2 @@
+
+find_package(NoPrefix REQUIRED)
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
new file mode 100644