~vanvugt/compiz/fix-751605

« back to all changes in this revision

Viewing changes to cmake/copy_file_install_user_env.cmake

  • Committer: Sam Spilsbury
  • Date: 2012-07-12 07:13:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3285.
  • Revision ID: sam.spilsbury@canonical.com-20120712071307-jcxdezgmoqf1nq0e
Fix CMake error when USER environment variable isn't set

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
set (INSTALLDIR_USER "" CACHE FORCE "Installation dir if user")
3
3
set (INSTALLDIR_ROOT "" CACHE FORCE "Installation dir if root")
4
4
 
5
 
set (USERNAME $ENV{USER})
 
5
if (ENV{USER})
 
6
    set (USERNAME $ENV{USER})
 
7
else (ENV${USER})
 
8
    set (USERNAME "user")
 
9
endif (ENV{USER})
6
10
 
7
11
if (${USERNAME} STREQUAL "root")
8
12
    set (INSTALLDIR ${INSTALLDIR_ROOT})