Re: [CMake] dependency in custom command?

2009-09-05 Thread Alexander Neundorf
On Friday 28 August 2009, King, Steven R wrote: > 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 o

Re: [CMake] dependency in custom command?

2009-09-05 Thread Alexander Neundorf
On Friday 28 August 2009, King, Steven R wrote: > > 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_mod

Re: [CMake] dependency in custom command?

2009-09-01 Thread Michael Wild
On 1. Sep, 2009, at 6:47, King, Steven R wrote: In case it's useful, here's a macro to copy an arbitrary file form the source directory to the binary directory. The dependencies work such that the file is not copied if the destination is up-to-date. This is working fine for me, but sugges

Re: [CMake] dependency in custom command?

2009-08-31 Thread King, Steven R
In case it's useful, here's a macro to copy an arbitrary file form the source directory to the binary directory. The dependencies work such that the file is not copied if the destination is up-to-date. This is working fine for me, but suggested improvements are very welcome. Thanks, -steve #-

Re: [CMake] dependency in custom command?

2009-08-31 Thread King, Steven R
> > add_test( > >test_my_module > >${CMAKE_BINARY_DIR}/bin/test_my_module > >) > > This will only work on Unix like systems. Doesn't CTest figure out > that the program name is a target? I.e. doesn't this work (provided > you did add_executable(test_my_modul

Re: [CMake] dependency in custom command?

2009-08-31 Thread Clinton Stimpson
On 08/30/2009 11:08 PM, King, Steven R wrote: Can't you put all executables and shared libraries in one directory, so they are all local to each other? In the top level CMakeLists.txt file just add SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CM

Re: [CMake] dependency in custom command?

2009-08-31 Thread Philip Lowman
On Mon, Aug 31, 2009 at 8:20 AM, Philip Lowman wrote: > On Mon, Aug 31, 2009 at 1:08 AM, King, Steven R > wrote: > >> I now put all my binaries and libraries in ${CMAKE_BINARY_DIR}/bin as >> Clint suggested. This caused ctest to fail for lack of knowing where the >> test binary went. I made th

Re: [CMake] dependency in custom command?

2009-08-31 Thread Philip Lowman
On Mon, Aug 31, 2009 at 1:08 AM, King, Steven R wrote: > I now put all my binaries and libraries in ${CMAKE_BINARY_DIR}/bin as Clint > suggested. This caused ctest to fail for lack of knowing where the test > binary went. I made this adjustment: > > add_test( >test_my_module >

Re: [CMake] dependency in custom command?

2009-08-30 Thread Michael Wild
On 31. Aug, 2009, at 7:08, King, Steven R wrote: Can't you put all executables and shared libraries in one directory, so they are all local to each other? In the top level CMakeLists.txt file just add SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) SET(CMAKE_LIBRARY_OUTPUT_DIRECTO

Re: [CMake] dependency in custom command?

2009-08-30 Thread King, Steven R
> Can't you put all executables and shared libraries in one directory, so they > are all local to each other? > In the top level CMakeLists.txt file just add > SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) > SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) > > The executab

Re: [CMake] dependency in custom command?

2009-08-29 Thread Tyler Roscoe
On Fri, Aug 28, 2009 at 05:19:19PM -0700, King, Steven R wrote: > OK, my CMakeLists.txt is growing rapidly. :^( Welcome to the clube :). > All I've managed to do is cause the module to be copied every time. Use -E copy_if_different. Also, give some serious thought to the other replies in this

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 w

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 dl

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 >

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 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 CMake

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 co

[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 creat