[CMake] Get all required shared libs from a target

2009-08-28 Thread Müller Michael
Hi guys, is it possible to investigate a target for all required shared libs (transitively). That means i dont which libraries where set with TARGET_LINK_LIBRARIES and somewhere in my CMakeLists.txt i want to find it out again. Thank you Michael

Re: [CMake] Compiled file cannot be executed

2009-08-28 Thread Michael Wild
You must be doing something wrong. Have a look at this example: generate.cpp: --8-- #include iostream #include fstream int main(int argc, char* argv[]) { if( argc 2 ) { std::cerr Usage: argv[0] outputFile\n; } std::ofstream str(argv[1]); str #include iostream\nint

Re: [CMake] Get all required shared libs from a target

2009-08-28 Thread Michael Wild
On 28. Aug, 2009, at 8:29, Müller Michael wrote: Hi guys, is it possible to investigate a target for all required shared libs (transitively). That means i dont which libraries where set with TARGET_LINK_LIBRARIES and somewhere in my CMakeLists.txt i want to find it out again. Thank

Re: [CMake] Get all required shared libs from a target

2009-08-28 Thread Müller Michael
Hi Michael, Thanks for your repsonse but I need the required DLLs to copy them in a post-build step. So I need the information which libaries are required for executing something. E.g., in your example add_library(a ${A_SRCS}) add_library(b ${B_SRCS}) target_link_libraries(b a)

[CMake] FindThreads: the odd one out?

2009-08-28 Thread Marcel Loose
Hi all, Up till now I've been using the not officially supported and released FindPthreads.cmake macro to check for the presence of pthreads. However, the maintainer of that macro wrote (a comment in Mantis) that he would drop support for FindPthreads in favor of the more general and officially

Re: [CMake] Get all required shared libs from a target

2009-08-28 Thread Michael Wild
You could use CMAKE_RUNTIME_OUTPUT_DIRECTORY or the RUNTIME_OUTPUT_DIRECTORY target property to specify where CMake should put all the produced runtime stuff (on Windows, AFAIK this is *.exe and *.dll), so you don't have to copy them around manually. If the dll's are not built by you, you

Re: [CMake] installing a module

2009-08-28 Thread David Ojeda
On Tue, Aug 25, 2009 at 3:35 PM, Michael Wild them...@gmail.com wrote: On 25. Aug, 2009, at 15:23, David Ojeda wrote: On Tue, Aug 25, 2009 at 12:47 PM, Andreas Pakulat ap...@gmx.de wrote: On 25.08.09 12:37:46, David Ojeda wrote: I have a shared library that I managed to compile and

Re: [CMake] Compiled file cannot be executed

2009-08-28 Thread David Cole
The extra thing that Michael put at the end is probably the key to everything here. He did an add_executable with the output of the custom command. You either need to have a library or executable or custom target use the output of your custom command so that it is properly chained with dependency

Re: [CMake] Get all required shared libs from a target

2009-08-28 Thread David Cole
See also the BundleUtilities module. Work in CVS CMake recently has extended the fixup_bundle function so that it works on Windows/Linux as well as on a Mac. And what you are looking for is exactly what it does. If executed in an install script, fixup_bundle will analyze a given executable and

Re: [CMake] Get all required shared libs from a target

2009-08-28 Thread Michael Jackson
If you pull the boost 1.39.0 sources there is an experimental CMake based build system. In those cmake files the developers have somehow figured out how to do what you want. For a given library, you can get all the dependencies. So in your case you would say that lib B depends on Lib A.

Re: [CMake] [New Module] FindHDF5.cmake

2009-08-28 Thread James C. Sutherland
On Aug 24, 2009, at 10:20 AM, Will Dicharry wrote: All, I've committed the FindHDF5 and SelectLibraryConfigurations modules to the CMake CVS repository. Thanks for your input and feel free to contact me with questions regarding the modules. --Will Will, Thank you for your

Re: [CMake] [New Module] FindHDF5.cmake

2009-08-28 Thread James C. Sutherland
On Aug 28, 2009, at 9:14 AM, James C. Sutherland wrote: On Aug 24, 2009, at 10:20 AM, Will Dicharry wrote: All, I've committed the FindHDF5 and SelectLibraryConfigurations modules to the CMake CVS repository. Thanks for your input and feel free to contact me with questions regarding

Re: [CMake] [New Module] FindHDF5.cmake

2009-08-28 Thread James C. Sutherland
I have a question about the static library option. I did: set( HDF5_USE_STATIC_LIBRARIES 1 ) which should trigger linkage with static libraries, right? But what I see in the link line is: /usr/lib/libz.dylib /usr/lib/libm.dylib /jcs/apps/hdf5_serial/lib/ libhdf5_cpp.dylib

[CMake] generating CTest tests

2009-08-28 Thread Aditya Herlambang
Hello, I am really a total noob in this CTest stuffs, I read the documentation and it says that I need to use the ADD_TEST method to test an executable right?the format is the following: ADD_TEST(test1 ../build/executable 1) where test1 is the name of the test and 1 is the argument passed to

Re: [CMake] generating CTest tests

