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,872
    • Issues 3,872
    • 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
  • #17742
Closed
Open
Created Feb 15, 2018 by Semyon Kolton@semyon.koltonContributor

Can't call targets that contain forward slashes in names on with MinGW Makefile generator

MinGW Makefile generator sometimes creates targets with forward slashes in names. E.g. for CMakeLists.txt:

add_executable(<my-executable> some/source/file.cpp)

CMake will generate target named some/source/file.obj for compilation of this single file. But on MinGW calling this target through CMake (cmake.exe --build <build-dir> --target some/source/file.obj) will result in error:

mingw32-make.exe: *** No rule to make target 'some\source\file.obj'.  Stop.

This happens with every target that contain forward slashes. Forward slashes are converted to backward which causes error during target resolution. I could reproduce this error only with MinGW generator. NMake generator and Unix Makefiles generator works fine.

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