[pcre-dev] Testing CMake

Góra strony
Delete this message
Autor: Philip Hazel
Data:  
Dla: Daniel Richard G., pcre-dev
Temat: [pcre-dev] Testing CMake
I installed CMake on my box to try out your CMakeLists.txt file, Daniel,
to see if I could easily incorporate a test into my standard tests.
There is good news and bad news. :-)

1. It complained that I had installed CMake 2.4.3 but it wanted 2.4.6.
What I had installed was Gentoo's current release of CMake. I ignored
that warning.

2. However, it didn't like ELSEIF in the CMakeLists.txt file. As there
were only a very few of these, I edited the file to use nested IFs
instead, and it was happy with that. If ELSEIF is a relatively new
thing, it might be best to avoid it for a while.

3. After that, running "cmake ." went fine, and quickly. As did a
subsequent "make". I have to confess to being impressed by the speed.

4. "make test", however, failed, though running ./RunTest and
./RunGrepTest manually was OK. I traced this to the fact that it was
trying to run the command

/source/pcre/RunTest srcdir=/source/pcre/RunTest

which of course is wrong. What it should be running is

srcdir=/source/pcre/RunTest /source/pcre/RunTest

After some faffing, I managed to edit CMakeLists.txt so that it would
run, and I added the pcregrep test too. I ended up with:

ADD_TEST(test1 sh -c "srcdir=${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/RunTest")
ADD_TEST(test2 sh -c "srcdir=${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/RunGrepTest")

5. With those two fixes, "make test" worked.

6. I noticed, however, that though it built the C++ wrapper, it didn't
build the C++ unittest files. I could probably figure out how to do
that, but I decided to wait till you have commented.

7. I have not tried "make install".

I have committed my version of CMakeLists.txt to the svn repository. I
won't add anything to the documentation just yet.

Philip

--
Philip Hazel, University of Cambridge Computing Service.