[CMake] [Re] How to select components by default using CPack ?

Konstantin Podsvirov konstantin at podsvirov.pro
Sat Jan 9 15:15:24 EST 2016


Hi David!

I found your letter here:

http://public.kitware.com/pipermail/cmake/2015-December/062188.html

Earlier I was not subscribed to the CMake Users.

I see that you try to use IFW generator.

Can offer you the following variant of the script:

cmake_minimum_required(VERSION 3.2)
project(test)

set(CPACK_PACKAGE_NAME Hello)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hello world using IFW")
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_GENERATOR "IFW")
set(CPACK_COMPONENTS_GROUPING "IGNORE")

set(PLUGINS one two)

foreach (plugin ${PLUGINS})
 install(
 FILES ${plugin}.js
 COMPONENT plugin_${plugin}
 DESTINATION plugins
 )

 list(APPEND CPACK_COMPONENTS_ALL plugin_${plugin})
endforeach ()

include(CPack)
include(CPackIFW)

cpack_add_component_group(plugins)

foreach (plugin ${PLUGINS})
 cpack_add_component(
 plugin_${plugin}
 DISPLAY_NAME "${plugin}"
 DESCRIPTION "Install ${plugin}.js"
 GROUP plugins
 )
endforeach ()

(not tested, but should work :-)

In this embodiment do not need to create a dummy group.
Also all the plugins are selected by default. If you want you can
to indicate return putting in DISABLED when the component is added.

If you have more questions, ask. I'll try to answer.

--
Regards,
Konstantin Podsvirov


More information about the CMake mailing list