[CMake] copy generated dll in executable directory

2009-02-09 Thread Benoit
Hy!

I'm doing a project where I'm generating 2 libraries for differents
application. The problem is that the dll and the executable are not in the
same directory. Therefore if i need to copy the dll each time i want to
recompile them.


The tree of my project is the following.

./CMakeList.txt (A)
./my/
./my/lib1/CmakeList.txt (B)
./my/lib2/
./test1
./test2


And in the file CMakeList.txt (A), I have:

set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/bin )


I've found some help on the web and now i I use the install target in the
Makefile to copy the .dll in the binary directory.

And in CmakeList.txt (B)

INSTALL( TARGETS ${LIBNAME} DESTINATION . PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE )


However, i would like to have them directly in the executable output path.
Using the target all should be sufficient to generate the executable and the
new dll in the same directory.


Thanks,

--
Benoit RAT
www.neub.co.nr
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] copy generated dll in executable directory

2009-02-09 Thread Michael Jackson

You probably want something like the following in your CMake file



# -- Setup output Directories -
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
  ${PROJECT_BINARY_DIR}/Bin
  CACHE PATH
  Single Directory for all Libraries
  )

# - Setup the Executable output Directory -
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
  ${PROJECT_BINARY_DIR}/Bin
  CACHE PATH
  Single Directory for all Executables.
  )

# - Setup the Executable output Directory -
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
  ${PROJECT_BINARY_DIR}/Bin
  CACHE PATH
  Single Directory for all static libraries.
  )


_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio



On Feb 9, 2009, at 11:31 AM, Benoit wrote:


Hy!

I'm doing a project where I'm generating 2 libraries for differents  
application. The problem is that the dll and the executable are not  
in the same directory. Therefore if i need to copy the dll each time  
i want to recompile them.



The tree of my project is the following.

./CMakeList.txt (A)
./my/
./my/lib1/CmakeList.txt (B)
./my/lib2/
./test1
./test2


And in the file CMakeList.txt (A), I have:

set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/bin )


I've found some help on the web and now i I use the install target  
in the Makefile to copy the .dll in the binary directory.


And in CmakeList.txt (B)

INSTALL( TARGETS ${LIBNAME} DESTINATION . PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE )


However, i would like to have them directly in the executable output  
path. Using the target all should be sufficient to generate the  
executable and the new dll in the same directory.



Thanks,

--
Benoit RAT
www.neub.co.nr
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake