MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013188 | CMake | CMake | public | 2012-05-04 01:04 | 2014-06-02 08:37 |
Reporter | bungeman | ||||
Assigned To | Stephen Kelly | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Ubuntu | OS | Linux | OS Version | 3.0.0-17-generic |
Product Version | CMake 2.8.8 | ||||
Target Version | Fixed in Version | CMake 3.0 | |||
Summary | 0013188: Target and directory include_directory usage. | ||||
Description | I tried out the newly added target and directory INCLUDE_DIRECTORIES property and ran into some issues. I can't seem to be able to set the directory property at all. The target property appears to treat relative includes as being relative to the build directory, which is confusing since include_directories(...) treats them relative to the source (CMakeLists.txt) directory. | ||||
Steps To Reproduce | ./main.cpp #include "target_include.h" int main(int, char**) { return foo; } ./include/target_include.h #define foo 0 ./CMakeLists.txt cmake_minimum_required(VERSION 2.8.8) project(directory_includes) add_executable(target main.cpp) #when attempting to 'make' in './build' subdirectory after running 'cmake ..' #does not work but should #set_property(TARGET target APPEND PROPERTY INCLUDE_DIRECTORIES "includes") #set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "includes") #set_directory_properties(PROPERTY INCLUDE_DIRECTORIES "includes") #set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/includes") #set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/includes") #set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/includes") #set_directory_properties(PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/includes") #shouldn't work, and doesn't #set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "../includes") #set_directory_properties(PROPERTY INCLUDE_DIRECTORIES "../includes") #works, and should #set_property(TARGET target APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/includes") include_directories(includes) #works, and shouldn't #set_property(TARGET target APPEND PROPERTY INCLUDE_DIRECTORIES "../includes") | ||||
Additional Information | Note that all of the above which fail parse and generate makefiles fine, but the resulting makefiles fail to build as they do not include 'includes' in the list of include directories. This was tested with current master branch (c196e9ea). The one test in Tests/IncludeDirectories just tests the one new case which does work and should -- that setting INCLUDE_DIRECTORIES with an absolute path works. There are a few places where the directory version is used or tested, but it only appears to be testing that it parsed ok, not that it actually worked. It seems like there should be at least one test like Tests/IncludeDirectories/TargetIncludeDirectories called DirectoryIncludeDirectories. If these are supposed to be relative to the build directory, then it would be useful to document that, though it certainly seems like they should be relative to the source directory. I suppose there should be tests for this as well. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-05-04 01:04 | bungeman | New Issue | |||
2012-05-05 16:58 | Stephen Kelly | Note Added: 0029403 | |||
2012-05-07 09:11 | Brad King | Assigned To | => Stephen Kelly | ||
2012-05-07 09:11 | Brad King | Status | new => assigned | ||
2012-05-07 09:17 | Brad King | Note Added: 0029414 | |||
2012-05-17 14:03 | David Cole | Note Added: 0029502 | |||
2012-05-21 13:09 | Stephen Kelly | Note Added: 0029530 | |||
2012-05-21 13:09 | Stephen Kelly | Status | assigned => resolved | ||
2012-05-21 13:09 | Stephen Kelly | Resolution | open => fixed | ||
2012-05-24 13:14 | David Cole | Note Added: 0029559 | |||
2012-05-24 13:14 | David Cole | Assigned To | Stephen Kelly => David Cole | ||
2012-05-24 13:14 | David Cole | Status | resolved => assigned | ||
2012-11-21 14:57 | David Cole | Note Added: 0031660 | |||
2012-11-21 14:59 | David Cole | Assigned To | David Cole => | ||
2012-11-21 15:11 | David Cole | Status | assigned => new | ||
2012-11-21 15:11 | David Cole | Note Added: 0031669 | |||
2013-11-02 09:40 | Stephen Kelly | Note Added: 0034317 | |||
2013-11-02 09:40 | Stephen Kelly | Status | new => resolved | ||
2013-11-02 09:40 | Stephen Kelly | Fixed in Version | => CMake 3.0 | ||
2013-11-02 09:40 | Stephen Kelly | Assigned To | => Stephen Kelly | ||
2014-06-02 08:37 | Robert Maynard | Note Added: 0035983 | |||
2014-06-02 08:37 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|