From e4f253e1d1e1851bce3ea4a5511622696daf6d06 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 1 Feb 2019 13:24:20 +0100 Subject: [PATCH] Use standard install dir variable names This makes our builds directly compatible with most distributions without packagers/users having to specify extra flags. --- CMakeLists.txt | 22 ++++++++----------- cmake/BuildPackages.cmake | 4 ++-- config.h.in | 6 ++--- .../packages/deb/ubuntu-bionic/debian/rules | 14 +++++------- .../packages/deb/ubuntu-xenial/debian/rules | 15 +++++-------- contrib/packages/rpm/el7/SPECS/tigervnc.spec | 11 +++++----- java/CMakeLists.txt | 2 -- media/CMakeLists.txt | 4 ++-- po/CMakeLists.txt | 2 +- unix/vncconfig/CMakeLists.txt | 4 ++-- unix/vncpasswd/CMakeLists.txt | 4 ++-- unix/vncserver/CMakeLists.txt | 18 +++++++-------- unix/vncserver/vncserver.in | 2 +- unix/vncserver/vncserver@.service.in | 2 +- unix/vncserver/vncsession-start.in | 4 ++-- unix/vncserver/vncsession.c | 2 +- unix/x0vncserver/CMakeLists.txt | 4 ++-- vncviewer/CMakeLists.txt | 10 ++++----- vncviewer/vncviewer.cxx | 4 ++-- vncviewer/vncviewer.desktop.in.in | 2 +- win/vncconfig/CMakeLists.txt | 2 +- win/winvnc/CMakeLists.txt | 2 +- win/wm_hooks/CMakeLists.txt | 2 +- 23 files changed, 66 insertions(+), 76 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 540ef944..72672cd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,9 @@ cmake_minimum_required(VERSION 2.8.11) if(POLICY CMP0022) cmake_policy(SET CMP0022 OLD) endif() +if(${CMAKE_VERSION} VERSION_LESS "3.4.0") + message(WARNING "CMake 3.4.0 or newer is required to get correct default installation paths") +endif() # Internal cmake modules set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -27,19 +30,12 @@ set(VERSION 1.10.80) set(RCVERSION 1,10,80,0) # Installation paths -set(SYSCONF_DIR "${CMAKE_INSTALL_PREFIX}/etc") -set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin") -set(SBIN_DIR "${CMAKE_INSTALL_PREFIX}/sbin") -set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share") -set(LIBEXEC_DIR "${CMAKE_INSTALL_PREFIX}/libexec") -set(MAN_DIR "${DATA_DIR}/man") -set(LOCALE_DIR "${DATA_DIR}/locale") -set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${VERSION}") -set(UNIT_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system") - -if(WIN32) -set(BIN_DIR "${CMAKE_INSTALL_PREFIX}") -set(DOC_DIR "${CMAKE_INSTALL_PREFIX}") +include(GNUInstallDirs) +set(CMAKE_INSTALL_UNITDIR "lib/systemd/system" CACHE PATH "systemd unit files (lib/systemd/system)") +if(IS_ABSOLUTE "${CMAKE_INSTALL_UNITDIR}") + set(CMAKE_INSTALL_FULL_UNITDIR "${CMAKE_INSTALL_UNITDIR}") +else() + set(CMAKE_INSTALL_FULL_UNITDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_UNITDIR}") endif() option(INSTALL_SYSTEMD_UNITS "Install TigerVNC systemd units" ON) diff --git a/cmake/BuildPackages.cmake b/cmake/BuildPackages.cmake index ec96318d..1f251929 100644 --- a/cmake/BuildPackages.cmake +++ b/cmake/BuildPackages.cmake @@ -86,5 +86,5 @@ endif() #UNIX # Common # -install(FILES ${CMAKE_SOURCE_DIR}/LICENCE.TXT DESTINATION ${DOC_DIR}) -install(FILES ${CMAKE_SOURCE_DIR}/README.rst DESTINATION ${DOC_DIR}) +install(FILES ${CMAKE_SOURCE_DIR}/LICENCE.TXT DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR}) +install(FILES ${CMAKE_SOURCE_DIR}/README.rst DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR}) diff --git a/config.h.in b/config.h.in index ce594829..2d7a741a 100644 --- a/config.h.in +++ b/config.h.in @@ -5,9 +5,9 @@ #cmakedefine HAVE_ACTIVE_DESKTOP_L #cmakedefine ENABLE_NLS 1 -#cmakedefine LIBEXEC_DIR "@LIBEXEC_DIR@" -#cmakedefine DATA_DIR "@DATA_DIR@" -#cmakedefine LOCALE_DIR "@LOCALE_DIR@" +#cmakedefine CMAKE_INSTALL_FULL_LIBEXECDIR "@CMAKE_INSTALL_FULL_LIBEXECDIR@" +#cmakedefine CMAKE_INSTALL_FULL_DATADIR "@CMAKE_INSTALL_FULL_DATADIR@" +#cmakedefine CMAKE_INSTALL_FULL_LOCALEDIR "@CMAKE_INSTALL_FULL_LOCALEDIR@" /* MS Visual Studio 2008 and newer doesn't know ssize_t */ #if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__) diff --git a/contrib/packages/deb/ubuntu-bionic/debian/rules b/contrib/packages/deb/ubuntu-bionic/debian/rules index 57e8e0ae..e9bb8e87 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/rules +++ b/contrib/packages/deb/ubuntu-bionic/debian/rules @@ -57,9 +57,8 @@ config-stamp: xorg-source-stamp cmake -G"Unix Makefiles" \ -DBUILD_STATIC=off \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DSYSCONF_DIR:PATH=/etc \ - -DLIBEXEC_DIR:PATH=/usr/lib/$(DEB_HOST_MULTIARCH) \ - -DUNIT_DIR:PATH=/lib/systemd/system + -DCMAKE_INSTALL_LIBEXECDIR:PATH=lib/$(DEB_HOST_MULTIARCH) \ + -DCMAKE_INSTALL_UNITDIR:PATH=/lib/systemd/system (cd unix/xserver; \ export PIXMANINCDIR=/usr/include/pixman-1; \ autoreconf -fiv; \ @@ -211,15 +210,14 @@ install: build #(cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share) # install additional license files mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer - cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ + cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc/* \ $(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer/ #mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java - #cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ + #cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc/* \ #$(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java/ mkdir -p $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver - mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ - $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver/ - rm -rf $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/ + mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc \ + $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver # dh_movefiles sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \ debian/tigervncserver.postinst.in > debian/tigervncserver.postinst diff --git a/contrib/packages/deb/ubuntu-xenial/debian/rules b/contrib/packages/deb/ubuntu-xenial/debian/rules index 28af8d1e..f61099c0 100644 --- a/contrib/packages/deb/ubuntu-xenial/debian/rules +++ b/contrib/packages/deb/ubuntu-xenial/debian/rules @@ -58,9 +58,8 @@ config-stamp: xorg-source-stamp cmake -G"Unix Makefiles" \ -DBUILD_STATIC=off \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DSYSCONF_DIR:PATH=/etc \ - -DLIBEXEC_DIR:PATH=/usr/lib/$(DEB_HOST_MULTIARCH) \ - -DUNIT_DIR:PATH=/lib/systemd/system + -DCMAKE_INSTALL_LIBEXECDIR:PATH=lib/$(DEB_HOST_MULTIARCH) \ + -DCMAKE_INSTALL_UNITDIR:PATH=/lib/systemd/system (cd unix/xserver; \ export PIXMANINCDIR=/usr/include/pixman-1; \ autoreconf -fiv; \ @@ -212,15 +211,13 @@ install: build #(cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share) # install additional license files mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer - cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ + cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc/* \ $(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer/ #mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java - #cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ + #cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc/* \ #$(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java/ - mkdir -p $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver - mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \ - $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver/ - rm -rf $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/ + mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc \ + $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver # dh_movefiles sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \ debian/tigervncserver.postinst.in > debian/tigervncserver.postinst diff --git a/contrib/packages/rpm/el7/SPECS/tigervnc.spec b/contrib/packages/rpm/el7/SPECS/tigervnc.spec index c6c34d49..46081ce0 100644 --- a/contrib/packages/rpm/el7/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el7/SPECS/tigervnc.spec @@ -151,10 +151,11 @@ export CPPFLAGS="$CXXFLAGS" export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS +# The cmake in RHEL is too old and doesn't set up +# CMAKE_INSTALL_SYSCONFDIR properly %{cmake} -G"Unix Makefiles" \ - -DBUILD_STATIC=off \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DSYSCONF_DIR=%{_sysconfdir} + -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ + -DBUILD_STATIC=off make %{?_smp_mflags} pushd unix/xserver @@ -248,7 +249,7 @@ fi %files -f %{name}.lang %defattr(-,root,root,-) -%doc %{_docdir}/%{name}-%{version}/README.rst +%doc %{_docdir}/%{name}/README.rst %{_bindir}/vncviewer %{_datadir}/applications/* %{_mandir}/man1/vncviewer.1* @@ -285,7 +286,7 @@ fi %endif %files license -%doc %{_docdir}/%{name}-%{version}/LICENCE.TXT +%doc %{_docdir}/%{name}/LICENCE.TXT %files icons %defattr(-,root,root,-) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 00213d5e..b124fc5d 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -7,8 +7,6 @@ endif() find_package(Java) -set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share") - set(DEFAULT_JAVACFLAGS "-source 8 -target 8 -encoding UTF-8 -Xlint:all,-serial,-cast,-unchecked,-fallthrough,-dep-ann,-deprecation,-rawtypes") set(JAVACFLAGS ${DEFAULT_JAVACFLAGS} CACHE STRING "Java compiler flags (Default: ${DEFAULT_JAVACFLAGS})") diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt index 256d4357..088c72f5 100644 --- a/media/CMakeLists.txt +++ b/media/CMakeLists.txt @@ -13,11 +13,11 @@ if(CONVERT_EXECUTABLE) if(UNIX AND NOT APPLE) foreach(SIZE 16 22 24 32 48) install(FILES icons/tigervnc_${SIZE}.png - DESTINATION ${DATA_DIR}/icons/hicolor/${SIZE}x${SIZE}/apps + DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME tigervnc.png) endforeach() install(FILES icons/tigervnc.svg - DESTINATION ${DATA_DIR}/icons/hicolor/scalable/apps) + DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps) endif() endif() diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 9c8ddef3..2eb10e7b 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -46,7 +46,7 @@ foreach(lang ${po_FILES}) ) install(FILES ${mo} - DESTINATION "${LOCALE_DIR}/${lang}/LC_MESSAGES" + DESTINATION "${CMAKE_INSTALL_FULL_LOCALEDIR}/${lang}/LC_MESSAGES" RENAME tigervnc.mo ) diff --git a/unix/vncconfig/CMakeLists.txt b/unix/vncconfig/CMakeLists.txt index 959681f6..c3823ab0 100644 --- a/unix/vncconfig/CMakeLists.txt +++ b/unix/vncconfig/CMakeLists.txt @@ -11,5 +11,5 @@ add_executable(vncconfig target_link_libraries(vncconfig tx rfb network rdr ${X11_LIBRARIES}) -install(TARGETS vncconfig DESTINATION ${BIN_DIR}) -install(FILES vncconfig.man DESTINATION ${MAN_DIR}/man1 RENAME vncconfig.1) +install(TARGETS vncconfig DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) +install(FILES vncconfig.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME vncconfig.1) diff --git a/unix/vncpasswd/CMakeLists.txt b/unix/vncpasswd/CMakeLists.txt index a04ed0b9..9f716fac 100644 --- a/unix/vncpasswd/CMakeLists.txt +++ b/unix/vncpasswd/CMakeLists.txt @@ -5,5 +5,5 @@ add_executable(vncpasswd target_link_libraries(vncpasswd tx rfb os) -install(TARGETS vncpasswd DESTINATION ${BIN_DIR}) -install(FILES vncpasswd.man DESTINATION ${MAN_DIR}/man1 RENAME vncpasswd.1) +install(TARGETS vncpasswd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) +install(FILES vncpasswd.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME vncpasswd.1) diff --git a/unix/vncserver/CMakeLists.txt b/unix/vncserver/CMakeLists.txt index 127c7a3e..eeb4b7b0 100644 --- a/unix/vncserver/CMakeLists.txt +++ b/unix/vncserver/CMakeLists.txt @@ -5,16 +5,16 @@ configure_file(vncserver@.service.in vncserver@.service @ONLY) configure_file(vncsession-start.in vncsession-start @ONLY) configure_file(vncserver.in vncserver @ONLY) -install(TARGETS vncsession DESTINATION ${SBIN_DIR}) -install(FILES tigervnc.pam DESTINATION ${SYSCONF_DIR}/pam.d RENAME tigervnc) -install(FILES vncsession.man DESTINATION ${MAN_DIR}/man8 RENAME vncsession.8) -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vncserver DESTINATION ${LIBEXEC_DIR}) -install(FILES vncserver.man DESTINATION ${MAN_DIR}/man8 RENAME vncserver.8) -install(FILES vncserver-config-defaults vncserver-config-mandatory DESTINATION ${SYSCONF_DIR}/tigervnc) +install(TARGETS vncsession DESTINATION ${CMAKE_INSTALL_FULL_SBINDIR}) +install(FILES tigervnc.pam DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d RENAME tigervnc) +install(FILES vncsession.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man8 RENAME vncsession.8) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vncserver DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR}) +install(FILES vncserver.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man8 RENAME vncserver.8) +install(FILES vncserver-config-defaults vncserver-config-mandatory DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/tigervnc) -install(FILES vncserver.users DESTINATION ${SYSCONF_DIR}/tigervnc) +install(FILES vncserver.users DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/tigervnc) if(INSTALL_SYSTEMD_UNITS) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncserver@.service DESTINATION ${UNIT_DIR}) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vncsession-start DESTINATION ${LIBEXEC_DIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncserver@.service DESTINATION ${CMAKE_INSTALL_FULL_UNITDIR}) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vncsession-start DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR}) endif() diff --git a/unix/vncserver/vncserver.in b/unix/vncserver/vncserver.in index 68a39af0..9f3a4750 100755 --- a/unix/vncserver/vncserver.in +++ b/unix/vncserver/vncserver.in @@ -238,7 +238,7 @@ push(@cmd, $Xsession, $session{'Exec'}); push(@cmd, '--'); # We build up our Xvnc command with options -push(@cmd, "@BIN_DIR@/Xvnc", ":$displayNumber"); +push(@cmd, "@CMAKE_INSTALL_FULL_BINDIR@/Xvnc", ":$displayNumber"); foreach my $k (sort keys %config) { push(@cmd, "-$k"); diff --git a/unix/vncserver/vncserver@.service.in b/unix/vncserver/vncserver@.service.in index 51c9a2c9..584ecf4b 100644 --- a/unix/vncserver/vncserver@.service.in +++ b/unix/vncserver/vncserver@.service.in @@ -35,7 +35,7 @@ After=syslog.target network.target [Service] Type=forking -ExecStart=/usr/libexec/vncsession-start %i +ExecStart=@CMAKE_INSTALL_FULL_LIBEXECDIR@/vncsession-start %i PIDFile=/var/run/vncsession-%i.pid SELinuxContext=system_u:system_r:vnc_session_t:s0 diff --git a/unix/vncserver/vncsession-start.in b/unix/vncserver/vncsession-start.in index b4a6e007..b20fcdd9 100644 --- a/unix/vncserver/vncsession-start.in +++ b/unix/vncserver/vncsession-start.in @@ -18,7 +18,7 @@ # USA. # -USERSFILE="@SYSCONF_DIR@/tigervnc/vncserver.users" +USERSFILE="@CMAKE_INSTALL_FULL_SYSCONFDIR@/tigervnc/vncserver.users" if [ $# -ne 1 ]; then echo "Syntax:" >&2 @@ -40,4 +40,4 @@ if [ -z "${USER}" ]; then exit 1 fi -exec "@SBIN_DIR@/vncsession" "${USER}" "${DISPLAY}" +exec "@CMAKE_INSTALL_FULL_SBINDIR@/vncsession" "${USER}" "${DISPLAY}" diff --git a/unix/vncserver/vncsession.c b/unix/vncserver/vncsession.c index d2d328e8..06c07d48 100644 --- a/unix/vncserver/vncsession.c +++ b/unix/vncserver/vncsession.c @@ -461,7 +461,7 @@ run_script(const char *username, const char *display, char **envp) setenv("USER", pwent->pw_name, 1); setenv("USERNAME", pwent->pw_name, 1); - child_argv[0] = LIBEXEC_DIR "/vncserver"; + child_argv[0] = CMAKE_INSTALL_FULL_LIBEXECDIR "/vncserver"; child_argv[1] = display; child_argv[2] = NULL; diff --git a/unix/x0vncserver/CMakeLists.txt b/unix/x0vncserver/CMakeLists.txt index 8beade7e..af824150 100644 --- a/unix/x0vncserver/CMakeLists.txt +++ b/unix/x0vncserver/CMakeLists.txt @@ -52,5 +52,5 @@ endif() target_link_libraries(x0vncserver ${X11_LIBRARIES}) -install(TARGETS x0vncserver DESTINATION ${BIN_DIR}) -install(FILES x0vncserver.man DESTINATION ${MAN_DIR}/man1 RENAME x0vncserver.1) +install(TARGETS x0vncserver DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) +install(FILES x0vncserver.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME x0vncserver.1) diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt index caf6d7a8..a2048f29 100644 --- a/vncviewer/CMakeLists.txt +++ b/vncviewer/CMakeLists.txt @@ -61,9 +61,9 @@ if(APPLE) target_link_libraries(vncviewer "-framework IOKit") endif() -install(TARGETS vncviewer DESTINATION ${BIN_DIR}) +install(TARGETS vncviewer DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) if(UNIX) - install(FILES vncviewer.man DESTINATION ${MAN_DIR}/man1 RENAME vncviewer.1) + install(FILES vncviewer.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME vncviewer.1) configure_file(vncviewer.desktop.in.in vncviewer.desktop.in) find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge) @@ -92,10 +92,10 @@ if(UNIX) ) endif() add_custom_target(desktop ALL DEPENDS vncviewer.desktop) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop DESTINATION ${DATA_DIR}/applications) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications) foreach(res 16 22 24 32 48) - install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${DATA_DIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png) + install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png) endforeach() - install(FILES ../media/icons/tigervnc.svg DESTINATION ${DATA_DIR}/icons/hicolor/scalable/apps) + install(FILES ../media/icons/tigervnc.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps) endif() diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 32278bc1..39a267c0 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -227,7 +227,7 @@ static void init_fltk() bool exists; sprintf(icon_path, "%s/icons/hicolor/%dx%d/apps/tigervnc.png", - DATA_DIR, icon_sizes[i], icon_sizes[i]); + CMAKE_INSTALL_FULL_DATADIR, icon_sizes[i], icon_sizes[i]); #ifndef WIN32 struct stat st; @@ -505,7 +505,7 @@ int main(int argc, char** argv) argv0 = argv[0]; setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE_NAME, LOCALE_DIR); + bindtextdomain(PACKAGE_NAME, CMAKE_INSTALL_FULL_LOCALEDIR); textdomain(PACKAGE_NAME); rfb::SecurityClient::setDefaults(); diff --git a/vncviewer/vncviewer.desktop.in.in b/vncviewer/vncviewer.desktop.in.in index d775ddec..9d658e44 100644 --- a/vncviewer/vncviewer.desktop.in.in +++ b/vncviewer/vncviewer.desktop.in.in @@ -2,7 +2,7 @@ Name=TigerVNC Viewer GenericName=Remote Desktop Viewer Comment=Connect to VNC server and display remote desktop -Exec=@BIN_DIR@/vncviewer +Exec=@CMAKE_INSTALL_FULL_BINDIR@/vncviewer Icon=tigervnc Terminal=false Type=Application diff --git a/win/vncconfig/CMakeLists.txt b/win/vncconfig/CMakeLists.txt index 6ed22c76..6b620e53 100644 --- a/win/vncconfig/CMakeLists.txt +++ b/win/vncconfig/CMakeLists.txt @@ -9,5 +9,5 @@ add_executable(vncconfig WIN32 target_link_libraries(vncconfig rfb_win32 rfb network rdr ws2_32.lib) install(TARGETS vncconfig - RUNTIME DESTINATION ${BIN_DIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ) diff --git a/win/winvnc/CMakeLists.txt b/win/winvnc/CMakeLists.txt index 113796c8..034211c5 100644 --- a/win/winvnc/CMakeLists.txt +++ b/win/winvnc/CMakeLists.txt @@ -14,5 +14,5 @@ add_executable(winvnc4 WIN32 target_link_libraries(winvnc4 rfb rfb_win32 network rdr ws2_32.lib) install(TARGETS winvnc4 - RUNTIME DESTINATION ${BIN_DIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ) diff --git a/win/wm_hooks/CMakeLists.txt b/win/wm_hooks/CMakeLists.txt index 02bdb1f0..c8888ab7 100644 --- a/win/wm_hooks/CMakeLists.txt +++ b/win/wm_hooks/CMakeLists.txt @@ -8,5 +8,5 @@ add_library(wm_hooks SHARED set_target_properties(wm_hooks PROPERTIES PREFIX "") install(TARGETS wm_hooks - RUNTIME DESTINATION ${BIN_DIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ) -- 2.39.5