Skip to content

Commit

Permalink
fix for #3999 until something better can be done
Browse files Browse the repository at this point in the history
  • Loading branch information
kyngchaos committed Nov 6, 2011
1 parent 9a395e6 commit 595eef0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/plugins/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,20 @@ INCLUDE_DIRECTORIES(
TARGET_LINK_LIBRARIES(grassplugin
qgisgrass
qgis_gui
grassprovider
${OPENPTY_LIBRARY}
)

# provider must be built as module on OS X so it gets loaded,
# lookup symbols dynamically instead of linking at compile time
IF (APPLE)
SET_TARGET_PROPERTIES(grassplugin PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup")
ELSE (APPLE)
TARGET_LINK_LIBRARIES(grassplugin
grassprovider
)
ENDIF (APPLE)

# override default path where built files are put to allow running qgis without installing
# the binary goes under libexec subdir
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIBEXEC_SUBDIR}/grass/bin)
Expand Down
8 changes: 7 additions & 1 deletion src/providers/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ ENDIF (APPLE)
#

QT4_WRAP_CPP(GRASS_PROVIDER_MOC_SRCS qgsgrassprovider.h)
ADD_LIBRARY(grassprovider SHARED qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS})
# provider must be built as module on OS X so it gets loaded,
# other modules that need provider symbols must dynamically lookup them
IF (APPLE)
ADD_LIBRARY(grassprovider MODULE qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS})
ELSE (APPLE)
ADD_LIBRARY(grassprovider SHARED qgsgrassprovider.cpp ${GRASS_PROVIDER_MOC_SRCS})
ENDIF (APPLE)
SET_TARGET_PROPERTIES(grassprovider PROPERTIES COMPILE_FLAGS "\"-DGRASS_EXPORT=${DLLEXPORT}\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\"" )
TARGET_LINK_LIBRARIES(grassprovider qgisgrass)

Expand Down

0 comments on commit 595eef0

Please sign in to comment.