2025-08-04 01:33 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001342Spring engineLinuxpublic2009-03-31 15:21
Reporterspliff 
Assigned ToAuswaschbar 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001342: CMakeLists.txt overriding user settings
DescriptionSpring's CMakeLists.txt appears to be overriding the user's CMAKE_INSTALL_PREFIX. Regardless of the underlying reason this is very naughty!

I would patch this but I don't understand Spring enough yet to know why it's there in the first place or what the side-effects will be.
Additional InformationCMakeLists.txt ----------
### Install path (relative to CMAKE_INSTALL_PREFIX)
if (UNIX AND NOT MINGW)
  set (BINDIR "bin" CACHE STRING "Where to install binaries")
  set (LIBDIR "lib" CACHE STRING "Where to install libraries")
  set (DATADIR "share/games/spring" CACHE STRING "Where to install game content")
  set (AIDIR "${LIBDIR}/spring" CACHE STRING "Where AIs are installed")
 
  set (APPLICATIONS_DIR "share/applications" CACHE STRING "Where to install desktop files")
  set (PIXMAPS_DIR "share/pixmaps" CACHE STRING "Where to install icons")
  set (MIME_DIR "share/mime"CACHE STRING "Where MIME definitions are located")
else (UNIX AND NOT MINGW)
  set (BINDIR "." CACHE STRING "Where to install binaries")
  set (LIBDIR "." CACHE STRING "Where to install libraries")
  set (DATADIR "." CACHE STRING "Where to install game content")
  set (AIDIR "." CACHE STRING "Where AIs are installed")
  set (CMAKE_INSTALL_PREFIX "/")
endif (UNIX AND NOT MINGW)
--------------------

The second-last line is the problem. It should not be set here. It should be using CMakes default (/usr/local) or the CMAKE_INSTALL_PREFIX set by the user in a toolchain file or commandline option. :

I understand this may be done to ensure pixmaps or whatever so to the correct place, however the result of this choice is that spring must be installed as root. The 'make install' output is:
------
Install the project...
-- Install configuration: "DEBUG3"
-- Installing: /.
CMake Error at cmake_install.cmake:31 (FILE):
  file Problem setting permissions on directory "/."


make: *** [install] Error 1
-------

Related discussion on CMake mailing list (follow the whole thread):
http://www.mail-archive.com/cmake@cmake.org/msg11584.html
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0003283

Auswaschbar (reporter)

Last edited: 2009-02-14 13:18

So, why exactly do you want your windows instalation be in /usr/local?

edit:
please read CMakeDocumentation. "make install DESTDIR=/somewhere/on/your/comp" does not need to happen as root if you have write access there

~0003284

spliff (reporter)

Last edited: 2009-02-15 15:26

I didn't want '/usr/local'. I specifically asked cmake to use '/home/spliff/spring-patch-git/win32/final'. The CMakeLists.txt seems to override this.

It's true that setting DESTDIR on 'make install' will overide this but the cmake manual and mailing list seem to imply that CMakeLists.txt should not enforce a CMAKE_INSTALL_PREFIX without a "very good reason".

The point of this bug report is that CMAKE_INSTALL_PREFIX is a *user* setting, not something that applications should set.

Spring changes the default behaviour of cmake which it should not do. If something really needs to be installed relative to the / directory then you prefix its path with a / and it will be treated as an absolute path.

While there is a workaround for this (DESTDIR) it doesn't excuse the fact that Spring uses an unsupported behaviour that confuses the end user.

EDIT: Of course I may just be confused between CMAKE_INSTALL_PREFIX and DESTDIR. I assumed they were the same thing but after testing this more they seem to have different behaviour.

~0003353

Auswaschbar (reporter)

fixed
+Notes

-Issue History
Date Modified Username Field Change
2009-02-14 05:28 spliff New Issue
2009-02-14 13:15 Auswaschbar Note Added: 0003283
2009-02-14 13:18 Auswaschbar Note Edited: 0003283
2009-02-14 14:00 Auswaschbar Status new => feedback
2009-02-15 06:58 spliff Note Added: 0003284
2009-02-15 15:26 spliff Note Edited: 0003284
2009-03-31 15:21 Auswaschbar Note Added: 0003353
2009-03-31 15:21 Auswaschbar Status feedback => resolved
2009-03-31 15:21 Auswaschbar Resolution open => fixed
2009-03-31 15:21 Auswaschbar Assigned To => Auswaschbar
+Issue History