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,810
    • Issues 3,810
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • 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
  • #19454
Closed
Open
Created Jul 07, 2019 by Florian Bernd@flobernd

`source_group(TREE)` not working for source files any longer

Hi there,

I'm using the following code to create source groups for Visual Studio:

get_property("TARGET_SOURCE_FILES" TARGET "${target}" PROPERTY SOURCES)
source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES ${TARGET_SOURCE_FILES})

This always used to work fine for me - until I upgraded my CMake version some time ago (not sure which version I was using before). I'm on version 3.15.0-rc3 now and the source groups are correctly generated for all header files (./include/LibName/xxx.h) but not for the source files (./src/xxx.c).

All source files are instead put in the default group "Source Files".

Best regards

Edited Jul 08, 2019 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking