<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3462" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I have a project,
that actually consists of several modules that have dependencies between
them.</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I want to add CTC
(code coverage analysis) support, and in order to do this I would need, similar
than</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>with purify, to
change compiler binary, but I need this to be done just for directly dependant
directories.</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I link the modules
by add_subdirectory and target_link_libraries.</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I tried to do this
in following way:</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>OPTION(USE_CTC
"enable CTC for project (set also CTC_PROJECTS in CMakeLists.txt)"
NO)<BR>...</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>
IF(USE_CTC AND NOT CTC_PROJECTS)<BR>
message("WARNING: CTC_PROJECTS not set, will default to
'${SUBDIRS}'")<BR> SET(CTC_PROJECTS
${SUBDIRS})<BR> ENDIF(USE_CTC AND NOT
CTC_PROJECTS)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2>...</DIV></FONT></SPAN>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2> </DIV></FONT></SPAN>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2> IF(USE_CTC AND
CTC_PROJECTS)</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2> LIST(FIND CTC_PROJECTS
${PROJECT_NAME} DO_CTC)<BR> IF(DO_CTC
EQUAL -1)<BR> SET(DO_CTC
"FALSE")<BR> ELSE(DO_CTC EQUAL
-1)<BR> SET(DO_CTC
"TRUE")<BR> ENDIF(DO_CTC EQUAL
-1)</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2>
IF(DO_CTC)<BR>
message("activate
CTC")<BR>
SET(CMAKE_CXX_COMPILER
"/opt/ctc++/linux/ix86/ctc++_6.3/bin/ctc")<BR>
SET(CMAKE_CXX_COMPILER_ARG1 "-v -V -i fd -c /etc/ctc.ini
/some_path/i586-linux-gnu-i686-glibc_std-g++")<BR>
ENDIF(DO_CTC)</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2> ENDIF(USE_CTC AND
CTC_PROJECTS)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I could not do this
via changing only CMAKE_CXX_COMPILER (can not find compiler) but had to do this
via ARG1 variable. Anyway, for some projects it works as
expected,</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>but for some others
I get folowing error:</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2>ERROR:</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>You have changed
variables that require your cache to be deleted.<BR>Configure will be re-run and
you may have to reset some variables.<BR>The following variables have
changed:<BR>CMAKE_CXX_COMPILER=
/some_path/i586-linux-gnu-i686-glibc_std-g++<BR></FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>The bigger problem
is, that it calls cmake again, but without any commandline parameters, thus
cannot find the toolchain, and fails at the end.</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>So far I could not
find why it works for some projects, and for some others
don't.</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>I hope you can help
me on this one. I'm using cmake v2.6.2</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial size=2>Best
Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=840303813-15122008><FONT face=Arial
size=2>Bartek</DIV></FONT></SPAN></BODY></HTML>