Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set custom path of implot and cimplot as generator's argument #17

Closed
gucio321 opened this issue Dec 3, 2022 · 9 comments
Closed

set custom path of implot and cimplot as generator's argument #17

gucio321 opened this issue Dec 3, 2022 · 9 comments

Comments

@gucio321
Copy link
Contributor

gucio321 commented Dec 3, 2022

Hi there!
I'm having a problemm in AllenDang/cimgui-go#43
We'd like to use cimplot as a git submodule of cimgui-go, but we met the problemm with paths mentioned above.

In my opinion something like

sh generator.sh --implot="../thirdparty/implot" --cimgui="../thirdparty/cimgui/cimgui.h"

would be more comfortable for people, who use this repository as a git submodule and cannot edit cimplot_template.* file

@gucio321 gucio321 changed the title set custom path of implot and cimplot in as generator's argument set custom path of implot and cimplot as generator's argument Dec 3, 2022
@sonoro1234
Copy link
Collaborator

sonoro1234 commented Dec 3, 2022

I am sorry but I dont understand the problem.
If you mean running https://github.com/cimgui/cimplot/blob/master/generator/generator.sh to generate cimplot from implot everything looks ok in https://github.com/AllenDang/cimgui-go, it has the same folder structure as https://github.com/sonoro1234/LuaJIT-ImGui

Why should you want to edit cimplot_template.*?

@sonoro1234
Copy link
Collaborator

sonoro1234 commented Dec 3, 2022

As for the problem mentioned in AllenDang/cimgui-go#43 (comment) I am not sure if it is a building problem.

cd examples
go run .

If it is a building problem it should be handled as in https://github.com/sonoro1234/LuaJIT-ImGui/blob/docking_inter/CMakeLists.txt#L7 where the compiler included directories are seting the -I flag

@gucio321
Copy link
Contributor Author

gucio321 commented Dec 3, 2022

Oh, I'm sorry, it seems my report lacks some important information

If you mean running https://github.com/cimgui/cimplot/blob/master/generator/generator.sh to generate cimplot from implot everything looks ok in https://github.com/AllenDang/cimgui-go, it has the same folder structure as https://github.com/sonoro1234/LuaJIT-ImGui

yah, that part works like a charm!

Why should you want to edit cimplot_template.*?

I'd like to change include path here

#include "cimgui.h"

from cimgui.h to ../cimgui/cimgui.h, since it is a valid path for our repo.
The problemm is, that CGO compiler keeps the folder structure, so the path there needs to point the exact location of cimgui.h

@sonoro1234
Copy link
Collaborator

sonoro1234 commented Dec 3, 2022

googling: CGO compiler include paths

Perhaps this can help? https://stackoverflow.com/questions/38381357/how-to-point-to-c-header-files-in-go

-I flag must be setted somehow as can be done in any C compiler

@gucio321
Copy link
Contributor Author

gucio321 commented Dec 3, 2022

googling: CGO compiler include paths

Perhaps this can help? https://stackoverflow.com/questions/38381357/how-to-point-to-c-header-files-in-go

-I flag must be setted somehow as can be done in any C compiler

yah, but the problemm is on the C side: cimplot's header cannot find cimgui.h, because it looks for ./cimplot/cimgui.h, but the file doesn't exist

When I manually edit cimplot.h, the problemm dissappears

It is also possible that I missunderstand C, since I'm not an expert 😄

@sonoro1234
Copy link
Collaborator

sonoro1234 commented Dec 3, 2022

yah, but the problemm is on the C side: cimplot's header cannot find cimgui.h, because it looks for ./cimplot/cimgui.h, but the file doesn't exist

Not at all. It does not look for ./cimplot/cimgui.h but for cimgui.h anywhere in the include paths. (They are set by the -I flags as I told you before)

@gucio321
Copy link
Contributor Author

gucio321 commented Dec 3, 2022

Oh ok, thx
Will test tomorrow

@eliasdaler
Copy link

Looks like XY Problem. The problem here is that you didn't change CGo include paths, with them it #include "cimgui.h" doesn't need to be changed in any way.

@gucio321
Copy link
Contributor Author

gucio321 commented Dec 4, 2022

Probably, you're right, there is everything OK with cimplot 😄
Closing for now.

@gucio321 gucio321 closed this as completed Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants