CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

John Drescher-2
Under cmake-2.8.0 I have the following section in my CMakeLists.txt

IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
string (REPLACE "\\" "/" PGM_FILES $ENV{PROGRAMFILES})
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 4)
# On WIN64 use the 64 bit program files..
string (REPLACE "\\" "/" PGM_FILES $ENV{ProgramW6432})
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)

SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
CACHE STRING "Default Install Path")

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
"Install path" FORCE)
   message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
${DEFAULT_INSTALL_PATH})
else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
${CMAKE_INSTALL_PREFIX})
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

ENDIF(WIN32)

The expected value for the QtBasicUtils project is if the user did not
change CMAKE_INSTALL_PREFIX the path should be
C:/Program Files (x86)/UPMC/QtBasicUtils

on 64 bit systems or

C:/Program Files/UPMC/QtBasicUtils

on 32 bit systems

However this is not getting set and I get the following message in my log:
CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
Files (x86)/QtBasicUtils

--
John M. Drescher
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

Tyler Roscoe
On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:

> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
> CACHE STRING "Default Install Path")
>
> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
> "Install path" FORCE)
>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
> ${DEFAULT_INSTALL_PATH})
> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
> ${CMAKE_INSTALL_PREFIX})
> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>
> ENDIF(WIN32)
>
> The expected value for the QtBasicUtils project is if the user did not
> change CMAKE_INSTALL_PREFIX the path should be
> C:/Program Files (x86)/UPMC/QtBasicUtils
>
> on 64 bit systems or
>
> C:/Program Files/UPMC/QtBasicUtils
>
> on 32 bit systems
>
> However this is not getting set and I get the following message in my log:
> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
> Files (x86)/QtBasicUtils

Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
your script is behaving as it should and not clobbering the value.

tyler
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

John Drescher-2
On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe <[hidden email]> wrote:

> On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:
>> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
>> CACHE STRING "Default Install Path")
>>
>> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
>> "Install path" FORCE)
>>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
>> ${DEFAULT_INSTALL_PATH})
>> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
>> ${CMAKE_INSTALL_PREFIX})
>> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>
>> ENDIF(WIN32)
>>
>> The expected value for the QtBasicUtils project is if the user did not
>> change CMAKE_INSTALL_PREFIX the path should be
>> C:/Program Files (x86)/UPMC/QtBasicUtils
>>
>> on 64 bit systems or
>>
>> C:/Program Files/UPMC/QtBasicUtils
>>
>> on 32 bit systems
>>
>> However this is not getting set and I get the following message in my log:
>> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
>> Files (x86)/QtBasicUtils
>
> Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
> to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
> your script is behaving as it should and not clobbering the value.
>

CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default
on 64 bit windows.

John
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

John Drescher-2
On Mon, Dec 14, 2009 at 12:21 PM, John Drescher <[hidden email]> wrote:

> On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe <[hidden email]> wrote:
>> On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:
>>> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
>>> CACHE STRING "Default Install Path")
>>>
>>> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
>>> "Install path" FORCE)
>>>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
>>> ${DEFAULT_INSTALL_PATH})
>>> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
>>> ${CMAKE_INSTALL_PREFIX})
>>> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>
>>> ENDIF(WIN32)
>>>
>>> The expected value for the QtBasicUtils project is if the user did not
>>> change CMAKE_INSTALL_PREFIX the path should be
>>> C:/Program Files (x86)/UPMC/QtBasicUtils
>>>
>>> on 64 bit systems or
>>>
>>> C:/Program Files/UPMC/QtBasicUtils
>>>
>>> on 32 bit systems
>>>
>>> However this is not getting set and I get the following message in my log:
>>> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
>>> Files (x86)/QtBasicUtils
>>
>> Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
>> to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
>> your script is behaving as it should and not clobbering the value.
>>
>
> CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default
> on 64 bit windows.
>

Correction. 64 bit windows compiling a 32 bit application using visual studio.

John
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

