Skip to content

Commit

Permalink
fix grass <7.1 build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 17, 2015
1 parent ab943f8 commit 6496bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/providers/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
${GRASS_LIBRARY_UIS_H}
)

IF(GRASS_OFF_T_SIZE)
SET(GRASS_OFF_T_SIZE_DEF "\"-DGRASS_OFF_T_SIZE=${GRASS_OFF_T_SIZE}\"")
ELSE(GRASS_OFF_T_SIZE)
SET(GRASS_OFF_T_SIZE_DEF "")
ENDIF(GRASS_OFF_T_SIZE)

SET_TARGET_PROPERTIES(qgisgrass${GRASS_BUILD_VERSION} PROPERTIES
CLEAN_DIRECT_OUTPUT 1
FRAMEWORK 1
FRAMEWORK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/framework.info.plist.in"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${COMPLETE_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.qgis.qgis2_grass
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\" \"-DGRASS_OFF_T_SIZE=${GRASS_OFF_T_SIZE}\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\" ${GRASS_OFF_T_SIZE_DEF}"
)

IF (APPLE)
Expand Down
4 changes: 2 additions & 2 deletions src/providers/grass/qgsgrassprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ typedef int Vect_delete_line_function_type( struct Map_info *, int );
#ifdef Q_OS_WIN
typedef qint64 grass_off_t;
#else
#if GRASS_OFF_T_SIZE == 4
#if defined(GRASS_OFF_T_SIZE) && GRASS_OFF_T_SIZE == 4
typedef qint32 grass_off_t;
#elif GRASS_OFF_T_SIZE == 8
#elif defined(GRASS_OFF_T_SIZE) && GRASS_OFF_T_SIZE == 8
typedef qint64 grass_off_t;
#else
typedef off_t grass_off_t; // GRASS_OFF_T_SIZE undefined, default to off_t
Expand Down

0 comments on commit 6496bc4

Please sign in to comment.