View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014921CMakeCMakepublic2014-05-19 04:472016-06-10 14:21
ReporterNick Lewis 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformAllOSAllOS VersionAll
Product VersionCMake 2.8.12.2 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0014921: No way to exclude a component install() from a full installation
DescriptionThere is currently no way to exclude a component install() from a full installation. Current workarounds using OPTIONAL do not work reliably because they depend on previous builds and on the order execution of the build and install commands for the components and the default target
Steps To Reproducemake
make tests
make install
DESTDIR=/testpkgs make install-tests

This results in test components in the default installation as well as the testpkg

Judging by questions on the mail list, users typically try to overcome this problem by adding the unsupported EXCLUDE_FROM_ALL keyword to the install command
Additional Informationpatch attached that adds support for EXCLUDE_FROM_ALL to the install() command.
TagsNo tags attached.
Attached Filespatch file icon cmake_install_exclude.patch [^] (24,130 bytes) 2014-05-19 04:47 [Show Content]
patch file icon cmake_3_2_2_install_exclude.patch [^] (23,369 bytes) 2015-07-16 12:20 [Show Content]
patch file icon cmake_3_4_2_install_exclude.patch [^] (23,369 bytes) 2016-01-29 03:29 [Show Content]
patch file icon correction_cmake_3_4_2_install_exclude.patch [^] (23,369 bytes) 2016-01-29 03:34 [Show Content]
patch file icon correction2_cmake_3_4_2_install_exclude.patch [^] (22,995 bytes) 2016-01-29 03:42 [Show Content]

 Relationships

  Notes
(0035899)
Brad King (manager)
2014-05-19 09:29

Interesting proposal. I think a change along these lines could also improve a case mentioned in the install() command documentation:

 http://www.cmake.org/cmake/help/v3.0/command/install.html [^]
 "Installing a target with the EXCLUDE_FROM_ALL target property set to TRUE has undefined behavior."

That refers to the use case when a target build is EXCLUDE_FROM_ALL and so is not created by "make" and may then be missing when "make install" is issued. This looks intended to support the same use case by making the install rule excluded from the default installation too. Perhaps install(TARGETS) should activate ExcludeFromAll when the corresponding property is set on the target.
(0039154)
Nick Lewis (reporter)
2015-07-16 12:22

Rebased patch on 3.2.2. Still no automatic setting of install(EXCLUDE_FROM_ALL) based on the setting of add_executable(EXCLUDE_FROM_ALL) though
(0039156)
Brad King (manager)
2015-07-17 09:49

Thanks for working on this. I think it will be better discussed on the cmake-developers mailing list:

 http://www.cmake.org/mailman/listinfo/cmake-developers [^]

That allows for design discussion with a broader audience than the issue tracker.
(0040353)
Nick Lewis (reporter)
2016-01-29 03:46

correction2_cmake_3_4_2_install_exclude.patch is the correct patch for cmake 3.4.2 - please ignore cmake_3_4_2_install_exclude.patch and correction_cmake_3_4_2_install_exclude.patch (or delete them)
(0040356)
Brad King (manager)
2016-01-29 08:44

Re 0014921:0040353: Thanks for updating the patch again, but please see 0014921:0039156. Also, the test suite will need to be updated to cover the feature.
(0040359)
Nick Lewis (reporter)
2016-01-29 09:46

Re 0014921:0039156 - The proposal was put on the cmake-developers mailing list as follows:

MIME-Version: 1.0
Received: by 10.140.102.239 with HTTP; Mon, 20 Jul 2015 00:36:10 -0700 (PDT)
In-Reply-To: <moe4e0$oh2$1@ger.gmane.org>
References: <CAKtwun52wXV5Gc65vqk7wDtBH06+5F3HLsERT+dD3u5pi=UaiQ@mail.gmail.com>
    <moe4e0$oh2$1@ger.gmane.org>
Date: Mon, 20 Jul 2015 08:36:10 +0100
Delivered-To: nick.lewis@usa.g4s.com
Message-ID: <CAKtwun6jhOH_6Wy=CeDgoEjZCXCkFnmedjgtWsAU6-hNAmNQnQ@mail.gmail.com>
Subject: Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature -
 request for comment
From: Nick Lewis <nick.lewis@usa.g4s.com>
To: Stephen Kelly <steveire@gmail.com>
Content-Type: multipart/alternative; boundary=94eb2c05fdb0725fbb051b49970f

--94eb2c05fdb0725fbb051b49970f
Content-Type: text/plain; charset=UTF-8

There is currently no way to exclude a component install() from a full
installation. Current workarounds using OPTIONAL do not work reliably
because
they depend on previous builds and on the order of the execution of the
build and
install commands for the components and the default target

Let us take an example of a project that has some tests in a component that
need to be installed into a dedicated test package. The user expectation is
that the result could be achieved by typing the following:

make
make tests
make install
DESTDIR=/testpkgs make install-tests

However this results in test components in the default installation as well
as the testpkg

Judging by questions on the mail list, users typically try to overcome this
problem by adding the
EXCLUDE_FROM_ALL keyword to the install() command but this is currently
unsupported. The patch uploaded to the issue tracker provides support for
it.

Brad has further suggested that the install(EXCLUDE_FROM_ALL) should be
implicitly set when installing components built with
add_executable/library(EXCLUDE_FROM_ALL)

I welcome your views on these ideas

Best Regards
Nick
(0040360)
Brad King (manager)
2016-01-29 09:55

Yes, sorry, I see it in the archives:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13700 [^]
(0040361)
Brad King (manager)
2016-01-29 09:57

Re 0014921:0040360: Actually, your message posted in 0014921:0040359 was addressed privately to Stephen Kelly and never made it to the list.

Anyway, I think the patch is a good start. Please revise it to update the test suite to cover the feature and then start a new thread on the list with the proposal text and patch together. Thanks!
(0040435)
Brad King (manager)
2016-02-03 14:32

Thanks for starting the new thread. For reference, it is here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15634 [^]
(0040463)
Brad King (manager)
2016-02-10 11:23

Changes from the thread linked in 0014921:0040435 are now in 'master':

 install: Add EXCLUDE_FROM_ALL option
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18ce97c4 [^]

 Tests: Add cases for install() command EXCLUDE_FROM_ALL option
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d321c196 [^]

 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL'
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=586e56d0 [^]
(0041258)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-05-19 04:47 Nick Lewis New Issue
2014-05-19 04:47 Nick Lewis File Added: cmake_install_exclude.patch
2014-05-19 09:29 Brad King Note Added: 0035899
2015-07-16 12:20 Nick Lewis File Added: cmake_3_2_2_install_exclude.patch
2015-07-16 12:22 Nick Lewis Note Added: 0039154
2015-07-17 09:49 Brad King Note Added: 0039156
2016-01-29 03:29 Nick Lewis File Added: cmake_3_4_2_install_exclude.patch
2016-01-29 03:34 Nick Lewis File Added: correction_cmake_3_4_2_install_exclude.patch
2016-01-29 03:42 Nick Lewis File Added: correction2_cmake_3_4_2_install_exclude.patch
2016-01-29 03:46 Nick Lewis Note Added: 0040353
2016-01-29 08:44 Brad King Note Added: 0040356
2016-01-29 09:46 Nick Lewis Note Added: 0040359
2016-01-29 09:55 Brad King Note Added: 0040360
2016-01-29 09:57 Brad King Note Added: 0040361
2016-02-03 14:32 Brad King Note Added: 0040435
2016-02-10 11:23 Brad King Note Added: 0040463
2016-02-10 11:24 Brad King Status new => resolved
2016-02-10 11:24 Brad King Resolution open => fixed
2016-02-10 11:24 Brad King Fixed in Version => CMake 3.6
2016-02-10 11:24 Brad King Target Version => CMake 3.6
2016-06-10 14:21 Kitware Robot Note Added: 0041258
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team