[CMake] target path, or post build event?

Mark Wyszomierski markww at gmail.com
Fri Oct 26 13:33:31 EDT 2007


Ok this is what I ended up doing and it seems to work well:

SET(CMAKE_INSTALL_PREFIX "" CACHE STRING "Install Prefix" FORCE)

IF (WIN32)
    INSTALL(FILES your_project/debug/something.exe DESTINATION
${YOUR_PROJECT_SOURCE_DIR}/debug/)
ENDIF (WIN32)

I have all the built exes etc moved into one folder after building the
INSTALL project now, thanks for your help,

Mark

On 10/25/07, Mark Wyszomierski <markww at gmail.com> wrote:
> Hi guys,
>
> First off, thanks for helping me with this.
>
> All the exes/libs I want to move will be built by CMake, in a post
> build event situation (ie. I generate the solution files/make file via
> CMake, open them in vc++, build the exes/libs, then want to move them
> to C:\test for example after done building).
>
> If I use the:
>
>    INSTALL(TARGETS ${cmaketestTarget} DESTINATION ${dest})
>
> that means the built exes/libs will only go to that 1 folder, right?
> They will no longer appear in their default build location - I'd like
> to have them appear in both.
>
> So I think I have to use the INSTALL (FILE) method as you guys
> suggested before, it looks like I just have to do something like:
>
>    SET(CMAKE_INSTALL_PREFIX,  "C:\test");
>
> then build the INSTALL project everytime to make sure it copies the
> files there for me. Is that about right?
>
> Thanks,
> Mark
>
>
>
> On 10/25/07, KSpam <keesling_spam at cox.net> wrote:
> > Mark,
> >
> > What do you have CMAKE_INSTALL_PREFIX set to?  My guess is that it defaults
> > to "C:\Program Files\${PROJECT_NAME}".  I do not develop on Windows, so I
> > cannot say for sure.  CMAKE_INSTALL_PREFIX is used to prefix the DESTINATION
> > unless DESTINATION is specified as a full path.  Alternately, you can set
> > DESTINATION to a full path.
> >
> > Also, if cmaketest.exe is a target built by CMake, you might prefer to use:
> >
> > INSTALL(TARGETS ${cmaketestTarget} DESTINATION ${dest})
> >
> > Justin
> >
> > On Thursday 25 October 2007 07:56:38 Mark Wyszomierski wrote:
> > > It seems to work, though is moving the file I want to copy into an
> > > unexpected location. Using the following:
> > >
> > > INSTALL(FILES debug/cmaketest.exe DESTINATION copy_file_test)
> > >
> > > I'm trying to move the file 'cmaketest.exe' located in a subdirectory
> > > called 'debug' into another subdirectory called 'copy_file_test'.
> > >
> > > The file actually gets copied to:
> > >
> > >     C:\Program Files\CMAKETEST\copy_file_test
> > >
> > > though. The name of my project is CMakeTest. Any idea?
> > >
> > > Thanks,
> > > Mark
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>


More information about the CMake mailing list