@@ -76,9 +76,26 @@ ADD_CUSTOM_TARGET(qgis_applicationtestmoc ALL DEPENDS ${qgis_applicationtest_MOC
76
76
ADD_EXECUTABLE (qgis_applicationtest ${qgis_applicationtest_SRCS} )
77
77
ADD_DEPENDENCIES (qgis_applicationtest qgis_applicationtestmoc )
78
78
TARGET_LINK_LIBRARIES (qgis_applicationtest ${QT_LIBRARIES} qgis_core )
79
+ #No relinking and full RPATH for the install tree
80
+ #See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
79
81
SET_TARGET_PROPERTIES (qgis_applicationtest
82
+ # skip the full RPATH for the build tree
83
+ PROPERTIES SKIP_BUILD_RPATH TRUE
84
+ )
85
+ SET_TARGET_PROPERTIES (qgis_applicationtest
86
+ # when building, use the install RPATH already
87
+ # (so it doesn't need to relink when installing)
88
+ PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE
89
+ )
90
+ SET_TARGET_PROPERTIES (qgis_applicationtest
91
+ # the RPATH to be used when installing
80
92
PROPERTIES INSTALL_RPATH ${QGIS_LIB_DIR}
81
- INSTALL_RPATH_USE_LINK_PATH true )
93
+ )
94
+ SET_TARGET_PROPERTIES (qgis_applicationtest
95
+ # add the automatically determined parts of the RPATH
96
+ # which point to directories outside the build tree to the install RPATH
97
+ PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE
98
+ )
82
99
IF (APPLE )
83
100
# For Mac OS X, the executable must be at the root of the bundle's executable folder
84
101
INSTALL (TARGETS qgis_applicationtest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} )
0 commit comments