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,806
    • Issues 3,806
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • 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
  • #21421

Closed
Open
Created Nov 11, 2020 by Ghost User@ghostContributor

Cmake-Gui : CMAKE_SOURCE_DIR bug

https://discourse.cmake.org/t/cmake-gui-not-detecting-top-level-project/2142

This discussion covers the bug pretty well but essentially it boils down to this.

image

Note in the above picture the source directory ends with a trailing '/'

This causes problems when users check for the top level project. Here is some example code that hit this bug.

if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
    set(FOOBAR_IS_TOP_LEVEL ON)
endif()

The project will never be top level because CMAKE_SOURCE_DIR will end in a trailing '/' while CMAKE_CURRENT_SOURCE_DIR will not.

Basically the inputs of cmake-gui need to be sanitized to prevent this type of error.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking