View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015907 | CMake | CMake | public | 2016-01-10 11:15 | 2016-05-02 08:30 | ||||
Reporter | Philippe | ||||||||
Assigned To | Nils Gladitz | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | Linux | OS | Debian | OS Version | unstable | ||||
Product Version | CMake 3.4.1 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0015907: [ninja] wrong dependency management with imported targets from external project or custom target | ||||||||
Description | Here is a simple CMakeLists to reproduce my problem: # in my case, this line is actually an ExternalProject_Add add_custom_target(outfile COMMAND gcc ${CMAKE_CURRENT_SOURCE_DIR}/lib.c -shared -o liboutfile.so) add_library( mylib SHARED IMPORTED ) set_property( TARGET mylib PROPERTY IMPORTED_LOCATION liboutfile.so ) add_dependencies( mylib outfile ) add_executable( testexe test.c ) target_link_libraries( testexe mylib ) This ensures that before we try to link with the mylib target, the outfile target is built. Except it works only with the Unix Makefiles generator but not with the Ninja one. With Ninja I get this error before it tries to do any work: ninja: error: 'liboutfile.so', needed by 'testexe', missing and no known rule to make it I'm attaching a simple and complete test project to reproduce. | ||||||||
Steps To Reproduce | 1. download and uncompress the attached testproj 2. configure with the Ninja generator 3. try build with ninja and get an error | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | testproj.tar.bz2 [^] (570 bytes) 2016-01-10 11:15 | ||||||||
Relationships | |
Relationships |
Notes | |
(0040172) Nils Gladitz (developer) 2016-01-10 12:21 |
For Ninja you need to declare liboutfile.so a byproduct (BYPRODUCTS keyword in add_custom_command()). ExternalProject_Add() supports this through the BUILD_BYPRODUCTS option. |
(0040173) Philippe (reporter) 2016-01-10 12:35 |
Indeed, it works! Thank you. You can close this :) |
(0040997) Robert Maynard (manager) 2016-05-02 08:30 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2016-01-10 11:15 | Philippe | New Issue | |
2016-01-10 11:15 | Philippe | File Added: testproj.tar.bz2 | |
2016-01-10 12:21 | Nils Gladitz | Note Added: 0040172 | |
2016-01-10 12:35 | Philippe | Note Added: 0040173 | |
2016-01-11 05:06 | Nils Gladitz | Status | new => resolved |
2016-01-11 05:06 | Nils Gladitz | Resolution | open => no change required |
2016-01-11 05:06 | Nils Gladitz | Assigned To | => Nils Gladitz |
2016-05-02 08:30 | Robert Maynard | Note Added: 0040997 | |
2016-05-02 08:30 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |