Author: rhs
Date: Tue Oct 23 15:14:56 2012
New Revision: 1401317

URL: http://svn.apache.org/viewvc?rev=1401317&view=rev
Log:
fixed cmake files to work with relative install prefix; added build 
instructions; modified cmake config variables to match

Modified:
    qpid/proton/trunk/proton-c/CMakeLists.txt
    qpid/proton/trunk/proton-c/README
    qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
    qpid/proton/trunk/proton-c/bindings/python/CMakeLists.txt
    qpid/proton/trunk/proton-c/bindings/ruby/CMakeLists.txt
    qpid/proton/trunk/proton-c/docs/api/CMakeLists.txt

Modified: qpid/proton/trunk/proton-c/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/CMakeLists.txt?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/CMakeLists.txt Tue Oct 23 15:14:56 2012
@@ -4,17 +4,23 @@ project (Proton C)
 
 set (PN_VERSION_MAJOR 0)
 set (PN_VERSION_MINOR 1)
+set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}")
 
-set (PREFIX ${CMAKE_INSTALL_PREFIX})
-set (EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
+# In rpm builds the build sets some variables:
+#  CMAKE_INSTALL_PREFIX - this is a standard cmake variable
+#  INCLUDE_INSTALL_DIR
+#  LIB_INSTALL_DIR
+#  SYSCONF_INSTALL_DIR
+#  SHARE_INSTALL_DIR
+# So make these cached variables and the specific variables non cached
+# and derived from them.
+
+set (INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory")
+set (LIB_INSTALL_DIR lib CACHE PATH "Library object file directory")
+set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration 
directory")
+set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory")
 
-set (ARCHLIBDIR lib CACHE STRING
-         "Architecture specific library directory")
-set (LIBDIR ${CMAKE_INSTALL_PREFIX}/${ARCHLIBDIR})
-set (INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
-set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}")
-set (PROTON_INSTALL_DATADIR share/proton CACHE STRING
-     "Directory to install read-only arch-independent data")
+set (PROTON_SHARE ${SHARE_INSTALL_DIR}/proton)
 
 # Set the default SSL/TLS implementation
 find_package(OpenSSL)
@@ -112,20 +118,20 @@ set_target_properties (
 # Install executables and libraries
 install (TARGETS proton proton-dump qpid-proton
          RUNTIME DESTINATION bin
-         LIBRARY DESTINATION ${LIBDIR})
+         LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
 # Install header files
 file(GLOB headers "include/proton/*.[hi]")
-install (FILES ${headers} DESTINATION include/proton)
+install (FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/proton)
 
 # Install documentation files
 install (FILES LICENSE README TODO
-         DESTINATION ${PROTON_INSTALL_DATADIR})
+         DESTINATION ${PROTON_SHARE})
 
 # Pkg config file
 
 configure_file(${PROJECT_SOURCE_DIR}/src/libqpid-proton.pc.in
          ${PROJECT_BINARY_DIR}/libqpid-proton.pc @ONLY)
 install (FILES ${PROJECT_BINARY_DIR}/libqpid-proton.pc
-         DESTINATION ${LIBDIR}/pkgconfig)
+         DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 

Modified: qpid/proton/trunk/proton-c/README
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/README?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/README (original)
+++ qpid/proton/trunk/proton-c/README Tue Oct 23 15:14:56 2012
@@ -0,0 +1,30 @@
+
+== Build Instructions ==
+
+The following prerequesuites are required to do a full build. If you
+do not wish to build a given language binding you can ommit the -devel
+package for that language:
+
+  # required dependencies
+  yum install gcc cmake libuuid-devel
+
+  # dependencies needed for ssl support
+  yum install openssl-devel
+
+  # dependencies needed for bindings
+  yum install swig python-devel ruby-devel php-devel
+
+From the directory where you found this README file:
+
+  mkdir build
+  cd build
+
+  # Depending on your system you may want to adjust the install prefix
+  # and/or adjust the lib dir.
+  #
+  # cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=lib64 ..
+  cmake -DCMAKE_INSTALL_PREFIX=/usr ..
+
+  make install
+
+Note that all installed files are stored in the install_manifest.txt file.

Modified: qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt Tue Oct 23 15:14:56 
2012
@@ -46,18 +46,18 @@ execute_process(COMMAND ${PHP_CONFIG_EXE
                 OUTPUT_VARIABLE PHP_OPTS
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-string(REPLACE ${PHP_PFX} ${CMAKE_INSTALL_PREFIX} PHP_REL_EXT_DIR 
${PHP_EXT_DIR})
+string(REPLACE "${PHP_PFX}/" "" PHP_REL_EXT_DIR ${PHP_EXT_DIR})
 
 set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php)
 execute_process(COMMAND ${PHP_EXE} ${GET_INCLUDE_DIR} ${PHP_PFX}
                 OUTPUT_VARIABLE PHP_INCLUDE_DIR
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REPLACE ${PHP_PFX} ${CMAKE_INSTALL_PREFIX} PHP_REL_INCLUDE_DIR 
${PHP_INCLUDE_DIR})
+string(REPLACE "${PHP_PFX}/" "" PHP_REL_INCLUDE_DIR ${PHP_INCLUDE_DIR})
 
 string(REGEX MATCH "--with-config-file-scan-dir=([^ ]*)" PHP_OPT_MATCH 
${PHP_OPTS})
 set (PHP_INI_SCAN_DIR ${CMAKE_MATCH_1})
-if (NOT ${PHP_REL_EXT_DIR} STREQUAL ${PHP_EXT_DIR})
-  set (PHP_INI_SCAN_DIR "${CMAKE_INSTALL_PREFIX}${PHP_INI_SCAN_DIR}")
+if (IS_ABSOLUTE "${PHP_INI_SCAN_DIR}" AND (NOT (IS_ABSOLUTE 
${CMAKE_INSTALL_PREFIX})))
+  string(SUBSTRING ${PHP_INI_SCAN_DIR} 1 -1 PHP_INI_SCAN_DIR)
 endif ()
 
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.so

Modified: qpid/proton/trunk/proton-c/bindings/python/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/python/CMakeLists.txt?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/python/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/python/CMakeLists.txt Tue Oct 23 
15:14:56 2012
@@ -7,7 +7,7 @@ swig_link_libraries(cproton ${BINDING_DE
 find_package(PythonInterp REQUIRED)
 
 execute_process(COMMAND ${PYTHON_EXECUTABLE}
-                -c "from distutils.sysconfig import get_python_lib; print 
get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')"
+                -c "from distutils.sysconfig import get_python_lib; print 
get_python_lib(True, prefix='')"
                 OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
 

Modified: qpid/proton/trunk/proton-c/bindings/ruby/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/CMakeLists.txt?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/CMakeLists.txt Tue Oct 23 15:14:56 
2012
@@ -29,7 +29,7 @@ execute_process(COMMAND ${RUBY_EXECUTABL
                 OUTPUT_VARIABLE RUBY_PREFIX
                 OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-string(REPLACE ${RUBY_PREFIX} ${CMAKE_INSTALL_PREFIX} RUBY_PFX_ARCH_DIR 
${RUBY_ARCH_DIR})
+string(REPLACE "${RUBY_PREFIX}/" "" RUBY_PFX_ARCH_DIR ${RUBY_ARCH_DIR})
 
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.so
         RENAME cproton.so

Modified: qpid/proton/trunk/proton-c/docs/api/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/docs/api/CMakeLists.txt?rev=1401317&r1=1401316&r2=1401317&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/docs/api/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/docs/api/CMakeLists.txt Tue Oct 23 15:14:56 2012
@@ -25,7 +25,7 @@ if (DOXYGEN_FOUND)
 
   # HTML files are generated to ./html - put those in the install.
   install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
-           DESTINATION ${PROTON_INSTALL_DATADIR}/docs/api
+           DESTINATION ${PROTON_SHARE}/docs/api
            COMPONENT documentation
            OPTIONAL)
   # if (CPACK_GENERATOR STREQUAL "NSIS")



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to