|
From: <ai...@us...> - 2013-10-22 17:47:17
|
Revision: 12617
http://sourceforge.net/p/plplot/code/12617
Author: airwin
Date: 2013-10-22 17:47:13 +0000 (Tue, 22 Oct 2013)
Log Message:
-----------
Create SO_PERMISSIONS variable that is designed to mimic
the permissions of shared objects created by the add_library command.
The result should be correct regardless of whether the Linux platform
is Fedora-based or Debian-based.
Use that permissions variable for the dll*_stubs.so shared objects
built and installed by the OCaml bindings and the plplot_octave.oct
shared object built and installed by the Octave bindings.
Tested by Alan W. Irwin <ai...@us...> using the
install target on a Debian system. All permissions of the relevant
installed files mentioned above were (-rw-r--r--) as expected. On
Fedora systems the results should be (-rwxr-xr-x), but that needs
testing.
Modified Paths:
--------------
trunk/bindings/ocaml/CMakeLists.txt
trunk/bindings/ocaml/plcairo/CMakeLists.txt
trunk/bindings/octave/CMakeLists.txt
trunk/cmake/modules/plplot.cmake
Modified: trunk/bindings/ocaml/CMakeLists.txt
===================================================================
--- trunk/bindings/ocaml/CMakeLists.txt 2013-10-22 01:33:19 UTC (rev 12616)
+++ trunk/bindings/ocaml/CMakeLists.txt 2013-10-22 17:47:13 UTC (rev 12617)
@@ -360,15 +360,13 @@
DESTINATION ${OCAML_INSTALL_DIR}/plplot
)
- # Shared library stubs go in stublibs.
- # Use default permissions (rw-r--r--) for FILES signature because
- # those are the permissions used by install(TARGETS... (which
- # we are trying to emulate here because that signature not
- # available to us because this shared object was
- # created by a custom command).
+ # Shared library stubs go in stublibs. Use SO_PERMISSIONS to
+ # be consistent with permissions used for shared objects created
+ # by the add_library command.
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/dllplplot_stubs.so
DESTINATION ${OCAML_INSTALL_DIR}/stublibs
+ PERMISSIONS ${SO_PERMISSIONS}
)
endif(ENABLE_ocaml)
Modified: trunk/bindings/ocaml/plcairo/CMakeLists.txt
===================================================================
--- trunk/bindings/ocaml/plcairo/CMakeLists.txt 2013-10-22 01:33:19 UTC (rev 12616)
+++ trunk/bindings/ocaml/plcairo/CMakeLists.txt 2013-10-22 17:47:13 UTC (rev 12617)
@@ -250,15 +250,13 @@
DESTINATION ${OCAML_INSTALL_DIR}/plcairo
)
- # Shared library stubs go in stublibs
- # Use default permissions (rw-r--r--) for FILES signature because
- # those are the permissions used by install(TARGETS... (which
- # we are trying to emulate here because that signature not
- # available to us because this shared object was
- # created by a custom command).
+ # Shared library stubs go in stublibs. Use SO_PERMISSIONS to
+ # be consistent with permissions used for shared objects created
+ # by the add_library command.
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/dllplcairo_stubs.so
DESTINATION ${OCAML_INSTALL_DIR}/stublibs
+ PERMISSIONS ${SO_PERMISSIONS}
)
endif(ENABLE_ocaml AND OCAML_HAS_CAIRO)
Modified: trunk/bindings/octave/CMakeLists.txt
===================================================================
--- trunk/bindings/octave/CMakeLists.txt 2013-10-22 01:33:19 UTC (rev 12616)
+++ trunk/bindings/octave/CMakeLists.txt 2013-10-22 17:47:13 UTC (rev 12617)
@@ -311,19 +311,15 @@
)
endif(USE_RPATH)
- # Have to be specific about permissions for some reason (probably oct suffix).
- set(PERM_MODULES
- OWNER_READ
- OWNER_WRITE
- GROUP_READ
- WORLD_READ
- )
+ # Have to be specific about permissions for some reason (probably
+ # oct suffix). Use SO_PERMISSIONS to be consistent with permissions
+ # used for other shared objects created by the add_library command.
install(TARGETS plplot_octave
EXPORT export_plplot
LIBRARY
DESTINATION ${OCTAVE_OCT_DIR}
- PERMISSIONS ${PERM_MODULES}
+ PERMISSIONS ${SO_PERMISSIONS}
)
endif(ENABLE_octave)
Modified: trunk/cmake/modules/plplot.cmake
===================================================================
--- trunk/cmake/modules/plplot.cmake 2013-10-22 01:33:19 UTC (rev 12616)
+++ trunk/cmake/modules/plplot.cmake 2013-10-22 17:47:13 UTC (rev 12617)
@@ -544,4 +544,34 @@
include(doxygen)
include(summary)
+# Calculate permissions that should be used for shared objects that
+# are created by custom commands to be consistent with the permissions
+# automatically used for shared objects created as targets. The
+# result (whether execute permissions are set) depends on
+# CMAKE_INSTALL_SO_NO_EXE that is set in
+# $prefix/share/cmake-2.8/Modules/Platform/Linux.cmake, where $prefix
+# is the installation prefix for cmake itself, and the value depends
+# on Linux platform.
+if(CMAKE_INSTALL_SO_NO_EXE)
+ # Permissions for shared objects are (rw-r--r--).
+ set(SO_PERMISSIONS
+ OWNER_READ
+ OWNER_WRITE
+ GROUP_READ
+ WORLD_READ
+ )
+else(CMAKE_INSTALL_SO_NO_EXE)
+ # Permissions for shared objects are (rwxr-xr-x).
+ set(SO_PERMISSIONS
+ OWNER_READ
+ OWNER_WRITE
+ OWNER_EXECUTE
+ GROUP_READ
+ GROUP_EXECUTE
+ WORLD_READ
+ WORLD_EXECUTE
+ )
+endif(CMAKE_INSTALL_SO_NO_EXE)
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|