Feature request: option to omit tests

Post here if you have problem using the CMAKE build process

Feature request: option to omit tests

Postby benmedina » Mon Mar 28, 2011 4:33 pm

I'm incorporating clapack into my CMake-based project. This is easy to do with a simple add_subdirectory CMake command. However, it would be nice to have an option of skipping the tests; I only want to test my code, not yours. If you added a cache variable, I could set the variable before adding the clapack subdirectory. Something like this:
Code: Select all
option(clapack_build_tests "Build the tests for LAPACK and BLAS." OFF)

Then later on:
Code: Select all
if (clapack_build_tests)
    add_subdirectory (TESTING)
endif ()

As it is, I have to edit your CMake scripts to omit the tests.
benmedina
 
Posts: 2
Joined: Mon Mar 28, 2011 4:25 pm

Re: Feature request: option to omit tests

Postby chuckatkins » Sat Apr 02, 2011 8:23 pm

benmedina,

I have been maintaining the CMake build for LAPACK lately. There's actually no need to create a new variable since when using CTest (include(CTest) in the CMakeLists.txt) there is a BUILD_TESTING variable created automatically. LAPACK uses this and testing can be disabled by setting it to off:
Code: Select all
cmake -DBUILD_TESTING=OFF /path/to/lapacl/source

Unfortunately it seems that the CLapack build does not check for this variable. We'll try to get it in the next release.
chuckatkins
 
Posts: 3
Joined: Sat Apr 02, 2011 8:10 pm

Re: Feature request: option to omit tests

Postby benmedina » Mon Apr 04, 2011 11:39 am

The problem with that is I want BUILD_TESTING=ON for the rest of my project. I just want to exclude your tests.

Google Mock and Google Test are examples of projects that integrate well.

I think I'll go with an approach that uses CMake's external project features to build clapack, as I also ran into problems with you changing some CPack variables that conflict with my project.

Thanks for following up!
benmedina
 
Posts: 2
Joined: Mon Mar 28, 2011 4:25 pm


Return to CMAKE

Who is online

Users browsing this forum: No registered users and 1 guest