MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014631 | CMake | CMake | public | 2013-12-04 14:33 | 2014-06-02 08:37 |
Reporter | Ryan H. Kawicki | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Microsoft | OS | Windows | OS Version | 6.1.7601 |
Product Version | CMake 2.8.11.1 | ||||
Target Version | CMake 3.0 | Fixed in Version | CMake 3.0 | ||
Summary | 0014631: source_group should document behavior of relative paths | ||||
Description | Output of the custom command is unable to be properly placed in the IDE folder structure. // simple example cmake_minimum_required(VERSION 2.8.11.1) project(blah) set(all_src blah.cpp blah2.cpp) SOURCE_GROUP("BlahFiles\\Source" FILES ${all_src}) ADD_CUSTOM_COMMAND(OUTPUT blah2.cpp COMMAND del blah2.cpp COMMAND echo 2>blah2.cpp WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "create me some source") add_executable(blah_test WIN32 ${all_src}) // end simple example - first problem is that the IDE thinks that blah2.cpp is generated in binary source directory but the execution of the commands happens in the source directory. a little confusing and may need documentation updated to reflect this more clearly. - the first issue can be resolved by removing the WORKING_DIRECTORY command. This solves the issue of not being able to find it correctly in the IDE (even though not correct directory), the build rules are able to execute, but it still shows up in the wrong location in the IDE. - to resolve the second issue, we have to make a further change that i will just show in the next modified example below. What was changed was that I had to prefix CMAKE_CURRENT_BINARY_DIR to the source file to have it be able to place it correctly in the IDE. The odd thing here is that if not adding the prefix, things still work correctly. Add_executable, in the original issue, was still able to determine that blah2.cpp was a generated file and that it understood that the list of files provided somehow matched up (no cmake errors). Source_group, on the other hand, requires a full physical path of the generated file for it to properly find it in the list of provided source files, even though add_executable was able to determine that blah2.cpp was a GENERATED file without the full path. // simple example cmake_minimum_required(VERSION 2.8.11.1) project(blah) set(all_src blah.cpp "${CMAKE_CURRENT_BINARY_DIR}/blah2.cpp") SOURCE_GROUP("BlahFiles\\Source" FILES ${all_src}) ADD_CUSTOM_COMMAND(OUTPUT blah2.cpp COMMAND del blah2.cpp COMMAND echo 2>blah2.cpp COMMENT "create me some source") add_executable(blah_test WIN32 ${all_src}) // end simple example - my question / suggestion is to determine if it is possible for SOURCE_GROUP to also be able to understand, like add_executable, that blah2.cpp is a generated file and to marry the two together without the full path. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-12-04 14:33 | Ryan H. Kawicki | New Issue | |||
2013-12-04 14:58 | Brad King | Note Added: 0034715 | |||
2013-12-05 13:01 | Ryan H. Kawicki | Note Added: 0034726 | |||
2013-12-05 13:35 | Brad King | Note Added: 0034727 | |||
2013-12-05 13:35 | Brad King | Assigned To | => Brad King | ||
2013-12-05 13:35 | Brad King | Status | new => resolved | ||
2013-12-05 13:35 | Brad King | Resolution | open => fixed | ||
2013-12-05 13:35 | Brad King | Fixed in Version | => CMake 3.0 | ||
2013-12-05 13:35 | Brad King | Target Version | => CMake 3.0 | ||
2013-12-05 13:35 | Brad King | Summary | Unable To Add Output Of Custom Command To Source Group Command => source_group should document behavior of relative paths | ||
2014-06-02 08:37 | Robert Maynard | Note Added: 0036053 | |||
2014-06-02 08:37 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|