RE: [CMake] Test sources

2007-02-19 Thread Ken Martin
We have a test for CREATE_TEST_SOURCELIST in CMake/Tests/TestDriver and it
does not use a full path to the tests and it is passing on the dashboard.
Perhaps you specified the path to the test source files as a full absolute
path?

Ken Martin PhD 
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Pascal
Fleury
Sent: Sunday, February 18, 2007 6:18 PM
To: cmake@cmake.org
Subject: [CMake] Test sources

Hi CMakers,

I am trying to use the CREATE_TEST_SOURCELIST approach to test some existing

CppUnit tests. My plan was to have the functions that CTest expects ( the 
foo(int,char**) for test in file 'foo.cpp' ) be generated, each of them 
calling the suite from the CppUnit (basically testing a complete class).

I have noticed that, contrary to the documentation (online, man page and the

book) the function that needs to be present is not 'foo()' for file foo.cpp,

but something like '_full_absolute_path_to_my_project_test_foo(int,
char**)'.
Does CREATE_TEST_SOURCELIST rewrite all test source and replace the expected

function with a unique one ?

Has anybody any experience in using CppUnit with CMake ? 

--paf
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cpack output path question

2007-02-19 Thread Eric Noulard

2007/2/19, Duncan Mac-Vicar Prett [EMAIL PROTECTED]:


Hi guys,

We are trying to switch libzypp (solver) to cmake.
Everything has been straighforward, except for one thing I can't find in the
docs or the cmake book.

In the CMAKE_SOURCE_DIR, I have a spec.in file I configure without problems to
the CMAKE_BINARY_DIR/package directory

But, I haven't found the way to generate the tarball via cpack into this
CMAKE_BINARY_DIR/package directory instead of CMAKE_BINARY_DIR


I don't know how you would do that but you may move the file
after you invoke cpack by doing:

ADD_CUSTOM_TARGET(my_package_source
COMMAND ${CMAKE_MAKE_PROGRAM} package_source
COMMAND ${CMAKE_COMMAND} -E copy
${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ${CMAKE_BINARY_DIR}/package
COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
)

this is not nice but it should work.



Also I would need to copy a file from  CMAKE_SOURCE_DIR/package to
CMAKE_BINARY_DIR/package


CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/thefile
${CMAKE_BINARY_DIR}/package/thefile
COPYONLY)


should work


is there a way to do all this from a single make something target? How can I
modify the package_source target to do this?


I don't know if you can MODIFY the target.

--
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] how work dependencies

2007-02-19 Thread klaas.holwerda

Hi Bill,

Working on the test case you asked for, i discovered the problem.
Using SET_TARGET_PROPERTIES() i changed the name of the libraries.
But also is use TARGET_LINK_LIBRARIES using that real name.
I should have used the original target name it seems.

Using the real name, dependencies are not discovered, but using the 
original target used in ADD_LIBRARY() all is fine.

You might say of course.
But what i did, was put all libraries in a variable, to be used in a 
template for external user programs to use my libraries in an easy manner.
So there one needs the real names of the libraries. While in the samples 
coming with the libraries one prefers the target names itself, since 
only then Cmake finds the dependencies.


Still it is a bit strange, because using real names, Cmake did not 
understand to relink a sample, when a library was rebuild.

So it knows:
- that it links to a library since the real name is in the links list in 
the VC IDE.
- but when that library is out of date, it does not see that, and does 
not relink.


Anyway, i now use target names internal for the samples, and create a 
variable using real names for external programs.


Thanks!

Klaas

Bill Hoffman wrote:

klaas.holwerda wrote:

Hi,

I always thought that Cmake did automatically rebuild libraries, 
within the same Cmake build, linked to my application.
Like if i have several libraries created with ADD_LIBRARY() and 
linked to my end executable with TARGET_LINK_LIBARIES or just 
LINK_LIBRARIES.
But it seems i am missing something, since it stopped working for me, 
and i don't know which change did that.
Maybe it is SET_TARGET_PROPERTIES() which i use to set output names 
for libraries, different from the ones in ADD_LIBRARY its target.
So the end executable target, is linked with the endname from the 
properties, not with the original target name of ADD_LIBRARY.


SO the question is, do i need to use:

ADD_DEPENDCIES explicit, to make target like the above depend on the 
other lower targets?


Or should this be automatic ( which it was for me before ), and is 
something else wrong?
It should be working.   The best thing to try is make VERBOSE=1 and 
look at the output.

Can you create a small test case?

-Bill




___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] how work dependencies

2007-02-19 Thread Bill Hoffman

klaas.holwerda wrote:

Hi Bill,

Working on the test case you asked for, i discovered the problem.
Using SET_TARGET_PROPERTIES() i changed the name of the libraries.
But also is use TARGET_LINK_LIBRARIES using that real name.
I should have used the original target name it seems.
Sure, cmake does not add depend information unless it has a full path to 
a library. 
In your case, you basically had something like this:

target_link_libraries(foo bar)
So, cmake added a -lbar as requested, but had no idea where bar was coming
from.   If you had had a full path to bar, cmake would have put that 
depend in.
However, if bar is a cmake target, you should link to bar by specifying 
the name

of the CMake target that makes bar.

-Bill


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] IF how?

2007-02-19 Thread Brandon J. Van Every

klaas.holwerda wrote:

Hi,

Cmake 2.4 patch 5

I am getting different behaviour on Linux compared to windows. From 
the docs i understand that the next should end up with the message 
fine.

Is that true? I get the else answer??

SET( myvar 0 )
IF( myvar EQUAL 0 )
MESSAGE( fine )
ELSE( myvar EQUAL 0 )
MESSAGE( fine )
ENDIF( myvar EQUAL 0 )

For me only works:
IF( ${myvar} STREQUAL 0 )
etc.


Try

IF(myvar)
  // blah != 0
ELSE(myvar)
 // blah == 0
ENDIF(myvar)


Cheers,
Brandon Van Every

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake