make install doesn't respect --prefix: Closes #6001

Also fixed was code to detect location of installed .desktop file.
This commit is contained in:
Jens Georg 2013-05-08 11:00:58 -07:00 committed by Jim Nelson
parent 0d9869f844
commit 01f8831f3b
3 changed files with 5 additions and 5 deletions

1
THANKS
View file

@ -11,6 +11,7 @@ Jon Dowland <jmtd@debian.org>
Christian Dywan <christian@twotoasts.de> Christian Dywan <christian@twotoasts.de>
Victor Eduardo <victor@elementaryos.org> Victor Eduardo <victor@elementaryos.org>
Daniel Foré <daniel@elementaryos.org> Daniel Foré <daniel@elementaryos.org>
Jens Georg <mail@jensge.org>
Michael George <mdgeorge@cs.cornell.edu> Michael George <mdgeorge@cs.cornell.edu>
Sven Hagemann <sven@rednose.nl> Sven Hagemann <sven@rednose.nl>
Mathias Hasselmann <mathias@openismus.com> Mathias Hasselmann <mathias@openismus.com>

View file

@ -17,7 +17,7 @@ if (INTLTOOL_MERGE_FOUND)
${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir} ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
) )
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION /usr/share/applications) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir) endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
endif (INTLTOOL_MERGE_FOUND) endif (INTLTOOL_MERGE_FOUND)

View file

@ -76,8 +76,6 @@ along with Geary; if not, write to the Free Software Foundation, Inc.,
} }
public Configuration config { get; private set; } public Configuration config { get; private set; }
public File system_desktop_file_directory { get; private set;
default = File.new_for_path("/usr/share/applications/"); }
private static GearyApplication _instance = null; private static GearyApplication _instance = null;
@ -383,8 +381,9 @@ along with Geary; if not, write to the Free Software Foundation, Inc.,
} }
public File? get_desktop_file() { public File? get_desktop_file() {
File desktop_file = is_installed() File? install_dir = get_install_dir();
? system_desktop_file_directory.get_child("geary.desktop") File desktop_file = (install_dir != null)
? install_dir.get_child("geary.desktop")
: File.new_for_path(SOURCE_ROOT_DIR).get_child("build").get_child("desktop").get_child("geary.desktop"); : File.new_for_path(SOURCE_ROOT_DIR).get_child("build").get_child("desktop").get_child("geary.desktop");
return desktop_file.query_exists() ? desktop_file : null; return desktop_file.query_exists() ? desktop_file : null;