[CMake] CTest: Toggling BUILD_TESTING triggers a project recompile

Adolfo Rodríguez dofo79 at gmail.com
Mon Mar 23 12:25:05 EDT 2009


I'm not setting any -D flags that depend on BUILD_TESTING. I only use the
variable to guard entering the subdirectories where tests are generated:

if(BUILD_TESTING)
  add_subdirectory(test)
endif(BUILD_TESTING)

I am working in a project that adds a test subfolder to each folder where a
target is generated. Could this be it? However, no source files (or its
associated flags) are being changed. I'm just preventing CMake from entering
the test dirs.



2009/3/23 Bill Hoffman <bill.hoffman at kitware.com>

> Adolfo Rodríguez wrote:
>
>> Hi,
>>
>> I have a project that uses CTest. I'm using the auto-generated
>> BUILD_TESTING variable to enable/disable the test-related parts of my build
>> tree. What strikes me as unusual is that when I build my project with
>>  BUILD_TESTING set to ON (hence all test executables are built), and then
>> toggle BUILD_TESTING to OFF, the subsequent call to make rebuilds all my
>> project from scratch. I would expecting the build to do nothing, since all
>> other targets have suffered no changes. Is this behavior intentional?
>>
>>
> Does it change a -D flags that gest sent to all of your files?
>
> -Bill
>



-- 
Adolfo Rodríguez Tsouroukdissian

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090323/9b048ce6/attachment.htm>


More information about the CMake mailing list