FIX: separated situation of building/installing on target_include_directories on cmake#1966
FIX: separated situation of building/installing on target_include_directories on cmake#1966Dalmurii wants to merge 1 commit intogodotengine:masterfrom
Conversation
|
@Dalmurii So for now, I await an update. |
|
Sorry for lack of explanation. CMake strictly requires the separation when adding inclusion for directories for C/C++. Directory to include should not be prefixed by source (where the CMakeLists.txt) for installation, since guaranteeing installing will happen on source is barely possible. Existing source was including full path of directory without condition, and that breaks the exportation of target being installed referring to it according to above. I have branched it by two with generator expressions to fix this behaviour. |
|
We don't use any installation things at all right now, for reasons. This would be the first piece of code that explicitly caters to installation if merged. Can you tell me about your extension workflow and how you currently use installation in that workflow? |
While installation is not possible in godot-cpp, one might want to export this project with his own. I am the one trying this and faced this. |
|
Following is problematic on my side: target_link_libraries(libdne-common # generated one with install
INTERFACE
godot-cpp # exported
ae2f::Core
ae3f::met2d
)
# godot-cpp now can be installed.
# tries also finding directories to include
# crashes when source-prefixed.
install(TARGETS godot-cpp EXPORT commonTargets)Like this, godot-cpp could be installed despite the lack of installation script. |
|
OK excellent, thanks for providing more info. If I am understanding you correctly, you're producing middle-ware using godot-cpp, that would be consumed by a third party(could also be your own project). CMake export workflow requires separation of the build/install to work properly. Is that about right? I have to spend some time re-learning the install/export/import workflow that a lot of CMake user use. These things have been requested in the past, only to be shut down because they act too much like installs and we don't want package maintainers to start packaging godot-cpp. While we still don't want package maintainers to create packages, supporting the widely used export/import workflow is now OK. I just haven't spent the time to really get stuck into it. I'll try to block out some time, so if you have any resources that will shorten my learning curve, feel free to link them. |
|
Since we don't have any other install/export based code in the repo, would making the files BUILD_INTERFACE only still work for you? Or do you need the INSTALL_INTERFACE for your project? |
|
I would check as soon as possible and if remove install interface part when not strictly necessary |
|
I have not seen above truely sorry, I am now responding it.
Turns out
You are understanding correctly. For detail, my stupid macro generator interface library is marked (could be installed) refers to godot-cpp, which expects godot-cpp to separate the directory to include.
So since we are not making any exportation of
Reading first sentence of this paragraph would help in this case. |
|
Great, I'm glad I we seem to have an understanding, I'll approve the merge now as the changes are appropriate, just squash the commits, and we'll get someone to approve the workflow. Cheers. |
…ectories on cmake SEE: godotengine#1966 Changes to be committed: - modified: binding_generator.py - modified: cmake/godotcpp.cmake - modified: include/godot_cpp/core/object.hpp
|
Commits has been squashed. |
enetheru
left a comment
There was a problem hiding this comment.
Preventing the fully qualified paths from ending up in middle ware extensions that do want to perform install/export is a good thing.
There are probably more things that we can to towards this end, but for now this solves a real problem for someone so I approve.
enetheru
left a comment
There was a problem hiding this comment.
some additional changes have crept in that sholdnt be there.
|
I think I've falsely squashed? I will try staging only one file manually |
|
And if you can edit the description for anyone who views in the future that would also be good, cheers. |
…ectories on cmake SEE: godotengine#1966 Changes to be committed: - modified: cmake/godotcpp.cmake
Would summarising this enough? |
good plan. |
|
Checks seems to be failing? I will try resolving gersemi thing. |
|
I recommend installing |
…ectories on cmake SEE: godotengine#1966 Changes to be committed: - modified: cmake/godotcpp.cmake
Oh this is very convenient |
Basically it is not about "making export enabled". I am talking about a simple policy that included directories(for headers) must not be children of where root CMakeLists.txt is when being exported.
This check is hard-coded behaviour not to confuse the system, since installation in this context stands for a situation that several wanted files(headers, library files, etc) should move to another path then original.
Since we are not making any exportation of godot-cpp itself, you do not need to understand those to understand this request I am writing.
For detail, my stupid macro generator interface library is marked (could be installed) refers to godot-cpp, which expects godot-cpp to separate the directory to include.
Reading first sentence of this paragraph would help in this case.