<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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I am trying to create a package for our project. The package contains several components, one for each application. I followed the instruction from the book “Mastering CMake” and the package is created but has no components.
Our solution runs entirely on CMake including continuous integration with CTest and CDash. 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> </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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_NAME "The project")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VENDOR "SomeVendor")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The application")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION "1.0.0")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_MAJOR "1")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_MINOR "0")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_VERSION_PATCH "0")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> <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 "${ROOT}/utilities/ logo.ico")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_MUI_UNICON "${ROOT}/utilities/ logo.ico")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_ICON "${ROOT}/utilities\\\\ logo.bmp")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\Application")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_NSIS_PACKAGE_NAME "Application ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_RESOURCE_FILE_LICENSE "${ROOT}/utilities/License.txt")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_PACKAGE_INSTALL_DIRECTORY "PSI-Knee ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> <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 "bin/install")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SET(CPACK_MODULE_PATH "")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </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 "blabla" DESCRIPTION "blabla")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">CPACK_ADD_COMPONENT(triageApp DISPLAY_NAME "blabla" DESCRIPTION "blabla")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </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> </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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I read on forum that setting CPACK_SET_DESTDIR to ON could cause problem but it does not change anything in my case. 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> </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> </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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">warning: unknown variable/constant "{libraries}" detected, ignoring (macro:Select_headers_depends:1)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SectionGetFlags: ${libraries}->$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 "{libraries}" detected, ignoring (macro:Select_headers_depends:3)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">SectionSetFlags: ${libraries}->$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"> OP=(+ - * / % | & ^ ~ ! || && << >>)<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 "C:/ComponentExample/Source/_CPack_Packages/win32/NSIS/project.nsi" on line 831 -- aborting creation process<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </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> </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> </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> </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> </o:p></span></p>
</div>
</body>
</html>