CMakeLists.txt 3.44 KB
Newer Older
Christian Ehrlicher's avatar
Christian Ehrlicher committed
1
2
3
4
5
# before add_subdirectory() !
if(MSVC)
  add_definitions(-D_USE_MATH_DEFINES=1)
endif(MSVC)

Patrick Spendrin's avatar
Patrick Spendrin committed
6
7
8
9
if(BUILD_WITH_DBUS)
add_definitions(-DMARBLE_DBUS)
endif(BUILD_WITH_DBUS)

Michael Zanetti's avatar
Michael Zanetti committed
10
if( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
11
  OPTION(IGNORE_CMAKE_INSTALL_PREFIX_FOR_DECLARATIVE_PLUGINS "Install Marble Qt Declarative plugins to QT_IMPORTS_DIR even if that is out of the CMAKE_INSTALL_PREFIX")
12
  IF(QT_IMPORTS_DIR)
13
14
    SET(MARBLE_QT_IMPORTS_DIR ${QT_IMPORTS_DIR})
  ELSE()
15
16
    # Fallback when FindQt.cmake (part of cmake) does not define QT_IMPORTS_DIR. Get it from qmake instead.
    EXEC_PROGRAM( qmake ARGS "-query QT_INSTALL_QML" OUTPUT_VARIABLE MARBLE_QT_IMPORTS_DIR )
17
  ENDIF()
18
19
  STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" _MARBLE_CMAKE_INSTALL_PREFIX_LEN)
  STRING(LENGTH "${MARBLE_QT_IMPORTS_DIR}" _MARBLE_QT_IMPORTS_DIR_LEN)
20
21
22
23
24
25
26
27
28
  IF(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local)
    IF(NOT ${_MARBLE_QT_IMPORTS_DIR_LEN} LESS ${_MARBLE_CMAKE_INSTALL_PREFIX_LEN})
      STRING(SUBSTRING ${MARBLE_QT_IMPORTS_DIR} 0 ${_MARBLE_CMAKE_INSTALL_PREFIX_LEN} _MARBLE_QT_IMPORTS_DIR_START)
      IF(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL ${_MARBLE_QT_IMPORTS_DIR_START})
        IF(NOT ${IGNORE_CMAKE_INSTALL_PREFIX_FOR_DECLARATIVE_PLUGINS})
          MESSAGE(STATUS "Please include ${MARBLE_PLUGIN_INSTALL_PATH} in the QML_IMPORT_PATH environment variable to use Marble's Qt declarative plugins.")
          MESSAGE(STATUS "Note: Marble Desktop does not make use of declarative plugins. Ignore the message above if you only intend to use the Desktop version.")
          SET(MARBLE_QT_IMPORTS_DIR ${MARBLE_PLUGIN_INSTALL_PATH})
        ENDIF()
29
      ENDIF()
30
31
32
33
34
35
    ELSE()
        IF(NOT ${IGNORE_CMAKE_INSTALL_PREFIX_FOR_DECLARATIVE_PLUGINS})
          MESSAGE(STATUS "Please include ${MARBLE_PLUGIN_INSTALL_PATH} in the QML_IMPORT_PATH environment variable to use Marble's Qt declarative plugins.")
          MESSAGE(STATUS "Note: Marble Desktop does not make use of declarative plugins. Ignore the message above if you only intend to use the Desktop version.")
          SET(MARBLE_QT_IMPORTS_DIR ${MARBLE_PLUGIN_INSTALL_PATH})
        ENDIF()
36
37
38
39
    ENDIF()
  ENDIF()
ENDIF()

40
41
42
43
44
45
46
47
48
49
macro_optional_find_package(ZLIB QUIET)
marble_set_package_properties(ZLIB PROPERTIES DESCRIPTION "general-purpose lossless data-compression library")
marble_set_package_properties(ZLIB PROPERTIES URL "http://www.zlib.net/")
marble_set_package_properties(ZLIB PROPERTIES TYPE OPTIONAL PURPOSE "When found, system zlib is used. When not found, a Marble internal zlib is used.")
if(NOT ZLIB_FOUND)
  add_subdirectory( 3rdparty/zlib )
  set(ZLIB_LIBRARIES zlibstatic)
  set(ZLIB_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zlib" "${CMAKE_CURRENT_BINARY_DIR}/3rdparty/zlib")
endif()

50
add_subdirectory( 3rdparty/sgp4 )
51
add_subdirectory( lib/marble )
52
add_subdirectory( lib/astro )
53
add_subdirectory( lib/marble/declarative )
Gábor Péterffy's avatar
Gábor Péterffy committed
54

Inge Wallin's avatar
Inge Wallin committed
55
add_subdirectory( plugins )
Gábor Péterffy's avatar
Gábor Péterffy committed
56

57
58
59
60
61
62
option(BUILD_MARBLE_APPS "Build Marble Desktop/Mobile applications" ON)
add_feature_info("Marble Desktop/Mobile applications" BUILD_MARBLE_APPS "Build Marble Desktop/Mobile applications. Toggle with BUILD_MARBLE_APPS=YES/NO.")
if(BUILD_MARBLE_APPS)
  add_subdirectory( apps )
endif()

63
add_subdirectory( bindings )
64

Dennis Nienhüser's avatar
Dennis Nienhüser committed
65
66
67
68
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/config-marble.h.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/config-marble.h
)
69

Torsten Rahn's avatar
   
Torsten Rahn committed
70
71
72
if(APPLE)
  add_subdirectory( mac )
endif(APPLE)
73

Dennis Nienhüser's avatar
Dennis Nienhüser committed
74
75
# FIXME ktimezonewidget.h is gone
#add_subdirectory( plasmoid )
76

Dennis Nienhüser's avatar
Dennis Nienhüser committed
77
78
add_subdirectory( plasmarunner )
add_subdirectory( thumbnailer )