MantisBT - CMake
View Issue Details
0007829CMakeCPackpublic2008-10-19 03:092011-05-02 14:45
Sam Baker 
David Cole 
highfeatureN/A
closedfixed 
CMake-2-6 
CMake 2.8.4CMake 2.8.4 
0007829: CPACK_PACKAGE_EXECUTABLES should allow executables from anywhere
Currently CPACK_PACKAGE_EXECUTABLES doesn't allow a path for the executable and just assumes that it's in a bin directory. This isn't ideal for my project - it would be nice if there was an option to use a path into any part of the install tree.
David Cole suggested that I add this feature request after reporting as a potential bug on the mailing list. Current behavior is as designed but the design is restrictive.
No tags attached.
related to 0007828closed David Cole Impossible to create a Nullsoft installer without referencing bin folder 
related to 0010644closed David Cole problem using CPACK_NSIS_MENU_LINKS with non-http urls 
related to 0010591closed David Cole For NSIS, CPack erroneously enforces a ..\bin\ folder 
Issue History
2008-10-19 03:09Sam BakerNew Issue
2008-10-20 10:26David ColeStatusnew => assigned
2008-10-20 10:26David ColeAssigned To => David Cole
2010-03-21 05:58ediceNote Added: 0019972
2010-08-29 01:18Kovarththanan RajaratnamCategoryCMake => CPack
2010-09-09 17:52David ColePrioritynormal => high
2010-11-10 21:09David ColeTarget Version => CMake 2.8.4
2011-01-07 17:23David ColeNote Added: 0024520
2011-01-07 17:28David ColeNote Edited: 0024520bug_revision_view_page.php?bugnote_id=24520#r83
2011-01-07 17:38David ColeRelationship addedrelated to 0007828
2011-01-07 17:38David ColeRelationship addedrelated to 0010644
2011-01-07 17:39David ColeRelationship addedrelated to 0010591
2011-01-07 17:39David ColeNote Added: 0024521
2011-01-07 17:39David ColeStatusassigned => resolved
2011-01-07 17:39David ColeFixed in Version => CMake 2.8.4
2011-01-07 17:39David ColeResolutionopen => fixed
2011-05-02 14:45David ColeNote Added: 0026325
2011-05-02 14:45David ColeStatusresolved => closed

Notes
(0019972)
edice   
2010-03-21 05:58   
I consider this a bug.

I did the following:
  install (TARGETS my_program DESTINATION .)
And it will correctly install the executable to c:\Program Files\MyProject\my_program.exe

However, I cannot make CPack-NSIS create StartMenu shortcuts that point to that executable. It INSISTS on pointing to bin\my_program.exe which is annoying.

It would be good if this problem were resolved.

Thanks,
Paul

ps in the meantime, it seems I am forced to install to a bin directory.
(0024520)
David Cole   
2011-01-07 17:23   
(edited on: 2011-01-07 17:28)
As of this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=702c8f8ba79591744449244ed47a5181fdf68a63 [^]

you can set CPACK_NSIS_EXECUTABLES_DIRECTORY to anything you want -- it defaults to "bin" for backwards compatibility, but you should be able to set it to "." for the root of the install or to "some\\other\\path\\in\\your\\install\\tree" if you would like.

This value is automatically pre-pended to the strings that you set in CPACK_PACKAGE_EXECUTABLES.

You could set this to "." and then specifying CPACK_PACKAGE_EXECUTABLES something like this:
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_PACKAGE_EXECUTABLES
  "bin\\exe1" "The First Exe"
  "other\\exe2" "The Second Exe"
  "exe3" "Top Dog Top Directory Exe"
)


Alternatively, after this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1bbe4e69171f3155f262bb12f15437db4b71c207 [^]

CPACK_NSIS_MENU_LINKS may now be used directly to refer to any files, separately from CPACK_PACKAGE_EXECUTABLES, not just *.exe files under CPACK_NSIS_EXECUTABLES_DIRECTORY... So you could just as easily now *not* set the new dir variable, but rather simply do:

set(CPACK_NSIS_MENU_LINKS
  "bin\\exe1.exe" "The First Exe"
  "other\\exe2.exe" "The Second Exe"
  "exe3.exe" "Top Dog Top Directory Exe"
)


Either way you slice it, I think both of these ways should work and be able to qualify as fixing the reported symptoms in this issue... I am going to resolve this as fixed. Feel free to re-open it if you disagree, or feel there is a need for further discussion.

Thanks!

(0024521)
David Cole   
2011-01-07 17:39   
Fixed by the same commits that fix the related issues 0007828 and 0010644
(0026325)
David Cole   
2011-05-02 14:45   
Closing resolved issues that have not been updated in more than 3 months.