View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010437CMakeCMakepublic2010-03-18 07:412011-05-02 14:46
ReporterLysius 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in VersionCMake 2.8.4 
Summary0010437: support "install(TARGETS ... OPTIONAL)" with "add_executable(... EXCLUDE_FROM_ALL ...)"
DescriptionUsing the combination

add_executable(test EXCLUDE_FROM_ALL test.cpp)
install(TARGETS test DESTINATION test OPTIONAL)

results in the warning message
WARNING: Target "test" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case.

It does though what I expect:
when I run "make install" without "make test" first, nothing is installed, when I do run "make test" first, the executable is installed.

So I think the warning should be silenced when the install command has OPTIONAL set.

I tested with 2.6.4 and 2.8.1, both show the same behavior.
TagsNo tags attached.
Attached Filesgz file icon testcase.tar.gz [^] (338 bytes) 2010-03-18 07:41

 Relationships

  Notes
(0024798)
David Cole (manager)
2011-01-17 15:03

If you are using "EXCLUDE_FROM_ALL" then you should not be installing the thing that's built by that add_executable command.

If you want to install it, do not use EXCLUDE_FROM_ALL.

If you want something to be optional, then use logic, variables and IF commands in your CMakeLists files to make it optional. Then, it it's on, it gets built and installed, and if it's off, you avoid both build and install. Optional, but controlled by your configure-time logic, rather than the build-time whims of what targets a developer chooses to build in what order.

We are not going to add an OPTIONAL keyword to the install command. If it's not built, leave it out, if it is built, do what you like.

Please re-open this issue and convince me, if you feel strongly about it.
(0026348)
David Cole (manager)
2011-05-02 14:46

Closing resolved issues that have not been updated in more than 3 months.

 Issue History
Date Modified Username Field Change
2010-03-18 07:41 Lysius New Issue
2010-03-18 07:41 Lysius File Added: testcase.tar.gz
2011-01-17 15:00 David Cole Assigned To => David Cole
2011-01-17 15:00 David Cole Status new => assigned
2011-01-17 15:03 David Cole Note Added: 0024798
2011-01-17 15:03 David Cole Status assigned => resolved
2011-01-17 15:03 David Cole Fixed in Version => CMake 2.8.4
2011-01-17 15:03 David Cole Resolution open => won't fix
2011-05-02 14:46 David Cole Note Added: 0026348
2011-05-02 14:46 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team