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,925
    • Issues 3,925
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 21
    • Merge requests 21
  • 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
  • #21442
Closed
Open
Created Nov 13, 2020 by Alessandro Ambrosano@aambrosanoContributor

CMake generates wrong Visual Studio projects for C# targets when AUTOMOC is on

On a CMake project mixing C++ and C# targets, if AUTOMOC is on, CMake will automatically generate mocs_compilation.cpp for all C# targets, as cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer doesn't filter out non C++ projects for moc generation. At that point cmGeneratorTarget::IsCSharpOnly() will return false on C# targets (the languages for the targets will be "CXX" and "CSharp"), CMake generates a vcxproj file instead of a csproj file for them, and the build fails.

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