[CMake] Help with non-standard use of CMake

frodak17 frodak17 at gmail.com
Tue Jan 1 16:48:56 EST 2019


On Mon, Dec 31, 2018 at 9:47 PM Donald MacQueen [|] via CMake <
cmake at cmake.org> wrote:

> On 12/31/2018 4:38 PM, Kyle Edwards wrote:
> > On Mon, 2018-12-31 at 16:16 -0500, Donald MacQueen [|] via CMake wrote:
> >> First, CMake is quite impressive. Nice job.
> >>
> >> I am using it in a non-standard way where I set a bunch of variables
> >> and
> >> then go straight to CTest thatI installs our software and then runs
> >> several hundred tests on it. The batch file looks like this:
> >>
> >> rmdir /s/q build
> >> mkdir build
> >> cd build
> >> cmake -Dx64=%x64% -Doption:STRING="%opt%" ..
> >> ctest -D Experimental -S
> >>
> >> I do not make or build or compile.
> >>
> >> I recently hooked this up to a CDash server which is very handy. I
> >> want
> >> to get the results that are sent to CDash, currently from Windows
> >> only,
> >> to be all green.
> >>
> >> However, I am a little curious about what you're doing in your use
> >> case. You say you're not building anything. Does your sofware exist in
> >> the form of scripts (Python, Perl, etc.), or are you downloading pre-
> >> built binaries from somewhere?
>
> The purpose here is to 1) test that the installation of our product is
> successful (all the files are there with the correct permissions, etc.)
> and 2) that the 13k+ tests we have run correctly after installation.
> The installer is created using Install Shield.
>
> My CMakelists.txt looks something like this:
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>
> cmake_minimum_required(VERSION 2.8.8)
> if(CMAKE_VERSION VERSION_GREATER "3.1")
>    cmake_policy(SET CMP0054 NEW)
> endif()
>
>
> if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "64")
>      set (vasttst_isX86_OS FALSE)
>      set (vasttst_OsBitness 64)
> endif()
>      set (vasttst_isX86_OS TRUE)
>      set (vasttst_OsBitness 86)
> endif ()
>
> 200 more lines..
>
> ENABLE_TESTING()
>
> include(CTest)
>
> add_subdirectory(test)
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>
> rmdir /s/q build
> mkdir build
> cd build
> ctest -D Experimental -S cdash.txt
>
> That way I avoid make/build/compile and go straight to CTest.
>
> Right?
>
> --
> Donald [|]
> A bad day in [] is better than a good day in {}.
>
>
>
I'm trying to follow along but you are calling cmake to do the install and
set everything up before you run ctest.
And that the software was already built and packaged separately.

> cmake -Dx64=%x64% -Doption:STRING="%opt%" ..

If the CMakeLists.txt file has the project() command in it that is enough
to kick of an implicit build and look for a working compiler using the
default generator.
I think you can work around this by using LANGUAGES NONE in the project()
command.

Alternatively if CMakeLists.txt can be converted into a pure script without
targets then you could run it as cmake -D... -P script_file.cmake
But I'm not sure if that is possible because at some point something makes
the test configuration file and the tests need to be found somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190101/8ad09d9a/attachment.html>


More information about the CMake mailing list