mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
This unifies the way the include directories are handled in the CMakeLists.txt files. Paths are now normally relative to the root of the source- or build dir. They may still be relative for paths withing a plugin subdirectory but should no longer be relative to paths outside of the current source- or build-directory. The previous approach had resultet in many different styles which are hard to wrap ones head around if new to the build system. It sometimes defined includes twice By using relative paths, it was not possible to copy paste the paths between different files.
70 lines
2.1 KiB
CMake
70 lines
2.1 KiB
CMake
########################################################
|
|
# Files
|
|
|
|
SET (BENCH_SRCS
|
|
main.cpp
|
|
qgsbench.cpp
|
|
)
|
|
|
|
SET (BENCH_MOC_HDRS
|
|
qgsbench.h
|
|
)
|
|
|
|
########################################################
|
|
# Build
|
|
|
|
QT5_WRAP_CPP (BENCH_MOC_SRCS ${BENCH_MOC_HDRS})
|
|
|
|
ADD_EXECUTABLE (qgis_bench MACOSX_BUNDLE WIN32 ${BENCH_SRCS} ${BENCH_MOC_SRCS} )
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
${CMAKE_SOURCE_DIR}/src/core
|
|
${CMAKE_SOURCE_DIR}/src/core/expression
|
|
${CMAKE_SOURCE_DIR}/src/core/geometry
|
|
${CMAKE_SOURCE_DIR}/src/core/metadata
|
|
${CMAKE_SOURCE_DIR}/src/core/raster
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
${CMAKE_BINARY_DIR}/src/core
|
|
)
|
|
INCLUDE_DIRECTORIES(SYSTEM
|
|
${GEOS_INCLUDE_DIR}
|
|
${SQLITE3_INCLUDE_DIR}
|
|
)
|
|
|
|
TARGET_LINK_LIBRARIES(qgis_bench
|
|
qgis_core
|
|
${SQLITE3_LIBRARY}
|
|
${QT_QTCORE_LIBRARY}
|
|
${QT_QTNETWORK_LIBRARY}
|
|
${QT_QTSVG_LIBRARY}
|
|
${QT_QTXML_LIBRARY}
|
|
${OPTIONAL_QTWEBKIT}
|
|
${QT_QTTEST_LIBRARY}
|
|
)
|
|
|
|
IF(APPLE)
|
|
SET_TARGET_PROPERTIES(qgis_bench PROPERTIES
|
|
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
|
|
INSTALL_RPATH_USE_LINK_PATH true
|
|
)
|
|
ENDIF(APPLE)
|
|
|
|
########################################################
|
|
# Install
|
|
|
|
INSTALL (TARGETS qgis_bench
|
|
BUNDLE DESTINATION ${QGIS_BIN_DIR}
|
|
RUNTIME DESTINATION ${QGIS_BIN_DIR}
|
|
)
|
|
IF (APPLE)
|
|
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_FW_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qgis_bench.app/Contents/Frameworks\")")
|
|
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../../${QGIS_LIB_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qgis_bench.app/Contents/MacOS/lib\")")
|
|
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_PLUGIN_SUBDIR}/.. \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qgis_bench.app/Contents/Plugins\")")
|
|
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_DATA_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qgis_bench.app/Contents/Resources\")")
|
|
# may not exist, unless BundleUtilities are used
|
|
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../../share \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qgis_bench.app/Contents/MacOS/share\")")
|
|
|
|
ENDIF (APPLE)
|
|
|