Tyler Roscoe
In reply to this post by John Drescher-2
On Mon, Dec 14, 2009 at 12:21:13PM -0500, John Drescher wrote:

> On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe <[hidden email]> wrote:
> > On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:
> >> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
> >> CACHE STRING "Default Install Path")
> >>
> >> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
> >>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
> >> "Install path" FORCE)
> >>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
> >> ${DEFAULT_INSTALL_PATH})
> >> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
> >>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
> >> ${CMAKE_INSTALL_PREFIX})
> >> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
> >>
> >> ENDIF(WIN32)
> >>
> >> The expected value for the QtBasicUtils project is if the user did not
> >> change CMAKE_INSTALL_PREFIX the path should be
> >> C:/Program Files (x86)/UPMC/QtBasicUtils
> >>
> >> on 64 bit systems or
> >>
> >> C:/Program Files/UPMC/QtBasicUtils
> >>
> >> on 32 bit systems
> >>
> >> However this is not getting set and I get the following message in my log:
> >> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
> >> Files (x86)/QtBasicUtils
> >
> > Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
> > to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
> > your script is behaving as it should and not clobbering the value.
> >
>
> CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default
> on 64 bit windows.

Not sure why you think this but that variable always appears in my
cache. I just tested it with a dummy CMakeLists and a clean build dir.

And if that var is not in the cache, then where is the value 'C:/Program
Files (x86)/QtBasicUtils' coming from?

tyler
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

John Drescher-2
On Mon, Dec 14, 2009 at 12:26 PM, Tyler Roscoe <[hidden email]> wrote:

> On Mon, Dec 14, 2009 at 12:21:13PM -0500, John Drescher wrote:
>> On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe <[hidden email]> wrote:
>> > On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:
>> >> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
>> >> CACHE STRING "Default Install Path")
>> >>
>> >> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>> >>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
>> >> "Install path" FORCE)
>> >>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
>> >> ${DEFAULT_INSTALL_PATH})
>> >> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>> >>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
>> >> ${CMAKE_INSTALL_PREFIX})
>> >> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>> >>
>> >> ENDIF(WIN32)
>> >>
>> >> The expected value for the QtBasicUtils project is if the user did not
>> >> change CMAKE_INSTALL_PREFIX the path should be
>> >> C:/Program Files (x86)/UPMC/QtBasicUtils
>> >>
>> >> on 64 bit systems or
>> >>
>> >> C:/Program Files/UPMC/QtBasicUtils
>> >>
>> >> on 32 bit systems
>> >>
>> >> However this is not getting set and I get the following message in my log:
>> >> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
>> >> Files (x86)/QtBasicUtils
>> >
>> > Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
>> > to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
>> > your script is behaving as it should and not clobbering the value.
>> >
>>
>> CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default
>> on 64 bit windows.
>
> Not sure why you think this but that variable always appears in my
> cache. I just tested it with a dummy CMakeLists and a clean build dir.
>
> And if that var is not in the cache, then where is the value 'C:/Program
> Files (x86)/QtBasicUtils' coming from?
>

In this case I just created a new build tree because I am moving the
project to vs2008 instead of vs2005.

Okay this is really weird. I just deleted the cache and started again.

Check for working C compiler: cl
Check for working C compiler: cl -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: cl
Check for working CXX compiler: cl -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
CMAKE_INSTALL_PREFIX Initialized to default setting to C:/Program
Files (x86)/UPMC/QtBasicUtils
Looking for Q_WS_X11
Looking for Q_WS_X11 - not found.
Looking for Q_WS_WIN
Looking for Q_WS_WIN - found
Looking for Q_WS_QWS
Looking for Q_WS_QWS - not found.
Looking for Q_WS_MAC
Looking for Q_WS_MAC - not found.
Found Qt-Version 4.4.3 (using
X:/32Bit/VC.80/Libraries/qt-win-opensource-src-4.4.3/bin/qmake.exe)
Configuring done

John
_______________________________________________
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