View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015682CMakeCMakepublic2015-08-05 02:332016-06-10 14:31
ReporterSam Spilsbury 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformApple MacOSOS XOS Version10.4.10
Product VersionCMake 3.3 
Target VersionFixed in Version 
Summary0015682: [biicode] Ninja generator uses relative paths in target description when including parent directory
DescriptionThis is the typical directory tree that biicode uses:

CMakeLists.txt
 - bii
   |
   - cmake
     |
     - biicode.cmake
     - CMakeLists.txt
   - build
- bin
- lib

Biicode starts from bii/cmake/CMakeLists.txt which includes bii/cmake/biicode.cmake which then adds the top-level CMakeLists.txt as a subdirectory.

bin and lib are set to CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_ARCHIVE_OUTPUT_DIRECTORY respectively.

When using the ninja generator with this layout, relative paths are inserted into the build.ninja file, for example:

#############################################
# Link the executable ../../bin/main

build ../../bin/main: C_EXECUTABLE_LINKER build_dir/CMakeFiles/main.dir/main.c.o
  POST_BUILD = :
  PRE_LINK = :
  TARGET_PDB = main.dbg
# =============================================================================
# Target aliases.

However, the all target specifies the absolute path to the output file:

#############################################
# The main all target.

build all: phony /Users/smspillaz/Source/polysquare/cmake-ninja-test/bin/main

Which causes ninja to fail:

ninja: error: '/Users/smspillaz/Source/polysquare/cmake-ninja-test/bin/main', needed by 'all', missing and no known rule to make it
Steps To ReproduceTarball of reduced testcase included.

$ cd bii/
$ mkdir build
$ cd build/
$ cmake ../cmake -G
$ ninja
Additional InformationGranted, this is a strange build configuration, however biicode uses it and it doesn't appear to me that there is any other way of doing what they want to do without breaking their interface.
TagsNo tags attached.
Attached Filesgz file icon cmake-ninja-test.tar.gz [^] (2,279 bytes) 2015-08-05 02:33

 Relationships

  Notes
(0042816)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-08-05 02:33 Sam Spilsbury New Issue
2015-08-05 02:33 Sam Spilsbury File Added: cmake-ninja-test.tar.gz
2016-06-10 14:29 Kitware Robot Note Added: 0042816
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team