| View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0016102 | CMake | CMake | public | 2016-05-12 18:09 | 2016-05-15 07:45 | ||||
| Reporter | pboettch | ||||||||
| Assigned To | |||||||||
| Priority | normal | Severity | major | Reproducibility | always | ||||
| Status | closed | Resolution | no change required | ||||||
| Platform | Linux | OS | Debian | OS Version | Stretch | ||||
| Product Version | CMake 3.5.2 | ||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0016102: target_include_directories behaves differently on STATIC and SHARED libraries | ||||||||
| Description | Consider the following CMakeLists.txt: add_library(lib1 INTERFACE) target_include_directories(lib1 INTERFACE /lib1-dir) add_library(lib3 STATIC src3.c) target_include_directories(lib3 PUBLIC /lib3-dir) target_link_libraries(lib3 PRIVATE lib1) add_executable(exe1 exe.c) target_link_libraries(exe1 lib3) Here lib3 is privately linking with lib1. However, during the compilation of exe.c I see -I/lib1-dir is passed to gcc. When creating lib3 as a SHARED library it works as expected. I understand that lib1 needs to be linked to exe1 if lib3 is STATIC and that this not necessary when lib3 is SHARED. However this logic does not apply for include_directories (or compile-definitions and compile-options), which should, IMHO, never be passed on if link is PRIVATE. Hence this bug-report. | ||||||||
| Tags | No tags attached. | ||||||||
| Attached Files | |||||||||
| Relationships | |
| Relationships |
| Notes | |
|
(0041064) Brad King (manager) 2016-05-13 08:56 |
This functionality depends on CMP0022 being set to NEW. Use cmake_minimum_required(VERSION 2.8.12) # or higher at the top of your top-level CMakeLists.txt file to make this happen. |
| Notes |
| Issue History | |||
| Date Modified | Username | Field | Change |
| 2016-05-12 18:09 | pboettch | New Issue | |
| 2016-05-13 08:56 | Brad King | Note Added: 0041064 | |
| 2016-05-13 08:56 | Brad King | Status | new => resolved |
| 2016-05-13 08:56 | Brad King | Resolution | open => no change required |
| 2016-05-13 08:56 | Brad King | Steps to Reproduce Updated | |
| 2016-05-15 07:45 | pboettch | Status | resolved => closed |
| Issue History |
| Copyright © 2000 - 2018 MantisBT Team |