[CMake] Installing Find*.cmake to the correct folder using NSIS configured by cmake on windows platform

Eric Noulard eric.noulard at gmail.com
Tue Jan 26 03:24:12 EST 2010


2010/1/26  <Mika.Rajala at patria.fi>:
>
> Hi
>
> How can i tell the NSIS installer, using cmake, to install my Find*.cmake
> script to the ${CMAKE_ROOT}/Modules directory?
>
> Writing that to the "install" command doesn't work.

You do not give us enough information about WHAT exactly did not work,
example of CMakeLists.tx ...

May be it does not work because you want to get the "CMAKE_ROOT"
of the host were you install your package and not the one on which you
are building
the two may be different (location and/or cmake version).

I think that you should:

1) Install you  Find*.cmake as other files in your project using for example
    INSTALL(FILES FindMe.cmake DESTINATION share/module)

2) Execute install time scripts in order to:
         2.a) discover the CMAKE_ROOT of the install host
         2.b) copy the share/module/Find*.cmake files to
                ${CMAKE_ROOT}/Modules

    You can do that by either embedding an
    install([[SCRIPT <file>] [CODE <code>]] [...]) rules (see cmake
doc for that)
    or
    change/modify the  Modules/NSIS.template.in shipped wiith CMake in order to
    add you own "NSIS" code to do whatever you want using the NSIS
install langage.

> I did try googling for anwsers for the better part of yesterday so if it
> can be found on the internet, please provide some assistance.

Hopefully internet cannot always be as useful as human being :-)

More seriously, either method should work.
As a last hint discovering the value of CMAKE_ROOT at install time may be done
using CMake itself (provided cmake is installed on the install host).

for example:
cmake -P showcmroot.cmake

will show you the value (cmake script attached to this mail)/

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: showcmroot.cmake
Type: application/octet-stream
Size: 43 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100126/bf94c805/attachment.obj>


More information about the CMake mailing list