View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015755 | CMake | CMake | public | 2015-09-21 12:27 | 2016-02-01 09:10 | ||||
Reporter | Dimitri Merejkowsky | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake 3.3.2 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0015755: add_dependencies() undoes include_directories() | ||||||||
Description | Calling add_dependencies() between two targets causes some calls to include_directories() to no longer be taken into account | ||||||||
Steps To Reproduce | See attached project. $ mkdir b1 $ cmake .. $ make ... [ 25%] Linking C executable eggs CMakeFiles/eggs.dir/eggs.c.o: In function `main': eggs.c:(.text+0xa): undefined reference to `spam $ mkdir b2 $ cmake -DADD_DEPENDENCIES=ON .. $ make [ 25%] Building C object spam/CMakeFiles/spam.dir/src/spam.c.o spam/src/spam.c:1:23: fatal error: spam/spam.h: No such file or directory | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | spam.zip [^] (1,763 bytes) 2015-09-21 12:27 | ||||||||
Relationships | |
Relationships |
Notes | |
(0039462) Dimitri Merejkowsky (reporter) 2015-09-21 12:35 |
Note that if I add a line looking like include_directories(".") in spam/CMakeLists.txt, the header is found |
(0039471) Brad King (manager) 2015-09-22 13:24 |
The include_directories after the add_subdirectory has no influence on the subdirectory. The reason your "b1" case does not get the compiler error is that without add_dependencies there is no ordering between the targets so you happen to see the linker error before the "spam" library tries to build. Even in that case running "make spam" will see the missing header. |
(0040416) Robert Maynard (manager) 2016-02-01 09:10 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2015-09-21 12:27 | Dimitri Merejkowsky | New Issue | |
2015-09-21 12:27 | Dimitri Merejkowsky | File Added: spam.zip | |
2015-09-21 12:35 | Dimitri Merejkowsky | Note Added: 0039462 | |
2015-09-22 13:24 | Brad King | Note Added: 0039471 | |
2015-09-22 13:24 | Brad King | Status | new => resolved |
2015-09-22 13:24 | Brad King | Resolution | open => no change required |
2016-02-01 09:10 | Robert Maynard | Note Added: 0040416 | |
2016-02-01 09:10 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |