Skip to content

Commit

Permalink
Add qgis_python.h with PYTHON_EXPORT macro
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 4, 2017
1 parent 4c1f178 commit 2306c11
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ ELSE (WIN32)

ENDIF(WIN32)

ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
Expand Down
1 change: 1 addition & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/../ui
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
)
INCLUDE_DIRECTORIES(SYSTEM
${QWT_INCLUDE_DIR}
Expand Down
14 changes: 11 additions & 3 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
REMOVE_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DPYTHON_EXPORT=${DLLEXPORT}\"")

SET(QGISPYTHON_SRCS qgispython.cpp qgspythonutilsimpl.cpp)

INCLUDE_DIRECTORIES(
Expand All @@ -9,6 +6,7 @@ INCLUDE_DIRECTORIES(
../core/raster
../gui
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/python
)
INCLUDE_DIRECTORIES(SYSTEM
${PYTHON_INCLUDE_PATH}
Expand All @@ -34,6 +32,16 @@ TARGET_LINK_LIBRARIES(qgispython
${OPENPTY_LIBRARY}
)

GENERATE_EXPORT_HEADER(
qgispython
BASE_NAME PYTHON
EXPORT_FILE_NAME qgis_python.h
)

INSTALL(FILES
${PROJECT_BINARY_DIR}/qgis_python.h DESTINATION ${QGIS_INCLUDE_DIR}
)

IF (APPLE)
SET_TARGET_PROPERTIES(qgispython PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF (APPLE)
Expand Down
1 change: 1 addition & 0 deletions src/python/qgspythonutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Needed for CMake variables defines
#include "qgsconfig.h"

#include "qgis_python.h"

#include <QString>
#include <QStringList>
Expand Down
1 change: 1 addition & 0 deletions src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ INCLUDE_DIRECTORIES(SYSTEM
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
../core
../core/auth
../core/dxf
Expand Down
1 change: 1 addition & 0 deletions tests/src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/test
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
)
INCLUDE_DIRECTORIES(SYSTEM
${QT_INCLUDE_DIR}
Expand Down

0 comments on commit 2306c11

Please sign in to comment.