Note that there are some explanatory texts on larger screens.

plurals
  1. POhow get cpack to generate correct start menu shortcuts
    text
    copied!<p>I want to create an installer for some programs on windows with cmake and cpack. I want to be able to select which programs to install and the selected programs shall show up in the start menu as shortcuts. Here is a simple try. Have done one component for each program but can't figure out how to generate the start-menu variable. Now all programs is always in the menu even if they are not selected to be installed. First is a simple program to be installed.</p> <pre><code>#include &lt;iostream&gt; #include &lt;conio.h&gt; int main() { std::cout &lt;&lt; "prog1" &lt;&lt; std::endl; _getch(); return 0; } </code></pre> <p>and here is the CMakeLists.txt file</p> <pre><code>cmake_minimum_required( VERSION 2.8 ) project ( CompoTest ) add_executable(prog1 prog1.cpp) add_executable(prog2 prog2.cpp) add_executable(prog3 prog3.cpp) install(TARGETS prog1 RUNTIME DESTINATION bin COMPONENT compo1) install(TARGETS prog2 RUNTIME DESTINATION bin COMPONENT compo2) install(TARGETS prog3 RUNTIME DESTINATION bin COMPONENT compo3) set ( CPACK_PACKAGE_VERSION "1.0.0" ) set(CPACK_PACKAGE_EXECUTABLES prog1 "prog 1" prog2 "prog 2" prog3 "prog 3" ) set ( CPACK_COMPONENTS_ALL compo1 compo2 compo3 ) include (CPack) </code></pre> <p>The problem is to generate start menu shortcuts depending on which program is selected in the installation I thought it should be easy but it seems not to be. Is it possible to do this.</p> <p>Update: I find that no start menu shortcuts is generated for any example in <a href="http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack" rel="noreferrer">http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack</a> or am I doing something wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload