File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,20 @@ INCLUDE_DIRECTORIES(
154
154
TARGET_LINK_LIBRARIES (grassplugin
155
155
qgisgrass
156
156
qgis_gui
157
- grassprovider
158
157
${OPENPTY_LIBRARY}
159
158
)
160
159
160
+ # provider must be built as module on OS X so it gets loaded,
161
+ # lookup symbols dynamically instead of linking at compile time
162
+ IF (APPLE )
163
+ SET_TARGET_PROPERTIES (grassplugin PROPERTIES
164
+ LINK_FLAGS "-undefined dynamic_lookup" )
165
+ ELSE (APPLE )
166
+ TARGET_LINK_LIBRARIES (grassplugin
167
+ grassprovider
168
+ )
169
+ ENDIF (APPLE )
170
+
161
171
# override default path where built files are put to allow running qgis without installing
162
172
# the binary goes under libexec subdir
163
173
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY} /${QGIS_LIBEXEC_SUBDIR}/grass/bin )
Original file line number Diff line number Diff line change @@ -47,7 +47,13 @@ ENDIF (APPLE)
47
47
#
48
48
49
49
QT4_WRAP_CPP (GRASS_PROVIDER_MOC_SRCS qgsgrassprovider.h )
50
- ADD_LIBRARY (grassprovider SHARED qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS} )
50
+ # provider must be built as module on OS X so it gets loaded,
51
+ # other modules that need provider symbols must dynamically lookup them
52
+ IF (APPLE )
53
+ ADD_LIBRARY (grassprovider MODULE qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS} )
54
+ ELSE (APPLE )
55
+ ADD_LIBRARY (grassprovider SHARED qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS} )
56
+ ENDIF (APPLE )
51
57
SET_TARGET_PROPERTIES (grassprovider PROPERTIES COMPILE_FLAGS "\" -DGRASS_EXPORT=${DLLEXPORT} \" \" -DGRASS_LIB_EXPORT=${DLLIMPORT} \" " )
52
58
TARGET_LINK_LIBRARIES (grassprovider qgisgrass )
53
59
You can’t perform that action at this time.
0 commit comments