MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0012359 | CMake | CMake | public | 2011-07-25 10:58 | 2012-01-02 15:56 |
Reporter | Russ Tayor | ||||
Assigned To | David Cole | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Intel | OS | Windows | OS Version | 7 |
Product Version | CMake 2.8.5 | ||||
Target Version | Fixed in Version | ||||
Summary | 0012359: Windows 7 CMAKE_INSTALL_PREFIX does not work within Visual Studio due to permission problems | ||||
Description | Windows 7 requires programs that copy files into Program Files to not only be run by users with permission to write there, but also to be "Run as administrator." This breaks the INSTALL build when it is set to there. I attach a workaround under Additional Information that changes the install dir on all WIN32 platforms; if we could find just Windows 7, that could be better. Basically, the default needs to be set to somewhere the user can write. /usr/local seems as good a place as any to me. | ||||
Steps To Reproduce | Build INSTALL project on Windows 7. | ||||
Additional Information | ### # On Windows 7, it does not work to install in the default location, # which is the Program Files directory, because you have to not only have # file permission to write there but also "run as administrator." This # means that "make install" from a Visual Studio project fails. To get # around that, we need to set CMAKE_INSTALL_PREFIX to something other # than the default. However, it is a cache variable that has already been # set. If we make a local variable, it uses this rather than the cache # variable and never tells the poor user what happened (the GUI location # looks standard but the files end up somewhere else). If we make it a # non-forced cache variable, it already has a value so does not change. # If we make it a forced cache variable, it gets overwritten everytime # and the user cannot change it on the GUI. So we have a workaround here. # We make a cache variable that records whether we have ever forced the # install prefix. If not, we force it. If so, we don't force it again. # This has the effect of setting it the first time cmake is run, showing # the change in the GUI, and also letting the user change the value in # the GUI if they don't like what we did. If I knew how to do this only # happen on Windows 7, I'd make the if(WIN32) more specific. if (WIN32) if (NOT ONCE_SET_CMAKE_INSTALL_PREFIX) set(ONCE_SET_CMAKE_INSTALL_PREFIX true CACHE BOOL "Have we set the install prefix yet?" FORCE) set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Install path prefix, prepended onto install directories" FORCE) endif (NOT ONCE_SET_CMAKE_INSTALL_PREFIX) endif (WIN32) | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-07-25 10:58 | Russ Tayor | New Issue | |||
2011-07-25 14:50 | David Cole | Assigned To | => David Cole | ||
2011-07-25 14:50 | David Cole | Status | new => assigned | ||
2011-07-25 14:56 | David Cole | Note Added: 0027067 | |||
2011-07-25 14:56 | David Cole | Status | assigned => resolved | ||
2011-07-25 14:56 | David Cole | Resolution | open => no change required | ||
2011-07-25 15:48 | Russ Tayor | Note Added: 0027068 | |||
2011-07-25 15:48 | Russ Tayor | Status | resolved => feedback | ||
2011-07-25 15:48 | Russ Tayor | Resolution | no change required => reopened | ||
2011-07-25 15:48 | Russ Tayor | Note Edited: 0027068 | bug_revision_view_page.php?bugnote_id=27068#r382 | ||
2011-07-25 16:06 | David Cole | Note Added: 0027069 | |||
2011-07-26 13:29 | David Cole | Note Added: 0027071 | |||
2011-07-26 13:29 | David Cole | Status | feedback => resolved | ||
2011-07-26 13:29 | David Cole | Resolution | reopened => no change required | ||
2012-01-02 15:56 | David Cole | Note Added: 0028106 | |||
2012-01-02 15:56 | David Cole | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|