[CMake] ctest script and setting my own envvars
David Cole
david.cole at kitware.com
Mon Oct 29 13:25:52 EDT 2007
It's a substitution thing....
This:
SET (CTEST_ENVIRONMENT
"RR_WARNINGS_COMMON=-Wall -Wextra"
"RR_WARNINGS_C=${RR_WARNINGS_COMMON} -Wno-deprecated-declarations"
)
doesn't work because RR_WARNINGS_COMMON is not defined as a CMake variable
prior to the SET statement.
This should work, though. Maybe just change your script style a little
bit...?
SET(RR_WARNINGS_COMMON "-Wall -Wextra")
SET(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations")
# etc. more cmake variables...
SET(ENV{RR_WARNINGS_COMMON} "${RR_WARNINGS_COMMON}")
SET(ENV{RR_WARNINGS_C} "${RR_WARNINGS_C}")
# etc. more env variables...
HTH,
David
On 10/29/07, Sean McBride <sean at rogue-research.com> wrote:
>
> Hi all,
>
> If I create a ctest script (.cmake), can I set my own environment
> variables? I have the following:
>
> # set any extra envionment varibles here
> SET (CTEST_ENVIRONMENT
> "RR_WARNINGS_COMMON=-Wall -Wextra"
> "RR_WARNINGS_C=${RR_WARNINGS_COMMON} -Wno-deprecated-declarations"
> "RR_WARNINGS_CXX=${RR_WARNINGS_COMMON} -Woverloaded-virtual"
> "RR_DEBUG_C=-gdwarf-2"
> "RR_DEBUG_CXX=-gdwarf-2 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC"
> "CFLAGS=${RR_WARNINGS_C} ${RR_DEBUG_C}"
> "CXXFLAGS=${RR_WARNINGS_CXX} ${RR_DEBUG_CXX}"
> )
>
> What I'm trying to do is separate Debug-only, Release-only, C-only, and C
> ++-only settings into separate env vars. This would allow me to keep my
> temp env vars the same in all my scripts, and I would only need to
> change CFLAGS and CXXFLAGS like above.
>
> But it doesn't seem to work. :( There is no error, but the flags are
> not being applied.
>
> Thanks for any help!
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng sean at rogue-research.com
> Rogue Research www.rogue-research.com
> Mac Software Developer Montréal, Québec, Canada
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071029/721ee285/attachment.html
More information about the CMake
mailing list