Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] Problem building NSIS installer.
From: Doug Gregor (doug.gregor_at_[hidden])
Date: 2009-07-22 01:06:53


Hello,

On Thu, Jul 16, 2009 at 12:07 PM, Miguel A.
Figueroa-Villanueva<miguelf_at_[hidden]> wrote:
> I've been trying to build the NSIS installer, so that I can install
> only the headers for the libraries that I need. Please bear in mind
> that I don't have much experience with either CPack or NSIS, but I'm
> still trying to debug the issue...

I haven't tried building the installer in a while and, at the moment,
I don't even have access to a Windows machine. But I'll see if I can
help!

> I'm getting the error output below when I run "CPack -G NSIS"
>
> ----------------------------------------
> Goto: accumulators_headers_unchanged
> !insertmacro: Select_accumulators_headers_depends
> SectionGetFlags: 127->$0
> IntOp: $0=$0|1
> SectionSetFlags: 127->$0
> IntOp: $parameter_headers_selected=0+1
> warning: unknown variable/constant "{python_headers}" detected,
> ignoring (macro:Select_accumulators_headers_depends:5)
> SectionGetFlags: ${python_headers}->$0
> IntOp: $0=$0|1
> warning: unknown variable/constant "{python_headers}" detected,
> ignoring (macro:Select_accumulators_headers_depends:7)
> SectionSetFlags: ${python_headers}->$0
> Usage: IntOp $(user_var: result) val1 OP [val2]
>    OP=(+ - * / % | & ^ ~ ! || && << >>)
> Error in macro Select_accumulators_headers_depends on macroline 8
> Error in macro MaybeSelectionChanged on macroline 14
> Error in macro SectionList on macroline 4
> Error in script
> "C:/cygdir/builds/boost/_CPack_Packages/win32/NSIS/project.nsi" on
> line 32365 -- aborting creation process
> ----------------------------------------

I have a very silly question: is there a variable "Python_headers"
somewhere in project.nsi? Python seems to be the only library that has
a capitalized module name, so I'm wondering if that's the issue...

> If I edit the project.nsi to include the following declarations:
>
> ...
> Var python_headers_selected
> Var python_headers_was_installed
> ...
>
> and run the command manually ("C:/.../NSIS/makensis.exe"
> "C:/.../_CPack_Packages/win32/NSIS/project.nsi") it creates the
> Boost-1.40.0-vc8.exe file. Although it produces several warning
> messages posted at the end of this message.
>
> Now, I still have problems because when I run the installer it can't
> "download" the packages... I suppose that this is because the cpack
> process is not complete (note that if I run cpack again it overwrites
> the changes to the project.nsi and bails out with error again).

The URL for downloading packages can be set in the configuration. When
the full CPack process completes, the CPackUploads directory will
contain a bunch of files that will need to be made available at that
URL. Alternatively, you can set the "monolithic" option to build all
of the packages into the installer itself.

> So, I guess my question is how do I go about solving this? What
> variable in the boost cmake files creates the dependency on the
> python_headers_* variables in the CPack/NSIS process?

It starts with the cpack_add_* macros that get expanded from various
macros in Boost's tools/build/CMake/BoostCore.cmake. These macros set
many CPACK_* variables in CPackConfig.cmake, which are used by the
CPack process to create project.nsi. If the tiny patch at the end of
this doesn't help, then we'll need to trace through the CPack process
to see why the python_headers_* variables aren't getting created.

Oh, one question: did you build the "modularize" target and then
re-run CMake before building the NSIS package? That step is needed to
get all of the headers in the right places. Note that it pretty much
destroys your Subversion checkout, though, so perhaps do it on a copy
of your Subversion working copy.

  - Doug

===================================================================
--- libs/python/CMakeLists.txt (revision 55076)
+++ libs/python/CMakeLists.txt (working copy)
@@ -55,7 +55,7 @@

   boost_library_project(
- Python
+ python
     SRCDIRS src
     TESTDIRS test
     HEADERS python.hpp python


Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk