[CMake] CMake Digest, Vol 54, Issue 55

Dick Munroe munroe at csworks.com
Mon Oct 20 09:11:22 EDT 2008


And once I keep CPack.make from clobbering CPACK_INSTALL_CMAKE_PROJECTS 
I get kits built as well.

Here's something simple you can try to see the problem:

project(foo)

             ...

              set(
                        CPACK_INSTALL_CMAKE_PROJECTS 
"${CMAKE_HOME_DIRECTORY};ESPlanner-Web;WEB;/tmp/ESPlanner-install"
                )

             message("x: ${CPACK_INSTALL_CMAKE_PROJECTS})

             include(CPack)

             message("x: ${CPACK_INSTALL_CMAKE_PROJECTS})

When you configure your Makefiles (this particular build is for Darwin, 
running make) you'll see that after the include, the value for 
CPACK_INSTALL_CMAKE_PROJECTS is now null (I'm not building any source 
releases) because it's been overwritten by the contents of the 
CPACK_SOURCE_INSTALL_CMAKE_PROJECTS variable.  After the overwriting of 
CPACK_INSTALL_CMAKE_PROJECTS, there is a call to configure_file which is 
where I think that the bogus value of CPACK_INSTALL_CMAKE_PROJECTS gets 
written, resulting in the error.

When you run the package command for the make file one (or at least I) 
get the error described below, in effect, CPack appears to have no data 
available from CPACK_INSTALL_CMAKE_PROJECTS set prior to the include of 
CPack.  If you make the change to CPack.cmake, described below, you get 
the correct behavior (or at least you get kits built which is what this 
is all about after all).  I'm just describing observed behavior with the 
shipped 2.6.2 product on Darwin (10.5.4+) not stating what other folks 
do or don't see.  As near as I can tell from the sparse CPack 
documentation all I should have to do is set 
CPACK_INSTALL_CMAKE_PROJECTS, which I do, run make package, which I do, 
and get kits, which I don't.

I initially tried just including CPack and running make package, but got 
the same error (there is no data in CPACK_INSTALL_CMAKE_PROJECTS).

Best,

Dick Munroe

cmake-request at cmake.org wrote:

>Message: 1
>Date: Sun, 19 Oct 2008 13:42:51 +0200
>From: "Eric Noulard" <eric.noulard at gmail.com>
>Subject: Re: [CMake] Simple CPack example is needed...
>To: "Dick Munroe" <munroe at csworks.com>
>Cc: cmake <cmake at cmake.org>
>Message-ID:
>	<cbe23c50810190442w5cedf569jceefc538185a073 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1
>
>2008/10/18 Dick Munroe <munroe at csworks.com>:
>  
>
>>I've gotten to the point where I need to build an installer and want to use
>>CPack.  The available documentation is pretty impenetrable and I can't find
>>any simple examples on the web.  I've found a bug in the CPack.make file
>>shipped with CMake 2.6.2
>>    
>>
>
>I do use CPack/CMake 2.6.2 without trouble for
>ZIP
>TGZ
>RPM
>DEB
>cpack generator so I think...
>
>  
>
>>(in the section of the file following the comment:
>>Generate source file, CPACK_INSTALL_CMAKE_PROJECTS is clobbered by
>>CPACK_SOURCE_INSTALL_CMAKE_PROJECTS which winds up generating the following
>>error when I try to run make package:
>>    
>>
>
>You may have misunderstood the purpose of those line.
>CPack.cmake is generated 2 files:
>
>CPackConfig.cmake for binary package
>CPackSourceConfig.cmake for source package
>
>the
>SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
>
>is done before generating "CPackSourceConfig.cmake" but
>after "CPackConfig.cmake" has been produced.
>look for configure_file commands.
>
>[...]
>  
>
>>So I'm got curious about what the various bits of the
>>CPACK_INSTALL_CMAKE_PROJECTS are.  I've started with:
>>
>>      set(
>>          CPACK_INSTALL_CMAKE_PROJECTS
>>"bin/ESPlanner;ESPlanner-Web;WEB;/tmp/ESPlanner-install")
>>
>>which got the error above, so the first argument has to be something like
>>the root of the build directory.  So, I changed the directory to
>>${CMAKE_HOME_DIRECTORY} and I get kits built, but I still think there is a
>>bug in CPack.make.
>>    
>>
>
>look at:
>http://www.cmake.org/Wiki/CMake:CPackConfiguration
>
>>From my understanding (I may be wrong) there is 4 arguments:
>  1) path to build directory of the project
>  2) name of the PROJECT
>  3) the project component to be install (look at INSTALL(...
>COMPONENT) documentation
>  4) the Directory in the package
>
>>From my side
>CPack.cmake is doing its jobs, since I don't need to set
>CPACK_INSTALL_CMAKE_PROJECTS myself.
>
>I get a package with "ALL" component since CPack.cmake
>create:
>
>SET(CPACK_INSTALL_CMAKE_PROJECTS "/home/eric/certi/build;CERTI;ALL;/")
>
>Did you try not setting CPACK_INSTALL_CMAKE_PROJECTS by yourself
>and let CMake do its job? (May be you should del your build tree and retry).
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081020/cf352546/attachment.htm>


More information about the CMake mailing list