include paths before platform, move config code around 0.9.20
authorkoda
Sat, 28 Dec 2013 22:00:57 +0100
branch0.9.20
changeset 9860 d419ff107e15
parent 9858 343d12172070
child 9862 14292fb8d094
include paths before platform, move config code around
CMakeLists.txt
cmake_modules/paths.cmake
cmake_modules/platform.cmake
--- a/CMakeLists.txt	Sat Dec 28 21:53:17 2013 +0100
+++ b/CMakeLists.txt	Sat Dec 28 22:00:57 2013 +0100
@@ -51,9 +51,10 @@
 
 #general utilities
 include(${CMAKE_MODULE_PATH}/utils.cmake)
+#paths initialization
+include(${CMAKE_MODULE_PATH}/paths.cmake)
 #platform specific init code
 include(${CMAKE_MODULE_PATH}/platform.cmake)
-include(${CMAKE_MODULE_PATH}/paths.cmake)
 
 
 #when build type is not specified, assume Debug/Release according to build version information
--- a/cmake_modules/paths.cmake	Sat Dec 28 21:53:17 2013 +0100
+++ b/cmake_modules/paths.cmake	Sat Dec 28 22:00:57 2013 +0100
@@ -56,13 +56,10 @@
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
 
 if(APPLE)
+    #@rpath mangling
     set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
-    #workaround older cmake versions
-    if(${CMAKE_VERSION} VERSION_LESS "2.8.12")
-        add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
-        add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
-        add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k-rpath -k${CMAKE_INSTALL_RPATH}")
-    endif()
+    #install_name_tool for libraries
+    set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks")
 else(APPLE)
     #paths where to find libraries (final slash not optional):
     # - the first is relative to the executable
@@ -71,7 +68,3 @@
     #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html
     set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
 endif(APPLE)
-
-#install_name_tool magic for OS X
-set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks")
-
--- a/cmake_modules/platform.cmake	Sat Dec 28 21:53:17 2013 +0100
+++ b/cmake_modules/platform.cmake	Sat Dec 28 22:00:57 2013 +0100
@@ -82,6 +82,13 @@
 
     #add user framework directory
     add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks")
+
+    #workaround older cmake versions
+    if(${CMAKE_VERSION} VERSION_LESS "2.8.12")
+        add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
+        add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_RPATH}")
+        add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k-rpath -k${CMAKE_INSTALL_RPATH}")
+    endif()
 endif(APPLE)
 
 if(MINGW)