Revision: 40660
http://brlcad.svn.sourceforge.net/brlcad/?rev=40660&view=rev
Author: starseeker
Date: 2010-09-23 14:11:37 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
Add RPATH and other settings.
Modified Paths:
--------------
rt^3/branches/subversion-cmake/CMakeLists.txt
Modified: rt^3/branches/subversion-cmake/CMakeLists.txt
===================================================================
--- rt^3/branches/subversion-cmake/CMakeLists.txt 2010-09-23 02:22:47 UTC
(rev 40659)
+++ rt^3/branches/subversion-cmake/CMakeLists.txt 2010-09-23 14:11:37 UTC
(rev 40660)
@@ -72,7 +72,38 @@
SVN_FUNCTION_EXISTS(vprintf HAVE_VPRINTF)
SVN_INCLUDE_FILE(zlib.h HAVE_ZLIB_H)
+# The following logic is what allows binaries to run successfully in
+# the build directory AND install directory. Thanks to plplot for
+# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
+# use, i.e. don't skip the full RPATH for the build tree
+SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+
+# when building, don't use the install RPATH already
+# (but later on when installing)
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+
+# the RPATH/INSTALL_NAME_DIR to be used when installing
+if (NOT APPLE)
+ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT APPLE)
+SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+
+# add the automatically determined parts of the RPATH which point to
+# directories outside the build tree to the install RPATH
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+
+# Output directories - this is where built library and executable
+# files will be placed after building but prior to install.
+IF(NOT LIBRARY_OUTPUT_PATH)
+ SET(LIBRARY_OUTPUT_PATH ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/lib CACHE
INTERNAL "Single output directory for building all libraries.")
+ENDIF(NOT LIBRARY_OUTPUT_PATH)
+IF(NOT EXECUTABLE_OUTPUT_PATH)
+ SET(EXECUTABLE_OUTPUT_PATH ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/bin
CACHE INTERNAL "Single output directory for building all executables.")
+ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
+
+
# build shared libs by default
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits