[CMake] set CMAKE_INSTALL_PREFIX in CMakeLists

Marcel Loose loose at astron.nl
Thu Nov 25 08:01:31 EST 2010


>>> On 24-11-2010 at 17:45, in message
<20101124164507.GG23449 at cryptio.net>, Tyler
Roscoe <tyler at cryptio.net> wrote: 
> On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote:
>> 
>> >   SET(CMAKE_INSTALL_PREFIX "/foo/bar" CACHE PATH "Foo install
prefix")
>> > 
>> > So, without the test to
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT,
>> > and without the FORCE option.
>>
>> No, as I mentioned, there was an article of one the
CMake-maintainers
>> who recommended this.
> 
> Micha is correct. CMAKE_INSTALL_PREFIX is set before your
CMakeLists.txt
> is processed, so the above will never do anything.
> 
> tyler

Well, I tested this before I posted my reply. It does work the way I
describe it. Try it yourself.

Marcel.



More information about the CMake mailing list