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,808
    • Issues 3,808
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • 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
  • #19597

Closed
Open
Created Aug 13, 2019 by Daniel Russell@danielmrussell

SOURCE_DIR target property should be whitelisted for INTERFACE libraries

I'm using the Catch2 testing framework in my project. It comes with a CMake module in a subdirectory /contrib, and I have multiple subprojects that would like to link to it and call the scripts in that module directory. I tried this bit of code to do that in my subproject's CMakeLists.txt files.

Instead of hardcoding the directory, I want to call get_target_property(locationOfCatch Catch2::Catch2 SOURCE_DIR) then append it to the CMAKE module path after a slight string edit.

This is what I get though:

CMake Error at extern/tuvok/tests/CMakeLists.txt:35 (get_target_property):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "SOURCE_DIR" is not allowed.

Hmphhh.

Thanks.

Edited Aug 19, 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