#360 CMake and ENABLE_TESTS

Feature_Request
pending
nobody
5
2012-09-23
2010-06-15
Toralf Niebuhr
No

I am compiling Poco with CMake.
My Problem is that even tough ENABLE_TESTS is turned off, all Tests are build anyways.
There is a similar problem with the samples; for them there is no switch at all.

I am willing to patch this but before I do it, I want to know if the proposed patch is OK or if you want this to be addressed differently.

For the tests:
Basically just ifdefing out all "add_subdirectory( testsuite )"

meaning

IF(ENABLE_TESTS)
add_subdirectory( testsuite )
endif(ENABLE_TESTS)

For the samples, there are two possible ways.
First is to use ENABLE_TESTS and do the same with the samples

IF(ENABLE_TESTS)
add_subdirectory( samples )
endif(ENABLE_TESTS)

or defining another build variable ENABLE_SAMPLES (default off, like the tests) and then

IF(ENABLE_SAMPLES)
add_subdirectory( samples )
endif(ENABLE_SAMPLES)

What do you think?
I filed this as bug since you have the variable ENABLE_TESTS set but it has no effect.

Discussion

  • Alex Fabijanic
    Alex Fabijanic
    2012-09-23

    • status: open --> pending
    • milestone: --> Feature_Request
     
  • Alex Fabijanic
    Alex Fabijanic
    2012-09-23

    cmake is not officially supported, classifying this as a feature request and changing status to pending. submit a working patch or let's close it