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,802
    • Issues 3,802
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • 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
  • #23049

Closed
Open
Created Dec 23, 2021 by Kim Kryger@kimberly.kryger

Cannot use custom properties with suffix `_LOCATION` in generator expressions

https://gitlab.kitware.com/cmake/cmake/-/blob/26ab79082084ef09ba55315e4b846b1d362d6c41/Source/cmTargetPropertyComputer.h#L77-80

I set some properties on executable that has the suffix _LOCATION and this code seems to throw an error if any property ends with that suffix when CMP0026 is set to NEW. I don't particularly wish to set the policy to OLD, and these names come from a properties file I read that is provided to me. I can perhaps set a suffix to work around it but am hesitant to do so.

add_library(app_interface INTERFACE
target_compile_definitions(app_interface INTERFACE

  DERIVATIVE_$<TARGET_PROPERTY:DERIVATIVE>
  EXAMPLE_CODE_LOCATION_$<TARGET_PROPERTY:EXAMPLE_CODE_LOCATION>

)

add_executable(application)
set_target_properties(application PROPERTIES
DERIVATIVE FOO
EXAMPLE_CODE_LOCATION RAM
)
target_link_libraries(application PRIVATE
app_interface
)

Adding a suffix to the property with _LOCATION will allow the code to generate without errors. So maybe the logic for the cmTargetPropertyComputer.h should be a bit smarter?

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