Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,923
    • Issues 3,923
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #20168
Closed
Open
Created Jan 03, 2020 by Craig Scott@craig.scottMaintainer

EXCLUDE_FROM_ALL directory property at top level no longer works since CMake 3.15.4

The following minimal project can be used to demonstrate that the EXCLUDE_FROM_ALL directory property no longer has any effect if set in the top level directory, starting with the CMake 3.15.4 release:

CMakeLists.txt

cmake_minimum_required(VERSION 3.14)
project(dirPropRegression)

set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES)
add_subdirectory(child)

child/CMakeLists.txt

add_executable(subapp main.cpp)  # Contents of main.cpp are just int main() { return 0; }

Building this project without specifying a target should result in the "all" target being built, which in turn should build nothing. With CMake 3.15.4 or later, it still builds the subapp target, even though the child directory has been excluded from the all target. The likely culprit is !3863 (merged) which was also back-ported to CMake 3.14.7, which also shows the regression (3.14.6 is fine and so is 3.15.0).

A brief scan of the tests also suggests that we don't have any test cases that cover the EXCLUDE_FROM_ALL directory property.

Edited Jan 03, 2020 by Craig Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking