<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-CA">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I am trying to create a package for our project.&nbsp; The package contains several components, one for each application.&nbsp; I followed the instruction from the book &#8220;Mastering CMake&#8221; and the package is created but has no components.&nbsp;
 Our solution runs entirely on CMake including continuous integration with CTest and CDash.&nbsp; The only thing which is not working properly is the packaging of the software.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Our solution contains a root CMakeLists.txt which contains all CPack instructions:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_NAME &quot;The project&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VENDOR &quot;SomeVendor&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY &quot;The application&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION &quot;1.0.0&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_MAJOR &quot;1&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_MINOR &quot;0&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_PATCH &quot;0&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"># Set CPack variables<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_MUI_ICON &quot;${ROOT}/utilities/ logo.ico&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_MUI_UNICON &quot;${ROOT}/utilities/ logo.ico&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_ICON &quot;${ROOT}/utilities\\\\ logo.bmp&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_INSTALLED_ICON_NAME &quot;bin\\\\Application&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_PACKAGE_NAME &quot;Application ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_RESOURCE_FILE_LICENSE &quot;${ROOT}/utilities/License.txt&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_INSTALL_DIRECTORY &quot;PSI-Knee ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">set(CPACK_COMPONENTS_ALL AdjustmentApp triageApp)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_SET_DESTDIR ON)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CMAKE_INSTALL_PREFIX &quot;bin/install&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_MODULE_PATH &quot;&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">INCLUDE(CPack)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">CPACK_ADD_COMPONENT(AdjustmentApp DISPLAY_NAME &quot;blabla&quot; DESCRIPTION &quot;blabla&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">CPACK_ADD_COMPONENT(triageApp DISPLAY_NAME &quot;blabla&quot; DESCRIPTION &quot;blabla&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Other sub CMakeLists are include using the add_subdirectory() command which contains the INSTALL command :
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">INSTALL(TARGETS Adjustment RUNTIME DESTINATION ${BUILD_ROOT}/bin/install COMPONENT AdjustmentApp)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">INSTALL(TARGETS triage RUNTIME DESTINATION ${BUILD_ROOT}/bin/install COMPONENT triageApp)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I read on forum that setting CPACK_SET_DESTDIR&nbsp; to ON could cause problem but it does not change anything in my case.&nbsp; Whether or not this variable is on or off or using absolute or relative path is always ending with
 an empty installer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I even try to run the example from the cmake wiki :
<a href="http://www.cmake.org/Wiki/File:ComponentExampleStart.zip">http://www.cmake.org/Wiki/File:ComponentExampleStart.zip</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">The example is not working at all, NSIS got errors:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">warning: unknown variable/constant &quot;{libraries}&quot; detected, ignoring (macro:Select_headers_depends:1)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SectionGetFlags: ${libraries}-&gt;$0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">IntOp: $0=$0|1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">warning: unknown variable/constant &quot;{libraries}&quot; detected, ignoring (macro:Select_headers_depends:3)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SectionSetFlags: ${libraries}-&gt;$0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Usage: IntOp $(user_var: result) val1 OP [val2]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">&nbsp;&nbsp;&nbsp; OP=(&#43; - * / % | &amp; ^ ~ ! || &amp;&amp; &lt;&lt; &gt;&gt;)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Error in macro Select_headers_depends on macroline 4<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Error in macro MaybeSelectionChanged on macroline 14<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Error in macro SectionList on macroline 3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Error in script &quot;C:/ComponentExample/Source/_CPack_Packages/win32/NSIS/project.nsi&quot; on line 831 -- aborting creation process<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I am using CMake 2.8.7, NSIS 2.46 and Windows 7 64 bit edition.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Is there any incompatibility with the version of the software used?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Thanks for your help!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Alexandre<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>