2009-08-28 Thread John Drescher
On Fri, Aug 28, 2009 at 12:57 PM, Aditya Herlambangaditya15...@hotmail.com wrote: Hello, I am really a total noob in this CTest stuffs, I read the documentation and it says that I need to use the ADD_TEST method to test an executable right? the format is the following: ADD_TEST(test1

Re: [CMake] generating CTest tests

2009-08-28 Thread Alex H
Hello, In the ADD_TEST command in the example below I mentioned the test name is test1, is this only a naming thing or does it meanthat I have to have an actual file called test1 in the system to be run by the executable? Sorry, I read the documentation several times and still don't understand

[CMake] Fwd: generating CTest tests

2009-08-28 Thread John Drescher
-- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Fri, Aug 28, 2009 at 1:53 PM Subject: Re: [CMake] generating CTest tests To: Alex H aditya15...@hotmail.com On Fri, Aug 28, 2009 at 1:38 PM, Alex Haditya15...@hotmail.com wrote: Hello, In the ADD_TEST

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread Alex H
Hello, My problem is actually really simple I have a .cpp file and the program just basically take an int as an argument, if the argument is from certain numbers it returns a 1 otherwise 0.Now I need to create a unit test that would allow me to do this... how can I check the return value of

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread John Drescher
On Fri, Aug 28, 2009 at 2:07 PM, Alex Haditya15...@hotmail.com wrote: Hello, My problem is actually really simple I have a .cpp file and the program just basically take an int as an argument, if the argument is from certain numbers it returns a 1 otherwise 0. Now I need to create a unit test

[CMake] dependency in custom command?

2009-08-28 Thread King, Steven R
Hello List, I'm new to cmake and liking it a lot. I'm using cmake 2.6.3 on Linux. I'm building a dynamically loadable module and an executable to test it. Each lives in a different directory. My test program needs to know the location of the dll when calling dlopen(). To solve this, I

Re: [CMake] dependency in custom command?

2009-08-28 Thread Tyler Roscoe
On Fri, Aug 28, 2009 at 11:28:53AM -0700, King, Steven R wrote: I'm building a dynamically loadable module and an executable to test it. Each lives in a different directory. My test program needs to know the location of the dll when calling dlopen(). To solve this, I created a custom

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread Alex H
Hello, So where do we specify/put in the CMakeLists.txt where test1 is expected to fail or pass? How does CTest knows this... Just to clarify the add_test command should be put inside a CMakeLists.txt? What if I want to invokectest using the following command: ctest -R testpage What should

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread David Cole
On Fri, Aug 28, 2009 at 3:11 PM, Alex H aditya15...@hotmail.com wrote: Hello, So where do we specify/put in the CMakeLists.txt where test1 is expected to fail or pass? How does CTest knows this... If your program returns a 0, it passes. If it does not, it fails. If you want to invert this

Re: [CMake] dependency in custom command?

2009-08-28 Thread Michael Wild
You don't have to do the copying yourself. Just tell CMake in which directory it should create the module by either setting the LIBRARY_OUTPUT_DIRECTORY target property or the CMAKE_LIBRARY_OUTPUT_DIRECTORY variable. AFAIK the LOCATION property is only present for compatibility with

Re: [CMake] dependency in custom command?

2009-08-28 Thread King, Steven R
You don't need to do this. Since my_module is a CMake target, you can just use my_module instead of ${SO_LOCATION} in the custom_command below and CMake will figure out where the .so is on the disk Hi Tyler -- Substituting my_module did not work. The copy fails. Is this a cmake bug?

Re: [CMake] dependency in custom command?

2009-08-28 Thread King, Steven R
You don't have to do the copying yourself. Just tell CMake in which directory it should create the module by either setting the LIBRARY_OUTPUT_DIRECTORY target property or the CMAKE_LIBRARY_OUTPUT_DIRECTORY variable. AFAIK the LOCATION property is only present for compatibility with CMake

[CMake] CMake bundle app for OSX

2009-08-28 Thread as
Hello: I've been using CMake and CPack a bit on Linux. Now I have an application that uses Qt and needs to be used on Linux and Mac OSX. I want to create an installer using CMake / CPack for the application. The application is called following The following is from my CMakeLists.txt file

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread Alex H
I am going to take an example from your a snippet test in your previous example: ADD_TEST(XMLExport0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 0) ADD_TEST(XMLExport1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 1) ADD_TEST(XMLExport2

[CMake] exit_failure

2009-08-28 Thread Alex H
My problem is that in my executable test cpp code, the code may return a cpp EXIT_FAILURE macro. Problem is how can I use the cpp macro inside the set_tests_properties regex arguments? _ Share your memories online with anyone you

Re: [CMake] dependency in custom command?

2009-08-28 Thread King, Steven R
Wrap your custom_command with a custom_target. See the CMake FAQ for some recipes. OK, my CMakeLists.txt is growing rapidly. :^( All I've managed to do is cause the module to be copied every time. Again, my goal is to copy the dll to the directory of the corresponding test program if the dll

Re: [CMake] dependency in custom command?

2009-08-28 Thread clinton
You don't have to do the copying yourself. Just tell CMake in which directory it should create the module by either setting the LIBRARY_OUTPUT_DIRECTORY target property or the CMAKE_LIBRARY_OUTPUT_DIRECTORY variable. AFAIK the LOCATION property is only present for compatibility with CMake