Hello,

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.

Our solution contains a root CMakeLists.txt which contains all CPack 
instructions:

SET(CPACK_PACKAGE_NAME "The project")
SET(CPACK_PACKAGE_VENDOR "SomeVendor")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The application")
SET(CPACK_PACKAGE_VERSION "1.0.0")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "0")

# Set CPack variables
SET(CPACK_NSIS_MUI_ICON "${ROOT}/utilities/ logo.ico")
SET(CPACK_NSIS_MUI_UNICON "${ROOT}/utilities/ logo.ico")
SET(CPACK_PACKAGE_ICON "${ROOT}/utilities\\\\ logo.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\Application")
SET(CPACK_NSIS_PACKAGE_NAME "Application 
${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
SET(CPACK_RESOURCE_FILE_LICENSE "${ROOT}/utilities/License.txt")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "PSI-Knee 
${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")

set(CPACK_COMPONENTS_ALL AdjustmentApp triageApp)
SET(CPACK_SET_DESTDIR ON)
SET(CMAKE_INSTALL_PREFIX "bin/install")
SET(CPACK_MODULE_PATH "")

INCLUDE(CPack)
CPACK_ADD_COMPONENT(AdjustmentApp DISPLAY_NAME "blabla" DESCRIPTION "blabla")
CPACK_ADD_COMPONENT(triageApp DISPLAY_NAME "blabla" DESCRIPTION "blabla")

Other sub CMakeLists are include using the add_subdirectory() command which 
contains the INSTALL command :

INSTALL(TARGETS Adjustment RUNTIME DESTINATION ${BUILD_ROOT}/bin/install 
COMPONENT AdjustmentApp)
INSTALL(TARGETS triage RUNTIME DESTINATION ${BUILD_ROOT}/bin/install COMPONENT 
triageApp)

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.

I even try to run the example from the cmake wiki : 
http://www.cmake.org/Wiki/File:ComponentExampleStart.zip.

The example is not working at all, NSIS got errors:

warning: unknown variable/constant "{libraries}" detected, ignoring 
(macro:Select_headers_depends:1)
SectionGetFlags: ${libraries}->$0
IntOp: $0=$0|1
warning: unknown variable/constant "{libraries}" detected, ignoring 
(macro:Select_headers_depends:3)
SectionSetFlags: ${libraries}->$0
Usage: IntOp $(user_var: result) val1 OP [val2]
    OP=(+ - * / % | & ^ ~ ! || && << >>)
Error in macro Select_headers_depends on macroline 4
Error in macro MaybeSelectionChanged on macroline 14
Error in macro SectionList on macroline 3
Error in script 
"C:/ComponentExample/Source/_CPack_Packages/win32/NSIS/project.nsi" on line 831 
-- aborting creation process

I am using CMake 2.8.7, NSIS 2.46 and Windows 7 64 bit edition.

Is there any incompatibility with the version of the software used?

Thanks for your help!

Alexandre

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to