mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cmake: add LIBMARBLE_FROM_PKGCONFIG and some Marble related fixes
This patch adds the option to retrive Marble with pkg-config in a similar way to Grantlee, libgit2, etc. It reorganizes the "if(NO_MARBLE)" case to be the "else()" of if(NOT NO_MARBLE). Also, it adds the "-r" option to "rm" here: add_custom_target(link_marble_data ALL COMMAND rm -rf ./marbledata ... as otherwise it fails on Win32/Msys with "marbledata is a directory". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7351ff62d7
commit
0b0e203dbd
1 changed files with 17 additions and 12 deletions
|
@ -10,6 +10,7 @@ set(CMAKE_AUTOUIC ON)
|
||||||
option(LIBGIT2_FROM_PKGCONFIG "use pkg-config to retrieve libgit2" OFF)
|
option(LIBGIT2_FROM_PKGCONFIG "use pkg-config to retrieve libgit2" OFF)
|
||||||
option(LIBDC_FROM_PKGCONFIG "use pkg-config to retrieve libdivecomputer" OFF)
|
option(LIBDC_FROM_PKGCONFIG "use pkg-config to retrieve libdivecomputer" OFF)
|
||||||
option(LIBGRANTLEE_FROM_PKGCONFIG "use pkg-config to retrieve grantlee" OFF)
|
option(LIBGRANTLEE_FROM_PKGCONFIG "use pkg-config to retrieve grantlee" OFF)
|
||||||
|
option(LIBMARBLE_FROM_PKGCONFIG "use pkg-config to retrieve marble" OFF)
|
||||||
option(NO_MARBLE "disable the marble widget" OFF)
|
option(NO_MARBLE "disable the marble widget" OFF)
|
||||||
option(NO_TESTS "disable the tests" OFF)
|
option(NO_TESTS "disable the tests" OFF)
|
||||||
option(NO_DOCS "disable the docs" OFF)
|
option(NO_DOCS "disable the docs" OFF)
|
||||||
|
@ -109,14 +110,24 @@ else()
|
||||||
include_directories(${LIBDIVECOMPUTER_INCLUDE_DIR})
|
include_directories(${LIBDIVECOMPUTER_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# optional marble
|
# setup marble
|
||||||
|
|
||||||
if(NOT NO_MARBLE)
|
if(NOT NO_MARBLE)
|
||||||
find_package(Marble QUIET)
|
if(LIBMARBLE_FROM_PKGCONFIG)
|
||||||
if(MARBLE_FOUND)
|
pkg_config_library(MARBLE libmarble REQUIRED)
|
||||||
include_directories(${MARBLE_INCLUDE_DIR})
|
set(MARBLE_LIBRARIES "")
|
||||||
else()
|
else()
|
||||||
set(NO_MARBLE ON)
|
find_package(MARBLE QUIET)
|
||||||
|
if(MARBLE_FOUND)
|
||||||
|
include_directories(${MARBLE_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
set(NO_MARBLE ON)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "building without marble widget support")
|
||||||
|
add_definitions(-DNO_MARBLE)
|
||||||
|
set(MARBLE_LIBRARIES "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FTDISUPPORT)
|
if(FTDISUPPORT)
|
||||||
|
@ -129,12 +140,6 @@ if(FTDISUPPORT)
|
||||||
add_definitions(-DSERIAL_FTDI)
|
add_definitions(-DSERIAL_FTDI)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NO_MARBLE)
|
|
||||||
message(STATUS "building without marble widget support")
|
|
||||||
add_definitions(-DNO_MARBLE)
|
|
||||||
set(MARBLE_LIBRARIES "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(FBSUPPORT OFF)
|
set(FBSUPPORT OFF)
|
||||||
set(NO_PRINTING ON)
|
set(NO_PRINTING ON)
|
||||||
|
@ -187,7 +192,7 @@ get_filename_component(PARENTDIR ${${PROJECT_NAME}_SOURCE_DIR} PATH)
|
||||||
string(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
|
string(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
|
||||||
if(NOT (insource OR insourcedir))
|
if(NOT (insource OR insourcedir))
|
||||||
if(NOT NO_MARBLE)
|
if(NOT NO_MARBLE)
|
||||||
add_custom_target(link_marble_data ALL COMMAND rm -f marbledata && ln -s ${${PROJECT_NAME}_SOURCE_DIR}/marbledata ${${PROJECT_NAME}_BINARY_DIR}/marbledata)
|
add_custom_target(link_marble_data ALL COMMAND rm -rf ./marbledata && ln -s ${${PROJECT_NAME}_SOURCE_DIR}/marbledata ${${PROJECT_NAME}_BINARY_DIR}/marbledata)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue