Hi Everybody,
I intend to define a variable in CB project from shell cmd return value.
example :
QuotePYBIND_INCLUDE=$(python -m pybind11 --includes)
of course
$(something) use
something as a variable label in C::B project, unlike executed in the shell environment.
Does anyone have any ideas?
have a nice day
The tilted tic does that in places in CB [`] the tic between the square brackets.
Edit you need one at both the start and end of the command.
Edit2: I have never used it to define a variable; so, not sure where all it works.
I have used it in both compiler and linker extra setting.
Tim S.
Thanks stahta01 :
it works halfway :D
in CodeBlocks_project_file/Project/Build/Environment
add 2 variables :
<Variable name="PYBIND_INCLUDES" value="`python -m pybind11 --includes`" />
<Variable name="PYBIND_EXTENTION" value="`python -m pybind11 --extension-suffix`" />
in CodeBlocks_project_file/Project/Build/Target/Compiler
add this :
<Add option="$(PYBIND_INCLUDES)" />
(this is the half part that works fine :) )
But here it doesn't works :( :
in CodeBlocks_project_file/Project/Build/Target/Option/@output
<Option output="bin/Debug/trie$(PYBIND_EXTENTION)" ... >
the var is literally copied in the link cmd :
g++-13 -shared obj/Debug/src/mod1.o obj/Debug/src/mod2.o -o "bin/Debug/libmylib`python -m pybind11 --extension-suffix`.so" -m64
Perhaps there is a better way for that second part ?
(I try ton compile c++ lib for use it in python. It's new for me. I 'll hive probably other question how to parameterize C::B to fit in python env)