Am Dienstag, 9. Oktober 2007 15:22:32 schrieb [EMAIL PROTECTED]:
> Hi Maik
>
> > I want to fetch a environment variable which contains
> > semicolon by intention, modify it a little and use it with a
> > custom command:
> >
> > #TEXINPUTS_latex is ":;${workspace_loc}/texmf/texmf/tex//"
> > SET(TEXINPUTS "$ENV{TEXINPUTS_latex};${PROJECT_SOURCE_DIR}")
> > #TEXINPUTS should be
> > ":;${workspace_loc}/texmf/texmf/tex//;/path/to/project"
> >
> > ADD_CUSTOM_COMMAND(
> >     OUTPUT       ${PROJECT_BINARY_DIR}/${LATEX_target}.ps
> >     COMMAND TEXINPUTS="${TEXINPUTS}"
> >                        ${DVIPS_CONVERTER}
> >                        ${DVI_FILE_WE}.dvi   -o${PS_FILE_WE}.ps
> >    DEPENDS    ${DVI_FILE_WE}.dvi
> >    COMMENT  "dvi -> ps for PDF_${LATEX_target}" )
> >
> > The problem is that the semicolons are replaced by space " ".
> >
> > How can I achieve what I want?
>
> I have got a similar problem.
>
> But I solved it by escaping the semicolon with a backslash, e.g ; -> \;
>
> Hope it will work for you.
>
> Greetings
>
> Alexander
>
>

Hello Alexander,

See the minimal example
<CMakeLists.txt>
#set(myvar $ENV{MYENVAR};${PROJECT_SOURCE_DIR})
set(myvar $ENV{MYENVAR}\;${PROJECT_SOURCE_DIR})

message("myvar==${myvar}")

add_custom_target(bla ALL 
    COMMAND MYNEWENVAR="${myvar}" echo ping )
</CMakeLists.txt>
 which is also attached to this mail. To run it just enter make. 

You'll see that 
    message("myvar==${myvar}") 
results in something like
    myvar==:;/entry/one/;entry/two/;/home/maik/workspace/tester/1
but when
    add_custom_target(bla ALL  COMMAND MYNEWENVAR="${myvar}" echo ping )
gets executed they are gone
    MYNEWENVAR=": /entry/one/ entry/two/ /home/maik/workspace/tester/1" echo 
ping


Regards, Maik

Attachment: semicolons.tar.gz
Description: application/tgz

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to