[CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2014 16:39:17 +0000 (16:39 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2014 16:39:17 +0000 (16:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132819

Reviewed by Carlos Garcia Campos.

.:
* CMakeLists.txt: Hard-code CMAKE_ARCHIVE_OUTPUT_DIRECTORY etc, so that we can accept absolute paths for LIB_INSTALL_DIR
and friends.
* Source/cmake/OptionsCommon.cmake: Get rid of LIB_SUFFIX and try to make all path variables absolute. Also set
CMAKE_ARCHIVE_OUTPUT_DIRECTORY, etc using the last path component of LIB_INSTALL_DIR, etc, so that absolute paths
are supported.
* Source/cmake/OptionsGTK.cmake: Ditto. Also get rid of all pkg-config specific variables.

Source/JavaScriptCore:
* javascriptcoregtk.pc.in: Instead of using the special pkg-config variables,
use the common CMake ones directly.

Source/WebKit/efl:
* EWebKitConfig.cmake.in: LIB_INSTALL_DIR is always absolute now, so we don't need
to prefix it with the prefix.
* ewebkit.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.

Source/WebKit2:
* PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer.
* PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones.
* efl/EWebKit2Config.cmake.in: Ditto.
* efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.
* webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use
the common CMake ones.
* webkit2gtk.pc.in: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/javascriptcoregtk.pc.in
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/EWebKitConfig.cmake.in
Source/WebKit/efl/ewebkit.pc.in
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/efl/EWebKit2Config.cmake.in
Source/WebKit2/efl/ewebkit2.pc.in
Source/WebKit2/webkit2gtk-web-extension.pc.in
Source/WebKit2/webkit2gtk.pc.in
Source/cmake/OptionsCommon.cmake
Source/cmake/OptionsGTK.cmake

index 51d701d..b82a6da 100644 (file)
@@ -137,9 +137,9 @@ option(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the bui
 # Common options
 #------------------------------------------------------------------------------
 include(OptionsCommon)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${EXEC_INSTALL_DIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
 # -----------------------------------------------------------------------------
 # Port-specific options
index fd521e4..e95d5d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-05-16  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
+        https://bugs.webkit.org/show_bug.cgi?id=132819
+
+        Reviewed by Carlos Garcia Campos.
+
+        * CMakeLists.txt: Hard-code CMAKE_ARCHIVE_OUTPUT_DIRECTORY etc, so that we can accept absolute paths for LIB_INSTALL_DIR
+        and friends.
+        * Source/cmake/OptionsCommon.cmake: Get rid of LIB_SUFFIX and try to make all path variables absolute. Also set
+        CMAKE_ARCHIVE_OUTPUT_DIRECTORY, etc using the last path component of LIB_INSTALL_DIR, etc, so that absolute paths
+        are supported.
+        * Source/cmake/OptionsGTK.cmake: Ditto. Also get rid of all pkg-config specific variables.
+
 2014-05-20  Gustavo Noronha Silva  <gns@gnome.org>
 
         [CMake] Support building with Debug Fission
index 037760e..d9121f4 100644 (file)
@@ -1,3 +1,13 @@
+2014-05-16  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
+        https://bugs.webkit.org/show_bug.cgi?id=132819
+
+        Reviewed by Carlos Garcia Campos.
+
+        * javascriptcoregtk.pc.in: Instead of using the special pkg-config variables,
+        use the common CMake ones directly.
+
 2014-05-21  Filip Pizlo  <fpizlo@apple.com>
 
         Unreviewed, roll out http://trac.webkit.org/changeset/169159.
index ca7c8e3..b2afb26 100644 (file)
@@ -1,11 +1,11 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@LIB_INSTALL_DIR@
+includedir=${prefix}/include
 
 Name: JavaScriptCoreGTK+
 Description: GTK+ version of the JavaScriptCore engine
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: glib-2.0
 Libs: -L${libdir} -ljavascriptcoregtk-@WEBKITGTK_API_VERSION@
 Cflags: -I${includedir}/webkitgtk-@WEBKITGTK_API_VERSION@
index e520fcd..410768f 100644 (file)
@@ -1,3 +1,14 @@
+2014-05-16  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
+        https://bugs.webkit.org/show_bug.cgi?id=132819
+
+        Reviewed by Carlos Garcia Campos.
+
+        * EWebKitConfig.cmake.in: LIB_INSTALL_DIR is always absolute now, so we don't need
+        to prefix it with the prefix.
+        * ewebkit.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.
+
 2014-05-16  Piotr Grad  <p.grad@samsung.com>
 
         [EFL] Build break after 168978.
index 293e8a4..c565882 100644 (file)
@@ -5,7 +5,7 @@ set(EWEBKIT_VERSION_MINOR @PROJECT_VERSION_MINOR@)
 set(EWEBKIT_VERSION @PROJECT_VERSION@)
 
 set(_SHARED_CORE @SHARED_CORE@)
-set(_libdir "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@")
+set(_libdir "@LIB_INSTALL_DIR@")
 
 find_path(EWEBKIT_INCLUDE_DIR EWebKit.h HINTS "@CMAKE_INSTALL_PREFIX@/include/@WebKit_OUTPUT_NAME@-@PROJECT_VERSION_MAJOR@")
 find_library(EWEBKIT_LIBRARY NAMES ewebkit HINTS ${_libdir})
index 1cba8d9..4056e00 100644 (file)
@@ -1,6 +1,6 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=@LIB_INSTALL_DIR@
 includedir=${prefix}/include
 datadir=${prefix}/@DATA_INSTALL_DIR@
 
index dc1c031..7fdd3e2 100644 (file)
@@ -1,3 +1,18 @@
+2014-05-16  Martin Robinson  <mrobinson@igalia.com>
+
+        [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
+        https://bugs.webkit.org/show_bug.cgi?id=132819
+
+        Reviewed by Carlos Garcia Campos.
+
+        * PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer.
+        * PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones.
+        * efl/EWebKit2Config.cmake.in: Ditto.
+        * efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.
+        * webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use
+        the common CMake ones.
+        * webkit2gtk.pc.in: Ditto.
+
 2014-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r168625): [GTK] Assertion failure in LocalStorageDatabaseTracker
index f84fad9..fc4339e 100644 (file)
@@ -443,7 +443,7 @@ set(WEBKIT2_EFL_TEST_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
 add_definitions(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\"
     -DTEST_LIB_DIR=\"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\"
     -DGTEST_LINKED_AS_SHARED_LIBRARY=1
-    -DLIBEXECDIR=\"${CMAKE_INSTALL_PREFIX}/${EXEC_INSTALL_DIR}\"
+    -DLIBEXECDIR=\"${EXEC_INSTALL_DIR}\"
     -DWEBPROCESSNAME=\"WebProcess\"
     -DPLUGINPROCESSNAME=\"PluginProcess\"
     -DNETWORKPROCESSNAME=\"NetworkProcess\"
index d18188f..ec0a44a 100644 (file)
@@ -8,9 +8,9 @@ configure_file(webkit2gtk.pc.in ${WebKit2_PKGCONFIG_FILE} @ONLY)
 configure_file(webkit2gtk-web-extension.pc.in ${WebKit2WebExtension_PKGCONFIG_FILE} @ONLY)
 
 add_definitions(-DWEBKIT2_COMPILATION)
-add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
+add_definitions(-DLIBEXECDIR="${LIBEXEC_INSTALL_DIR}")
 add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
-add_definitions(-DLIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}")
+add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
 
 set(WebKit2_USE_PREFIX_HEADER ON)
 
index 8ccbc96..ef70503 100644 (file)
@@ -5,7 +5,7 @@ set(EWEBKIT2_VERSION_MINOR @PROJECT_VERSION_MINOR@)
 set(EWEBKIT2_VERSION @PROJECT_VERSION@)
 
 set(_SHARED_CORE @SHARED_CORE@)
-set(_libdir "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@")
+set(_libdir "@LIB_INSTALL_DIR@")
 
 find_path(EWEBKIT2_INCLUDE_DIR EWebKit2.h HINTS "@CMAKE_INSTALL_PREFIX@/include/@WebKit2_OUTPUT_NAME@-@PROJECT_VERSION_MAJOR@")
 find_library(EWEBKIT2_LIBRARY NAMES ewebkit2 HINTS ${_libdir})
index 7a3deed..433dc04 100644 (file)
@@ -1,6 +1,6 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=@LIB_INSTALL_DIR@
 includedir=${prefix}/include
 datadir=${prefix}/@DATA_INSTALL_DIR@
 
index 22c2d08..1f41c79 100644 (file)
@@ -1,11 +1,11 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@LIB_INSTALL_DIR@
+includedir=${prefix}/include
 
 Name: WebKit2WebExtension
 Description: WebKit web process extensions
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: glib-2.0 gtk+-@GTK_API_VERSION@ libsoup-2.4 javascriptcoregtk-@WEBKITGTK_API_VERSION@
 Libs: -L${libdir} -lwebkit2gtk-@WEBKITGTK_API_VERSION@
 Cflags: -I${includedir}/webkitgtk-@WEBKITGTK_API_VERSION@
index 05416fd..5680e01 100644 (file)
@@ -1,11 +1,11 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@LIB_INSTALL_DIR@
+includedir=${prefix}/include
 
 Name: WebKit2
 Description: Web content engine for GTK+
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: glib-2.0 gtk+-@GTK_API_VERSION@ libsoup-2.4 javascriptcoregtk-@WEBKITGTK_API_VERSION@
 Libs: -L${libdir} -lwebkit2gtk-@WEBKITGTK_API_VERSION@
 Cflags: -I${includedir}/webkitgtk-@WEBKITGTK_API_VERSION@
index f2c13f2..9f88486 100644 (file)
@@ -61,12 +61,11 @@ if (UNIX AND NOT APPLE)
     set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
 endif ()
 
-# GTK uses the GNU installation directories.
+# GTK uses the GNU installation directories as defaults.
 if (NOT PORT STREQUAL "GTK")
-    set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
-    set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Where to install libraries (lib${LIB_SUFFIX})")
-    set(EXEC_INSTALL_DIR "bin" CACHE PATH "Where to install executables")
-    set(LIBEXEC_INSTALL_DIR "bin" CACHE PATH "Where to install executables executed by the library")
+    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Absolute path to library installation directory")
+    set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Absolute path to executable installation directory")
+    set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Absolute path to install executables executed by the library")
 endif ()
 
 # The Ninja generator does not yet know how to build archives in pieces, and so response
index 5d10250..85390bf 100644 (file)
@@ -1,7 +1,3 @@
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
 include(GNUInstallDirs)
 
 set(PROJECT_VERSION_MAJOR 2)
@@ -100,13 +96,6 @@ set(ENABLE_PLUGIN_PROCESS ON)
 set(GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6)
 set(GTK_API_VERSION 3.0)
 
-# These are used to generate the pkg-config files.
-set(prefix ${CMAKE_INSTALL_PREFIX})
-set(exec_prefix ${CMAKE_INSTALL_PREFIX})
-set(libdir "${prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(includedir "${prefix}/include")
-set(VERSION ${PROJECT_VERSION})
-
 set(WTF_USE_SOUP 1)
 set(WTF_USE_UDIS86 1)
 
@@ -119,11 +108,14 @@ set(WebKit2_WebProcess_OUTPUT_NAME WebKitWebProcess)
 set(WebKit2_NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)
 set(WebKit2_PluginProcess_OUTPUT_NAME WebKitPluginProcess)
 
+# These are shared variables, but we special case their definition so that we can use the
+# CMAKE_INSTALL_* variables that are populated by the GNUInstallDirs macro.
+set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory")
+set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory")
+set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}" CACHE PATH "Absolute path to install executables executed by the library")
+
 set(DATA_BUILD_DIR "${CMAKE_BINARY_DIR}/share/${WebKit_OUTPUT_NAME}")
 set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/webkitgtk-${WEBKITGTK_API_VERSION}")
-set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Where to install libraries")
-set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Where to install executables")
-set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_LIBEXECDIR}" CACHE PATH "Where to install executables executed by the library")
 set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-${WEBKITGTK_API_VERSION}")
 
 add_definitions(-DBUILDING_GTK__=1)