CMakeLists.txt   CMakeLists.txt 
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0)) IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0))
CMAKE_POLICY(SET CMP0050 OLD) CMAKE_POLICY(SET CMP0050 OLD)
# silently ignore errors in add_dependency(): # silently ignore errors in add_dependency():
CMAKE_POLICY(SET CMP0046 OLD) CMAKE_POLICY(SET CMP0046 OLD)
ENDIF() ENDIF()
# just avoid a warning mess. # just avoid a warning mess.
IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSIO N}" LESS 3.0.2)) IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSIO N}" LESS 3.0.2))
CMAKE_POLICY(SET CMP0043 OLD) CMAKE_POLICY(SET CMP0043 OLD)
ENDIF() ENDIF()
IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSIO N}" LESS 3.1.3)) IF(NOT ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSIO N}" LESS 3.1.3))
CMAKE_POLICY(SET CMP0054 OLD) CMAKE_POLICY(SET CMP0054 OLD)
ENDIF() ENDIF()
# warn about deprecated stuff so that we may try fixing it
SET(CMAKE_WARN_DEPRECATED 1)
########### Project name ########### ########### Project name ###########
PROJECT(Stellarium) PROJECT(Stellarium)
# Use integer versions instead of strings for easier handling if required # Use integer versions instead of strings for easier handling if required
SET(STELLARIUM_MAJOR 0) SET(STELLARIUM_MAJOR 0)
SET(STELLARIUM_MINOR 15) SET(STELLARIUM_MINOR 15)
SET(STELLARIUM_PATCH 1) SET(STELLARIUM_PATCH 2)
ADD_DEFINITIONS( ADD_DEFINITIONS(
-DSTELLARIUM_MAJOR=${STELLARIUM_MAJOR} -DSTELLARIUM_MAJOR=${STELLARIUM_MAJOR}
-DSTELLARIUM_MINOR=${STELLARIUM_MINOR} -DSTELLARIUM_MINOR=${STELLARIUM_MINOR}
-DSTELLARIUM_PATCH=${STELLARIUM_PATCH} -DSTELLARIUM_PATCH=${STELLARIUM_PATCH}
) )
SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}") SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")
SET(PACKAGE stellarium) SET(PACKAGE stellarium)
SET(COPYRIGHT_YEARS "2000-2016") SET(COPYRIGHT_YEARS "2000-2017")
SET(PACKAGE_VERSION "${VERSION}") SET(PACKAGE_VERSION "${VERSION}")
ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}") ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
ADD_DEFINITIONS(-DCOPYRIGHT_YEARS="${COPYRIGHT_YEARS}") ADD_DEFINITIONS(-DCOPYRIGHT_YEARS="${COPYRIGHT_YEARS}")
# Write version of Stellarium to Stellarium User Guide
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/version.tex.cmake ${PROJECT_SOUR
CE_DIR}/guide/version.tex @ONLY NEWLINE_STYLE LF)
# currently Qt 5.4 - 5.6 is recommended, we can still build with Qt 5.3, an d 5.7 may have some bugs
SET(MINIMAL_QT_VERSION "5.3.0") SET(MINIMAL_QT_VERSION "5.3.0")
# Use customized cmake macros # Use customized cmake macros
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Show platform info
MESSAGE(STATUS "Platform: ${CMAKE_SYSTEM}")
########### Main global variables ########### ########### Main global variables ###########
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, op tions are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FO RCE) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, o ptions are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." F ORCE)
ENDIF() ENDIF()
SET(STELLARIUM_RELEASE_BUILD 1 CACHE BOOL "Set 1 to build as an official re lease (0 for development snapshots).") SET(STELLARIUM_RELEASE_BUILD 1 CACHE BOOL "Set 1 to build as an official re lease (0 for development snapshots).")
IF(STELLARIUM_RELEASE_BUILD) IF(STELLARIUM_RELEASE_BUILD)
ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD) ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD)
ENDIF() ENDIF()
# GZ I had seen that some releases (e.g. 0.13.3 Ubuntu/ARM) were not compil ed with NDEBUG defined. Maybe a bug in compilatation setup? # GZ I had seen that some releases (e.g. 0.13.3 Ubuntu/ARM) were not compil ed with NDEBUG defined. Maybe a bug in compilatation setup?
# Hint from http://public.kitware.com/Bug/view.php?id=14292. Actually fixed with CMake 2.8.12, but maybe we have other effects? # Hint from http://public.kitware.com/Bug/view.php?id=14292. Actually fixed with CMake 2.8.12, but maybe we have other effects?
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-DQT_NO_DEBUG -DNDEBUG) ADD_DEFINITIONS(-DQT_NO_DEBUG -DNDEBUG)
endif() ENDIF()
SET(OPENGL_DEBUG_LOGGING 0 CACHE BOOL "Enable to log OpenGL information usi
ng the GL_KHR_debug extension/QOpenGLLogger")
IF(OPENGL_DEBUG_LOGGING)
ADD_DEFINITIONS(-DOPENGL_DEBUG_LOGGING)
# This enables logging of QOpenGLFunctions through forced glGetError a
fter each call
ADD_DEFINITIONS(-DQ_ENABLE_OPENGL_FUNCTIONS_DEBUG)
ENDIF()
# Use ccache if possible # Use ccache if possible
find_program(CCACHE_PROGRAM ccache) FIND_PROGRAM(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM) IF(CCACHE_PROGRAM)
MESSAGE(STATUS "Found ccache ${CCACHE_PROGRAM}") MESSAGE(STATUS "Found ccache ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif() ENDIF()
# Add gprof build options if necessary. Note gmon.out will be created in w orking directory when Stellarium is executed # Add gprof build options if necessary. Note gmon.out will be created in w orking directory when Stellarium is executed
IF(${CMAKE_BUILD_TYPE} MATCHES "GProf") IF(${CMAKE_BUILD_TYPE} MATCHES "GProf")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
ENDIF() ENDIF()
# Add valgrind build options if necessary # Add valgrind build options if necessary
IF(${CMAKE_BUILD_TYPE} MATCHES "Valgrind") IF(${CMAKE_BUILD_TYPE} MATCHES "Valgrind")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
ENDIF() ENDIF()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(APPLE 1) SET(APPLE 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF() ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
IF(WIN32) IF(WIN32)
# The stars structs rely on gnu gcc packing of bit-fields. # The stars structs rely on gnu gcc packing of bit-fields.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields")
ENDIF() ENDIF()
SET(GCC_VERSION "${CMAKE_CXX_COMPILER_VERSION}") SET(GCC_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
ELSE() ELSE()
SET(GCC_VERSION "0.0") SET(GCC_VERSION "0.0")
ENDIF() ENDIF()
# _USE_MATH_DEFINES enables use of math constants like M_PI, # _USE_MATH_DEFINES enables use of math constants like M_PI,
# which are by default disabled in standard C++ mode (like std=c++11 instea d of std=gnu11) # which are by default disabled in standard C++ mode (like std=c++11 instea d of std=gnu11)
ADD_DEFINITIONS(-D_USE_MATH_DEFINES) ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
# flags shared for gcc-like compilers (also MinGW/Clang) # flags shared for gcc-like compilers (also MinGW/Clang)
# Qt 5.7 requires C++11 support # Qt 5.7 requires C++11 support
SET(STEL_GCC_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-resul t") SET(STEL_GCC_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-resul t")
SET(STEL_GCC_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-res ult") SET(STEL_GCC_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-res ult")
SET(STELLARIUM_USE_CPP11 1 CACHE BOOL "Set whether to try using C++11 when compiling. Required for Qt >= 5.7") SET(STELLARIUM_USE_CPP11 1 CACHE BOOL "Set whether to try using C++11 when compiling. Required for Qt >= 5.7")
IF(STELLARIUM_USE_CPP11) IF(STELLARIUM_USE_CPP11)
IF(NOT (CMAKE_VERSION VERSION_LESS 3.1.0)) IF(NOT (CMAKE_VERSION VERSION_LESS 3.1.0))
# Let CMake handle setting C++11 (since 3.1) # Let CMake handle setting C++11 (since 3.1)
SET(CMAKE_CXX_STANDARD 11) SET(CMAKE_CXX_STANDARD 11)
ELSE() ELSE()
# Add std=c++11 to gcc flags # Add std=c++11 to gcc flags
SET(STEL_GCC_CXX_FLAGS "-std=c++11 ${STEL_GCC_CXX_FLAGS}") SET(STEL_GCC_CXX_FLAGS "-std=c++11 ${STEL_GCC_CXX_FLAGS}")
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
IF(NOT MSVC) IF(NOT MSVC)
# MinGW requires enabling of exceptions, version number storage a nd MinGW-specific threading # MinGW requires enabling of exceptions, version number storage a nd MinGW-specific threading
SET(STEL_MINGW_FLAGS "-fexceptions -fident -mthreads") SET(STEL_MINGW_FLAGS "-fexceptions -fident -mthreads")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${STEL_GCC_C_FLAGS} ${STEL_MI NGW_FLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${STEL_GCC_C_FLAGS} ${STEL_MI NGW_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STEL_GCC_CXX_FLAGS} ${S TEL_MINGW_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STEL_GCC_CXX_FLAGS} ${S TEL_MINGW_FLAGS}")
# -mwindows generates a windows GUI app # -mwindows generates a windows GUI app
skipping to change at line 186 skipping to change at line 202
IF(ENABLE_NLS) IF(ENABLE_NLS)
ADD_DEFINITIONS(-DENABLE_NLS) ADD_DEFINITIONS(-DENABLE_NLS)
ENDIF() ENDIF()
# Activate media support # Activate media support
SET(ENABLE_MEDIA 1 CACHE BOOL "Define whether media support should be activ ated.") SET(ENABLE_MEDIA 1 CACHE BOOL "Define whether media support should be activ ated.")
# SPOUT allows relaying the Stellarium OpenGL framebuffer as DirectX textur e in other programs. # SPOUT allows relaying the Stellarium OpenGL framebuffer as DirectX textur e in other programs.
# It exists on Windows only. Syphon is a similar system for MacOS, this mig ht be added by a Mac developer. # It exists on Windows only. Syphon is a similar system for MacOS, this mig ht be added by a Mac developer.
IF(WIN32) IF(WIN32)
SET(ENABLE_SPOUT 1 CACHE BOOL "Define whether SPOUT support should be IF(${CMAKE_SYSTEM_VERSION} LESS 6.1 ) # Need Windows 7 to enable suppo
activated.") rt of Spout
SET(ENABLE_SPOUT 0)
MESSAGE(STATUS "Spout support disabled due to operating system re
quirement")
ELSE()
SET(ENABLE_SPOUT 1 CACHE BOOL "Define whether SPOUT support shoul
d be activated.")
ENDIF()
ELSE() ELSE()
SET(ENABLE_SPOUT 0) SET(ENABLE_SPOUT 0)
ENDIF() ENDIF()
IF(ENABLE_SPOUT) IF(ENABLE_SPOUT)
ADD_DEFINITIONS(-DENABLE_SPOUT) ADD_DEFINITIONS(-DENABLE_SPOUT)
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") # 32bit build? IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") # 32bit build?
set(SPOUT_PATH_HINT ${CMAKE_SOURCE_DIR}/util/spout2/Win32/) SET(SPOUT_PATH_HINT ${CMAKE_SOURCE_DIR}/util/spout2/Win32/)
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") # 64bit build? ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") # 64bit build?
set(SPOUT_PATH_HINT ${CMAKE_SOURCE_DIR}/util/spout2/x64/) SET(SPOUT_PATH_HINT ${CMAKE_SOURCE_DIR}/util/spout2/x64/)
ENDIF() ENDIF()
# make sure the .lib file is used, otherwise MinGW will try the .dl # make sure the .lib file is used, otherwise MinGW will try the .dll d
l directly and fails to link irectly and fails to link
find_library(SPOUT_LIBRARY NAMES SpoutLibrary.lib SpoutLibrary PATH FIND_LIBRARY(SPOUT_LIBRARY NAMES SpoutLibrary.lib SpoutLibrary PATHS $
S ${SPOUT_PATH_HINT}) {SPOUT_PATH_HINT})
mark_as_advanced(SPOUT_LIBRARY) MARK_AS_ADVANCED(SPOUT_LIBRARY)
if(NOT SPOUT_LIBRARY) IF(NOT SPOUT_LIBRARY)
message(FATAL_ERROR "Spout library not found. Try setting SPOUT MESSAGE(FATAL_ERROR "Spout library not found. Try setting SPOUT_L
_LIBRARY or disable Spout support.") IBRARY or disable Spout support.")
endif() ENDIF()
# try to find the .dll for automatic copy # try to find the .dll for automatic copy
get_filename_component(SPOUT_LIBRARY_DIR ${SPOUT_LIBRARY} DIRECTORY GET_FILENAME_COMPONENT(SPOUT_LIBRARY_DIR ${SPOUT_LIBRARY} DIRECTORY)
) SET(SPOUT_LIBRARY_DLL ${SPOUT_LIBRARY_DIR}/SpoutLibrary.dll CACHE FILE
set(SPOUT_LIBRARY_DLL ${SPOUT_LIBRARY_DIR}/SpoutLibrary.dll CACHE F PATH "The path to the Spout .dll file")
ILEPATH "The path to the Spout .dll file") SET(SPOUT_LIBRARY_LICENCE ${CMAKE_SOURCE_DIR}/util/spout2/licence.txt
CACHE FILEPATH "The path to the Spout licence file")
if(NOT EXISTS ${SPOUT_LIBRARY_DLL})
unset(SPOUT_LIBRARY_DLL) IF(NOT EXISTS ${SPOUT_LIBRARY_DLL})
# try to find it with find_library (note that this does not wor UNSET(SPOUT_LIBRARY_DLL)
k with MSVC, but with MinGW it does, so the above manual version is necessa # try to find it with find_library (note that this does not work
ry) with MSVC, but with MinGW it does, so the above manual version is necessary
find_library(SPOUT_LIBRARY_DLL SpoutLibrary.dll PATHS ${SPOUT_P )
ATH_HINT}) FIND_LIBRARY(SPOUT_LIBRARY_DLL SpoutLibrary.dll PATHS ${SPOUT_PAT
endif() H_HINT})
ENDIF()
if(NOT SPOUT_LIBRARY_DLL)
message(WARNING "Could not find SpoutLibrary.dll, you may have IF(NOT SPOUT_LIBRARY_DLL)
to manually copy it to the binary directory.\ MESSAGE(WARNING "Could not find SpoutLibrary.dll, you may have to
Try setting SPOUT_LIBRARY_DLL. Note that this is necessary manually copy it to the binary directory.\
for correct installer generation.") Try setting SPOUT_LIBRARY_DLL. Note that this is
endif() necessary for correct installer generation.")
mark_as_advanced(SPOUT_LIBRARY_DLL) ENDIF()
MARK_AS_ADVANCED(SPOUT_LIBRARY_DLL)
ENDIF(ENABLE_SPOUT) ENDIF(ENABLE_SPOUT)
SET(ENABLE_SCRIPTING 1 CACHE BOOL "Define whether scripting features should be activated.") SET(ENABLE_SCRIPTING 1 CACHE BOOL "Define whether scripting features should be activated.")
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
# (De-)Activate the script edit console # (De-)Activate the script edit console
SET(ENABLE_SCRIPT_CONSOLE 1 CACHE BOOL "Define whether to build the sc ript console feature.") SET(ENABLE_SCRIPT_CONSOLE 1 CACHE BOOL "Define whether to build the sc ript console feature.")
IF(ENABLE_SCRIPT_CONSOLE) IF(ENABLE_SCRIPT_CONSOLE)
ADD_DEFINITIONS(-DENABLE_SCRIPT_CONSOLE) ADD_DEFINITIONS(-DENABLE_SCRIPT_CONSOLE)
ENDIF() ENDIF()
ELSE() ELSE()
skipping to change at line 275 skipping to change at line 297
#### demo plugins #### #### demo plugins ####
ADD_PLUGIN(HelloStelModule 0) ADD_PLUGIN(HelloStelModule 0)
ADD_PLUGIN(SimpleDrawLine 0) ADD_PLUGIN(SimpleDrawLine 0)
#### work plugins #### #### work plugins ####
ADD_PLUGIN(AngleMeasure 1) ADD_PLUGIN(AngleMeasure 1)
ADD_PLUGIN(ArchaeoLines 1) ADD_PLUGIN(ArchaeoLines 1)
ADD_PLUGIN(CompassMarks 1) ADD_PLUGIN(CompassMarks 1)
ADD_PLUGIN(Exoplanets 1) ADD_PLUGIN(Exoplanets 1)
ADD_PLUGIN(EquationOfTime 1) ADD_PLUGIN(EquationOfTime 1)
ADD_PLUGIN(FOV 1) ADD_PLUGIN(FOV 1)
# TODO: Logbook build is broken for quite some time
ADD_PLUGIN(LogBook 0) ADD_PLUGIN(LogBook 0)
ADD_PLUGIN(MeteorShowers 1) ADD_PLUGIN(MeteorShowers 1)
ADD_PLUGIN(NavStars 1) ADD_PLUGIN(NavStars 1)
ADD_PLUGIN(Novae 1) ADD_PLUGIN(Novae 1)
ADD_PLUGIN(Observability 1) ADD_PLUGIN(Observability 1)
ADD_PLUGIN(Oculars 1) ADD_PLUGIN(Oculars 1)
ADD_PLUGIN(PointerCoordinates 1) ADD_PLUGIN(PointerCoordinates 1)
ADD_PLUGIN(Pulsars 1) ADD_PLUGIN(Pulsars 1)
ADD_PLUGIN(Quasars 1) ADD_PLUGIN(Quasars 1)
# SOCIS 2015:
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
ADD_PLUGIN(RemoteControl 1) ADD_PLUGIN(RemoteControl 1)
ENDIF() ENDIF()
ADD_PLUGIN(RemoteSync 0) ADD_PLUGIN(RemoteSync 0)
ADD_PLUGIN(Satellites 1) ADD_PLUGIN(Satellites 1)
ADD_PLUGIN(Scenery3d 1) ADD_PLUGIN(Scenery3d 1)
ADD_PLUGIN(SolarSystemEditor 1) ADD_PLUGIN(SolarSystemEditor 1)
ADD_PLUGIN(Supernovae 1) ADD_PLUGIN(Supernovae 1)
ADD_PLUGIN(TextUserInterface 1) ADD_PLUGIN(TextUserInterface 1)
ADD_PLUGIN(TelescopeControl 1) ADD_PLUGIN(TelescopeControl 1)
skipping to change at line 318 skipping to change at line 340
FIND_PACKAGE(Qt5Core REQUIRED) FIND_PACKAGE(Qt5Core REQUIRED)
GET_TARGET_PROPERTY(QMAKE_LOCATION Qt5::qmake LOCATION) GET_TARGET_PROPERTY(QMAKE_LOCATION Qt5::qmake LOCATION)
IF(${Qt5Core_VERSION_STRING} VERSION_LESS MINIMAL_QT_VERSION) IF(${Qt5Core_VERSION_STRING} VERSION_LESS MINIMAL_QT_VERSION)
MESSAGE(FATAL_ERROR "Found Qt5: ${QMAKE_LOCATION} (found unsuitable ve rsion \"${Qt5Core_VERSION_STRING}\", required is \"${MINIMAL_QT_VERSION}\") ") MESSAGE(FATAL_ERROR "Found Qt5: ${QMAKE_LOCATION} (found unsuitable ve rsion \"${Qt5Core_VERSION_STRING}\", required is \"${MINIMAL_QT_VERSION}\") ")
ELSE() ELSE()
MESSAGE(STATUS "Found Qt5: ${QMAKE_LOCATION} (found suitable version \ "${Qt5Core_VERSION_STRING}\")") MESSAGE(STATUS "Found Qt5: ${QMAKE_LOCATION} (found suitable version \ "${Qt5Core_VERSION_STRING}\")")
ENDIF() ENDIF()
FIND_PACKAGE(Qt5Concurrent REQUIRED) FIND_PACKAGE(Qt5Concurrent REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED) FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED) FIND_PACKAGE(Qt5Network REQUIRED)
FIND_PACKAGE(Qt5OpenGL REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED) FIND_PACKAGE(Qt5Widgets REQUIRED)
# required for qcustomplot external dependency
# not used elsewhere
FIND_PACKAGE(Qt5PrintSupport REQUIRED) FIND_PACKAGE(Qt5PrintSupport REQUIRED)
IF(USE_PLUGIN_TELESCOPECONTROL) IF(USE_PLUGIN_TELESCOPECONTROL)
FIND_PACKAGE(Qt5SerialPort REQUIRED) FIND_PACKAGE(Qt5SerialPort REQUIRED)
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
FIND_PACKAGE(Qt5Sql REQUIRED) FIND_PACKAGE(Qt5Sql REQUIRED)
FIND_PACKAGE(Qt5XmlPatterns REQUIRED) FIND_PACKAGE(Qt5XmlPatterns REQUIRED)
# Try found OpenSSL DLL's on Windows
FIND_FILE(OPENSSL_SSLEAY32_LIBRARY_DLL ssleay32.dll)
FIND_FILE(OPENSSL_LIBEAY32_LIBRARY_DLL libeay32.dll)
FIND_FILE(OPENSSL_LIBSSL32_LIBRARY_DLL libssl32.dll)
FIND_FILE(OPENSSL_LICENSE "OpenSSL License.txt")
SET(ISS_OPENSSL_LIBS "; OpenSSL support")
IF(EXISTS ${OPENSSL_SSLEAY32_LIBRARY_DLL})
MESSAGE(STATUS "Found ssleay32 library: ${OPENSSL_SSLEAY32_LIBRAR
Y_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_SS
LEAY32_LIBRARY_DLL}\"; DestDir: \"{app}\";")
ENDIF()
IF(EXISTS ${OPENSSL_LIBEAY32_LIBRARY_DLL})
MESSAGE(STATUS "Found libeay32 library: ${OPENSSL_LIBEAY32_LIBRAR
Y_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_LI
BEAY32_LIBRARY_DLL}\"; DestDir: \"{app}\";")
ENDIF()
IF(EXISTS ${OPENSSL_LIBSSL32_LIBRARY_DLL})
MESSAGE(STATUS "Found libssl32 library: ${OPENSSL_LIBSSL32_LIBRAR
Y_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_LI
BSSL32_LIBRARY_DLL}\"; DestDir: \"{app}\";")
ENDIF()
IF(EXISTS ${OPENSSL_LICENSE})
MESSAGE(STATUS "Found OpenSSL license: ${OPENSSL_LICENSE}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_LI
CENSE}\"; DestDir: \"{app}\";")
ENDIF()
IF((NOT EXISTS ${OPENSSL_SSLEAY32_LIBRARY_DLL}) AND (NOT EXISTS ${OPEN
SSL_LIBEAY32_LIBRARY_DLL}))
SET(ISS_OPENSSL_LIBS "; OpenSSL libraries isn't found")
ENDIF()
ENDIF()
# when using Qt 5.3, default to using the old QGLWidget, but warn
IF(${Qt5Core_VERSION_STRING} VERSION_LESS "5.4")
SET(USE_OLD_QGLWIDGET 1)
MESSAGE(WARNING "You are using Qt ${Qt5Core_VERSION_STRING} to build,
falling back to legacy QGLWidget rendering. Consider using at least Qt 5.4
if possible.")
ELSE()
# offer the old widget as an alternative, default off
SET(USE_OLD_QGLWIDGET 0 CACHE BOOL "Use the legacy QGLWidget instead o
f the new QOpenGLWidget for the main viewport, and link to the QtOpenGL mod
ule")
ENDIF()
IF(USE_OLD_QGLWIDGET)
SET(USE_QTOPENGL 1)
ADD_DEFINITIONS(-DUSE_OLD_QGLWIDGET)
ENDIF()
# Since Qt 5.4, linking to OpenGL is basically not required anymore,
# because the QtGui module re-implements the GL functions, and perhaps even
# dispatches the calls to a dynamically selected GL library.
#
# The only exception where this does not work with CMake is for
# ES2-only/ANGLE-only builds, which are seemingly not included in
# official Qt downloads, but may be required as a custom build
# for some embedded systems. Interestingly, this works with qmake,
# but CMake needs an explicit link definition.
# See also this bug: https://bugreports.qt.io/browse/QTBUG-29132
# Check if we have a GLES-only build
# On dynamic builds, this property is also "GL"
IF(${Qt5Gui_OPENGL_IMPLEMENTATION} MATCHES "GLES")
MESSAGE(STATUS "Building an OpenGL ES build (${Qt5Gui_OPENGL_IMPLEMENT
ATION})")
SET(STEL_GLES_LIBS Qt5::Gui_EGL Qt5::Gui_GLESv2)
ENDIF() ENDIF()
# Tell CMake to run moc when necessary: # Tell CMake to run moc when necessary:
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
# As moc files are generated in the binary dir, tell CMake to always look f or includes there: # As moc files are generated in the binary dir, tell CMake to always look f or includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON) SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
SET(QT_USE_QTSCRIPT TRUE) FIND_PACKAGE(Qt5Script REQUIRED)
FIND_PACKAGE(Qt5Script REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Script_INCLUDE_DIRS})
ENDIF() ENDIF()
IF(ENABLE_MEDIA) IF(ENABLE_MEDIA)
ADD_DEFINITIONS(-DENABLE_MEDIA) SET(USE_QTOPENGL 1)
FIND_PACKAGE(Qt5Multimedia REQUIRED) ADD_DEFINITIONS(-DENABLE_MEDIA)
FIND_PACKAGE(Qt5MultimediaWidgets REQUIRED) FIND_PACKAGE(Qt5Multimedia REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Multimedia_INCLUDE_DIRS}) FIND_PACKAGE(Qt5MultimediaWidgets REQUIRED)
INCLUDE_DIRECTORIES(${Qt5MultimediaWidgets_INCLUDE_DIRS})
ENDIF()
# I add this test because on Windows with angle we should not link
# with OpenGL. Maybe there is a better way to do that.
IF("${Qt5Gui_OPENGL_LIBRARIES}" MATCHES "opengl")
FIND_PACKAGE(OpenGL REQUIRED)
ENDIF() ENDIF()
IF(NOT WIN32)
FIND_PACKAGE(ZLIB) IF(USE_QTOPENGL)
ELSE() # QtOpenGL module is deprecated. After merging the QOpenGLWidget branc
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/external/zlib) h, we don't use this module directly anymore,
# but the QtMultimediaWidgets module requires it internally, so we sti
ll have to package it.
FIND_PACKAGE(Qt5OpenGL REQUIRED)
ENDIF() ENDIF()
FIND_PACKAGE(Qt5Test) FIND_PACKAGE(Qt5Test)
INCLUDE_DIRECTORIES(${Qt5Test_INCLUDE_DIRS})
### Setup external packages
FIND_PACKAGE(ZLIB QUIET) #quiet warnings about not found, we have our own v
ersion anyway
# if a system zlib is found, let the user choose if to instead use our bund
led version
IF(ZLIB_FOUND)
IF(WIN32) #on win, we default to "no"
SET(USE_SYSTEM_ZLIB 0 CACHE BOOL "Use system-provided zlib instea
d of the bundled version")
ELSE() #else, we default to "yes"
SET(USE_SYSTEM_ZLIB 1 CACHE BOOL "Use system-provided zlib instea
d of the bundled version")
ENDIF()
ELSE()
SET(USE_SYSTEM_ZLIB 0)
ENDIF()
IF(NOT USE_SYSTEM_ZLIB)
#use our own zlib
MESSAGE(STATUS "Using bundled zlib version at ${CMAKE_SOURCE_DIR}/src/
external/zlib")
SET(ZLIB_LIBRARIES zlib_stel)
ELSE()
MESSAGE(STATUS "Using system-provided zlib at ${ZLIB_LIBRARIES}")
ENDIF()
########### Set some global variables ########### ########### Set some global variables ###########
IF(UNIX AND NOT WIN32) IF(UNIX AND NOT WIN32)
IF(APPLE) IF(APPLE)
SET(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/Stellarium.app/Cont SET(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/Stellarium.app/Co
ents") ntents")
ELSE() ELSE()
ADD_DEFINITIONS(-DINSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share/st ADD_DEFINITIONS(-DINSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share/
ellarium") stellarium")
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/ ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="${CMAKE_INSTALL_PREFIX}/shar
locale") e/locale")
# Used in generating the documentation (doc/stellarium.pod.cmake): # Used in generating the documentation (doc/stellarium.pod.cmake)
SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/stellarium") :
ENDIF() SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/stellarium")
ENDIF()
ELSE() ELSE()
ADD_DEFINITIONS(-DINSTALL_DATADIR=".") ADD_DEFINITIONS(-DINSTALL_DATADIR=".")
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="./locale") ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="./locale")
ENDIF() ENDIF()
# For not installed debug builds with build directory path that not match s ources directory path ${PROJECT_BINARY_DIR} != ${CMAKE_SOURCE_DIR} # For not installed debug builds with build directory path that not match s ources directory path ${PROJECT_BINARY_DIR} != ${CMAKE_SOURCE_DIR}
if(CMAKE_BUILD_TYPE STREQUAL "Debug") IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-DINSTALL_DATADIR_FOR_DEBUG="${CMAKE_SOURCE_DIR}") ADD_DEFINITIONS(-DINSTALL_DATADIR_FOR_DEBUG="${CMAKE_SOURCE_DIR}")
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR_FOR_DEBUG="${CMAKE_SOURCE_DIR}") ADD_DEFINITIONS(-DINSTALL_LOCALEDIR_FOR_DEBUG="${CMAKE_SOURCE_DIR}")
endif() ENDIF()
########### Get revision number for non-release builds ########### ########### Get revision number for non-release builds ###########
IF(NOT STELLARIUM_RELEASE_BUILD) IF(NOT STELLARIUM_RELEASE_BUILD)
# Hack until CMake detection for Bazaar is finished # Hack until CMake detection for Bazaar is finished
EXECUTE_PROCESS(COMMAND bzr revno --tree WORKING_DIRECTORY ${CMAKE_CURR EXECUTE_PROCESS(COMMAND bzr revno --tree WORKING_DIRECTORY ${CMAKE_CUR
ENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABLE BZR_REVISION OUTPUT_STRIP_TRAILI RENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABLE BZR_REVISION OUTPUT_STRIP_TRAIL
NG_WHITESPACE ERROR_VARIABLE BZR_ERROR) ING_WHITESPACE ERROR_VARIABLE BZR_ERROR)
EXECUTE_PROCESS(COMMAND bzr version-info --custom --template={branch_ni EXECUTE_PROCESS(COMMAND bzr version-info --custom --template={branch_n
ck} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABL ick} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIAB
E BZR_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE BZR_ERROR) LE BZR_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE BZR_ERROR)
IF(BZR_REVISION) IF(BZR_REVISION)
SET(PACKAGE_VERSION "${VERSION}.${BZR_REVISION}") SET(PACKAGE_VERSION "${VERSION}.${BZR_REVISION}")
ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}") ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}")
ADD_DEFINITIONS(-DBZR_BRANCH="${BZR_BRANCH}") ADD_DEFINITIONS(-DBZR_BRANCH="${BZR_BRANCH}")
ENDIF() ENDIF()
# MESSAGE(STATUS "Branch: ${BZR_BRANCH}; Revision: ${BZR_REVISION}; Err # MESSAGE(STATUS "Branch: ${BZR_BRANCH}; Revision: ${BZR_REVISION}; Er
or: ${BZR_ERROR}") ror: ${BZR_ERROR}")
IF(STELLARIUM_VERSION) IF(STELLARIUM_VERSION)
SET(PACKAGE_VERSION "${STELLARIUM_VERSION}") SET(PACKAGE_VERSION "${STELLARIUM_VERSION}")
ADD_DEFINITIONS(-DSTELLARIUM_VERSION="${STELLARIUM_VERSION}") ADD_DEFINITIONS(-DSTELLARIUM_VERSION="${STELLARIUM_VERSION}")
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
####################################################### #######################################################
### Generate icon file name ### ### Generate icon file name ###
####################################################### #######################################################
IF(STELLARIUM_RELEASE_BUILD) IF(STELLARIUM_RELEASE_BUILD)
SET(PACKAGE_ICON "stellarium") SET(PACKAGE_ICON "stellarium")
ELSE() ELSE()
SET(PACKAGE_ICON "stellarium-gray") SET(PACKAGE_ICON "stellarium-gray")
ENDIF() ENDIF()
####################################################### #######################################################
### Generate a VersionInfo file ### ### Generate a VersionInfo file ###
####################################################### #######################################################
IF(STELLARIUM_RELEASE_BUILD) IF(STELLARIUM_RELEASE_BUILD)
SET(PACKAGE_VERSION_RC "${PACKAGE_VERSION},0") SET(PACKAGE_VERSION_RC "${PACKAGE_VERSION},0")
ELSE() ELSE()
SET(PACKAGE_VERSION_RC "${PACKAGE_VERSION}") SET(PACKAGE_VERSION_RC "${PACKAGE_VERSION}")
ENDIF() ENDIF()
STRING(REGEX REPLACE "([.]+)" "," PACKAGE_VERSION_RC ${PACKAGE_VERSION_ STRING(REGEX REPLACE "([.]+)" "," PACKAGE_VERSION_RC ${PACKAGE_VERSION
RC}) _RC})
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/stellarium.rc.cmake ${CMAKE_CU CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/stellarium.rc.cmake ${CMAKE_C
RRENT_BINARY_DIR}/stellarium.rc @ONLY) URRENT_BINARY_DIR}/stellarium.rc @ONLY)
####################################################### #######################################################
### [Optional] Embed icon in the Windows executable ### ### [Optional] Embed icon in the Windows executable ###
####################################################### #######################################################
SET(ENABLE_WINDOWS_EXE_ICON 1 CACHE BOOL "Determine if it should try to SET(ENABLE_WINDOWS_EXE_ICON 1 CACHE BOOL "Determine if it should try t
embed the Stellarium icon in the Windows .exe file") o embed the Stellarium icon in the Windows .exe file")
IF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH) IF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH)
IF(NOT MSVC) IF(NOT MSVC)
#The mingGW snapshot distributed with the Qt SDK has it under t #The mingGW snapshot distributed with the Qt SDK has it unde
his name. r this name.
SET(RC_COMPILER_FILENAME "windres.exe") SET(RC_COMPILER_FILENAME "windres.exe")
FIND_FILE(RC_COMPILER_PATH ${RC_COMPILER_FILENAME}) FIND_FILE(RC_COMPILER_PATH ${RC_COMPILER_FILENAME})
ENDIF() ENDIF()
IF(RC_COMPILER_PATH) IF(RC_COMPILER_PATH)
MESSAGE(STATUS "Found .rc compiler: ${RC_COMPILER_PATH}") MESSAGE(STATUS "Found .rc compiler: ${RC_COMPILER_PATH}")
ENDIF(RC_COMPILER_PATH) ENDIF(RC_COMPILER_PATH)
ENDIF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH) ENDIF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH)
####################################################### #######################################################
### Generate an Inno Setup project file ### ### Generate an Inno Setup project file ###
####################################################### #######################################################
# Try to guess the MinGW /bin directory... # Try to guess the MinGW /bin directory...
GET_FILENAME_COMPONENT(MINGW_BIN_DIRECTORY ${CMAKE_CXX_COMPILER} PATH) GET_FILENAME_COMPONENT(MINGW_BIN_DIRECTORY ${CMAKE_CXX_COMPILER} PATH)
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
SET(ISS_ARCHITECTURE_SPECIFIC ";In the 64-bit only version, this li SET(ISS_ARCHITECTURE_SPECIFIC ";In the 64-bit only version, this
ne switches the installer to 64-bit mode.") line switches the installer to 64-bit mode.")
SET(ISS_PACKAGE_PLATFORM "win32") SET(ISS_PACKAGE_PLATFORM "win32")
# TODO: Add selector for VC2013/VC2015 # TODO: Add selector for VC2013/VC2015
SET(REDIST_VERSION "VC_REDIST_X86") SET(REDIST_VERSION "VC_REDIST_X86")
IF(MSVC) IF(MSVC)
SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredist/v SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredis
credist_x86.exe\"; DestDir: \"{tmp}\";") t/vcredist_x86.exe\"; DestDir: \"{tmp}\";")
SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x86.exe\"; Parameter SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x86.exe\"; Parame
s: \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg: \" ters: \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg:
{cm:RedistRun}\"; Check: VCRedistNeedsInstall") \"{cm:RedistRun}\"; Check: VCRedistNeedsInstall")
ELSE() ELSE()
SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++*.d SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++
ll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_dw2-1. *.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_dw2
dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthread* -1.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthre
.dll\"; DestDir: \"{app}\";") ad*.dll\"; DestDir: \"{app}\";")
SET(REDIST_RUN "; Redistributable package not required for MinG SET(REDIST_RUN "; Redistributable package not required for M
W") inGW")
ENDIF() ENDIF()
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on win6 SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on wi
4:\nArchitecturesAllowed=x64\n;Switch to 64-bit install mode:\nArchitecture n64:\nArchitecturesAllowed=x64\n;Switch to 64-bit install mode:\nArchitectu
sInstallIn64BitMode=x64") resInstallIn64BitMode=x64")
SET(ISS_PACKAGE_PLATFORM "win64") SET(ISS_PACKAGE_PLATFORM "win64")
# TODO: Add selector for VC2013/VC2015 # TODO: Add selector for VC2013/VC2015
SET(REDIST_VERSION "VC_REDIST_X64") SET(REDIST_VERSION "VC_REDIST_X64")
IF(MSVC) IF(MSVC)
SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredist/v SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredis
credist_x64.exe\"; DestDir: \"{tmp}\";") t/vcredist_x64.exe\"; DestDir: \"{tmp}\";")
SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x64.exe\"; Parameter SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x64.exe\"; Parame
s: \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg: \" ters: \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg:
{cm:RedistRun}\"; Check: VCRedistNeedsInstall") \"{cm:RedistRun}\"; Check: VCRedistNeedsInstall")
ELSE() ELSE()
SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++*.d SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++
ll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthread*. *.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthrea
dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_sjlj* d*.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_sj
.dll\"; DestDir: \"{app}\";") lj*.dll\"; DestDir: \"{app}\";")
SET(REDIST_RUN "; Redistributable package not required for MinG SET(REDIST_RUN "; Redistributable package not required for M
W") inGW")
ENDIF() ENDIF()
ENDIF() ENDIF()
SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been autom SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been auto
atically generated by CMake. Your changes will be lost the next time CMake matically generated by CMake. Your changes will be lost the next time CMake
is run.") is run.")
IF(GENERATE_STELMAINLIB) GET_TARGET_PROPERTY(QtConcurrent_location Qt5::Concurrent LOCATION)
SET(STELMAINLIB "Source: \"${CMAKE_INSTALL_PREFIX}/lib/libstelMain. GET_TARGET_PROPERTY(QtCore_location Qt5::Core LOCATION)
dll\"; DestDir: \"{app}\";") GET_TARGET_PROPERTY(QtGui_location Qt5::Gui LOCATION)
SET(MESALIB "; MESA libraries isn't used") IF(USE_QTOPENGL)
ELSE() GET_TARGET_PROPERTY(QtOpenGL_location Qt5::OpenGL LOCATION)
SET(STELMAINLIB "; StelMainLib isn't used") SET(ISS_QT_OPENGL "Source: \"${QtOpenGL_location}\"; DestDir: \"{
SET(MESALIB "Source: \"${CMAKE_SOURCE_DIR}/util/MESA/opengl32sw.dll app}\";")
\"; DestDir: \"{app}\";") ELSE()
ENDIF() SET(ISS_QT_OPENGL "; QtOpenGL isn't used")
GET_TARGET_PROPERTY(QtConcurrent_location Qt5::Concurrent LOCATION) ENDIF()
GET_TARGET_PROPERTY(QtCore_location Qt5::Core LOCATION) GET_TARGET_PROPERTY(QtNetwork_location Qt5::Network LOCATION)
GET_TARGET_PROPERTY(QtGui_location Qt5::Gui LOCATION) GET_TARGET_PROPERTY(QtWidgets_location Qt5::Widgets LOCATION)
GET_TARGET_PROPERTY(QtOpenGL_location Qt5::OpenGL LOCATION) GET_TARGET_PROPERTY(QtSql_location Qt5::Sql LOCATION)
GET_TARGET_PROPERTY(QtNetwork_location Qt5::Network LOCATION) GET_TARGET_PROPERTY(QtXmlPatterns_location Qt5::XmlPatterns LOCATION)
GET_TARGET_PROPERTY(QtWidgets_location Qt5::Widgets LOCATION) GET_TARGET_PROPERTY(QtPrintSupport_location Qt5::PrintSupport LOCATION
GET_TARGET_PROPERTY(QtSql_location Qt5::Sql LOCATION) )
GET_TARGET_PROPERTY(QtXmlPatterns_location Qt5::XmlPatterns LOCATION) SET(ISS_QT_PRINTSUPPORT "Source: \"${QtPrintSupport_location}\"; DestD
GET_TARGET_PROPERTY(QtPrintSupport_location Qt5::PrintSupport LOCATION) ir: \"{app}\";")
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
GET_TARGET_PROPERTY(QtScript_location Qt5::Script LOCATION) GET_TARGET_PROPERTY(QtScript_location Qt5::Script LOCATION)
SET(ISS_QT_SCRIPT "Source: \"${QtScript_location}\"; DestDir: \"{ap SET(ISS_QT_SCRIPT "Source: \"${QtScript_location}\"; DestDir: \"{
p}\";") app}\";")
ELSE() ELSE()
SET(ISS_QT_SCRIPT "; QtScript isn't used") SET(ISS_QT_SCRIPT "; QtScript isn't used")
ENDIF() ENDIF()
IF(USE_PLUGIN_TELESCOPECONTROL) IF(USE_PLUGIN_TELESCOPECONTROL)
GET_TARGET_PROPERTY(QtSerialPort_location Qt5::SerialPort LOCATION) GET_TARGET_PROPERTY(QtSerialPort_location Qt5::SerialPort LOCATIO
SET(ISS_QT_SERIALPORT "Source: \"${QtSerialPort_location}\"; DestDi N)
r: \"{app}\";") SET(ISS_QT_SERIALPORT "Source: \"${QtSerialPort_location}\"; Dest
ELSE() Dir: \"{app}\";")
SET(ISS_QT_SERIALPORT "; QtSerialPort isn't used") ELSE()
ENDIF() SET(ISS_QT_SERIALPORT "; QtSerialPort isn't used")
IF(ENABLE_MEDIA) ENDIF()
GET_TARGET_PROPERTY(QtMultimedia_location Qt5::Multimedia LOCATION) IF(ENABLE_MEDIA)
GET_TARGET_PROPERTY(QtMultimediaWidgets_location Qt5::MultimediaWid GET_TARGET_PROPERTY(QtMultimedia_location Qt5::Multimedia LOCATIO
gets LOCATION) N)
SET(ISS_QT_MULTIMEDIA "Source: \"${QtMultimedia_location}\"; DestDi GET_TARGET_PROPERTY(QtMultimediaWidgets_location Qt5::MultimediaW
r: \"{app}\";\nSource: \"${QtMultimediaWidgets_location}\"; DestDir: \"{app idgets LOCATION)
}\";") SET(ISS_QT_MULTIMEDIA "Source: \"${QtMultimedia_location}\"; Dest
ELSE() Dir: \"{app}\";\nSource: \"${QtMultimediaWidgets_location}\"; DestDir: \"{a
SET(ISS_QT_MULTIMEDIA "; QtMultimedia isn't used") pp}\";")
ENDIF() ELSE()
GET_FILENAME_COMPONENT(QT5_LIBS ${QtCore_location} PATH) SET(ISS_QT_MULTIMEDIA "; QtMultimedia isn't used")
IF(MSVC) ENDIF()
# Use installer for checking minimum requirements GET_FILENAME_COMPONENT(QT5_LIBS ${QtCore_location} PATH)
# Stellarium/MSVC require Windows Vista (6.0) for work IF(GENERATE_STELMAINLIB)
# Details: http://www.jrsoftware.org/ishelp/index.php?topic=winvern SET(STELMAINLIB "Source: \"${CMAKE_INSTALL_PREFIX}/lib/libstelMai
otes n.dll\"; DestDir: \"{app}\";")
SET(MIN_VERSION "6.0") ELSE()
SET(ISS_ANGLE_LIBS "; ANGLE support (libEGL.dll, libGLESv2.dll and SET(STELMAINLIB "; StelMainLib isn't used")
d3dcompiler_*.dll)\nSource: \"${QT5_LIBS}/libEGL.dll\"; DestDir: \"{app}\"; ENDIF()
\nSource: \"${QT5_LIBS}/libGLESv2.dll\"; DestDir: \"{app}\";\nSource: \"${Q SET(MESALIB "Source: \"${QT5_LIBS}/opengl32sw.dll\"; DestDir: \"{app}\
T5_LIBS}/d3dcompiler_*.dll\"; DestDir: \"{app}\";") ";")
ELSE() IF(MSVC)
# Use installer for checking minimum requirements # Use installer for checking minimum requirements
# Stellarium/MinGW require Windows XP (5.1) for work # Stellarium/MSVC require Windows Vista (6.0) for work
# Details: http://www.jrsoftware.org/ishelp/index.php?topic=winvern # Details: http://www.jrsoftware.org/ishelp/index.php?topic=winve
otes rnotes
SET(MIN_VERSION "5.1") SET(MIN_VERSION "6.0")
SET(ISS_ANGLE_LIBS "; ANGLE support doesn't exists for MinGW") SET(ISS_ANGLE_LIBS "; ANGLE support (libEGL.dll, libGLESv2.dll an
ENDIF() d d3dcompiler_*.dll)\nSource: \"${QT5_LIBS}/libEGL.dll\"; DestDir: \"{app}\
SET(ISS_ICU_LIBS "; ICU support\nSource: \"${QT5_LIBS}/icu*.dll\"; Dest ";\nSource: \"${QT5_LIBS}/libGLESv2.dll\"; DestDir: \"{app}\";\nSource: \"$
Dir: \"{app}\";") {QT5_LIBS}/d3dcompiler_*.dll\"; DestDir: \"{app}\";")
# Deploy related stuff ELSE()
SET(ISS_QT_PLUGINS "; Qt plugins") # Use installer for checking minimum requirements
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugins # Stellarium/MinGW require Windows XP (5.1) for work
/platforms/qwindows.dll\"; DestDir: \"{app}/platforms/\";") # Details: http://www.jrsoftware.org/ishelp/index.php?topic=winve
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugins rnotes
/imageformats/qico.dll\"; DestDir: \"{app}/imageformats/\";") SET(MIN_VERSION "5.1")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugins SET(ISS_ANGLE_LIBS "; ANGLE support doesn't exists for MinGW")
/imageformats/qjpeg.dll\"; DestDir: \"{app}/imageformats/\";") ENDIF()
IF(ENABLE_MEDIA) SET(ISS_ICU_LIBS "; ICU support\nSource: \"${QT5_LIBS}/icu*.dll\"; Des
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plug tDir: \"{app}\";")
ins/mediaservice/dsengine.dll\"; DestDir: \"{app}/mediaservice/\";\nSource: # Deploy related stuff
\"${QT5_LIBS}/../plugins/mediaservice/qtmedia_audioengine.dll\"; DestDir: SET(ISS_QT_PLUGINS "; Qt plugins")
\"{app}/mediaservice/\";\nSource: \"${QT5_LIBS}/../plugins/playlistformats/ SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
qtmultimedia_m3u.dll\"; DestDir: \"{app}/playlistformats/\";") s/audio/qtaudio_windows.dll\"; DestDir: \"{app}/audio/\";")
ENDIF() SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
IF(ENABLE_SPOUT) s/bearer/qgenericbearer.dll\"; DestDir: \"{app}/bearer/\";")
IF(SPOUT_LIBRARY_DLL) # we know the dll SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${SPOUT_LIBRAR s/bearer/qnativewifibearer.dll\"; DestDir: \"{app}/bearer/\";")
Y_DLL}\"; DestDir: \"{app}\";") SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
ENDIF() s/platforms/qwindows.dll\"; DestDir: \"{app}/platforms/\";")
ENDIF(ENABLE_SPOUT) SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
s/imageformats/qico.dll\"; DestDir: \"{app}/imageformats/\";")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
s/imageformats/qjpeg.dll\"; DestDir: \"{app}/imageformats/\";")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
s/imageformats/qgif.dll\"; DestDir: \"{app}/imageformats/\";")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
s/imageformats/qwbmp.dll\"; DestDir: \"{app}/imageformats/\";")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../plugin
s/imageformats/qwebp.dll\"; DestDir: \"{app}/imageformats/\";")
IF(ENABLE_MEDIA)
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${QT5_LIBS}/../p
lugins/mediaservice/dsengine.dll\"; DestDir: \"{app}/mediaservice/\";\nSour
ce: \"${QT5_LIBS}/../plugins/mediaservice/qtmedia_audioengine.dll\"; DestDi
r: \"{app}/mediaservice/\";\nSource: \"${QT5_LIBS}/../plugins/playlistforma
ts/qtmultimedia_m3u.dll\"; DestDir: \"{app}/playlistformats/\";")
ENDIF()
IF(ENABLE_SPOUT)
IF(SPOUT_LIBRARY_DLL) # we know the dll
MESSAGE(STATUS "Found Spout library: ${SPOUT_LIBRARY_DLL}")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${SPOUT_LIB
RARY_DLL}\"; DestDir: \"{app}\";")
SET(ISS_QT_PLUGINS "${ISS_QT_PLUGINS}\nSource: \"${SPOUT_LIB
RARY_LICENCE}\"; DestDir: \"{app}\"; DestName: \"Spout_licence.txt\";")
ENDIF()
SET(ISS_SPOUT "Name: \"{group}\\Stellarium {cm:SpoutMode}\"; File
name: \"{app}\\stellarium.exe\"; Parameters: \"--spout=sky\"; WorkingDir: \
"{app}\"; IconFilename: \"{app}\\data\\stellarium.ico\"\n")
ELSE()
SET(ISS_SPOUT "; Spout support is disabled")
ENDIF(ENABLE_SPOUT)
ENDIF(WIN32) ENDIF(WIN32)
IF(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWit hDebInfo") IF(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWit hDebInfo")
ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DNDEBUG) ADD_DEFINITIONS(-DNDEBUG)
ENDIF() ENDIF()
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/default_config.ini.cmake ${CMAKE_S OURCE_DIR}/data/default_config.ini @ONLY) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/default_config.ini.cmake ${CMAKE_S OURCE_DIR}/data/default_config.ini @ONLY)
########### uninstall files ############### ########### uninstall files ###############
CONFIGURE_FILE( CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmak e") "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cma ke")
########### Packaging info for CPack ########### ########### Packaging info for CPack ###########
IF(GENERATE_PACKAGE_TARGET) IF(GENERATE_PACKAGE_TARGET)
INCLUDE(InstallRequiredSystemLibraries) INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Stellarium is a free open source SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Stellarium is a free open sourc
planetarium for your computer. It shows a realistic sky in 3D, just like w e planetarium for your computer. It shows a realistic sky in 3D, just like
hat you see with the naked eye, binoculars or a telescope.") what you see with the naked eye, binoculars or a telescope.")
SET(CPACK_PACKAGE_VENDOR "Stellarium's team") SET(CPACK_PACKAGE_VENDOR "Stellarium's team")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README" SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README
) ")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR "${STELLARIUM_MAJOR}") SET(CPACK_PACKAGE_VERSION_MAJOR "${STELLARIUM_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${STELLARIUM_MINOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${STELLARIUM_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${STELLARIUM_PATCH}") SET(CPACK_PACKAGE_VERSION_PATCH "${STELLARIUM_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "stellarium") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "stellarium")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "stellarium-${VERSION}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "stellarium-${PACKAGE_VERSION}")
SET(CPACK_SOURCE_GENERATOR "TGZ") SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_GENERATOR "TGZ") SET(CPACK_GENERATOR "TGZ")
SET(CPACK_STRIP_FILES "bin/stellarium") SET(CPACK_STRIP_FILES "bin/stellarium")
SET(CPACK_PACKAGE_EXECUTABLES "stellarium" "Stellarium") SET(CPACK_PACKAGE_EXECUTABLES "stellarium" "Stellarium")
SET(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/.svn/" "/.git/" "/.bzr/" "guide SET(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/.svn/" "/.git/" "/.bzr/" "buil
/" "builds/" "installers/" "Stellarium.tag$" "Stellarium.kdevelop.pcs$" "/C ds/" "installers/" "util/spout2" "util/DSSToStellarium/toastForShape$" "Ste
MakeLists.txt.user$" "\\\\.bzrignore$" "\\\\.yml$" "~$" "\\\\.swp$" "\\\\.# llarium.tag$" "Stellarium.kdevelop.pcs$" "/CMakeLists.txt.user$" "\\\\.bzri
" "/#") gnore$" "\\\\.yml$" "~$" "\\\\.swp$" "\\\\.#" "/#")
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2+") SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2+")
SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics") SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
SET(CPACK_RPM_PACKAGE_URL "http://stellarium.org/") SET(CPACK_RPM_PACKAGE_URL "http://stellarium.org/")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <stellariu SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <stellari
m-pubdevel@lists.sourceforge.net>") um-pubdevel@lists.sourceforge.net>")
SET(CPACK_DEBIAN_PACKAGE_SECTION "science") SET(CPACK_DEBIAN_PACKAGE_SECTION "science")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION}+deb1") SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION}+deb1")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}") SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
INCLUDE(CPack) INCLUDE(CPack)
ENDIF() ENDIF()
########### OS X Bundling ############### ########### OS X Bundling ###############
IF(APPLE) IF(APPLE)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/Info.plist.cmake ${CMAKE_SOURC E_DIR}/data/Info.plist @ONLY) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/Info.plist.cmake ${CMAKE_SOUR CE_DIR}/data/Info.plist @ONLY)
# ${Qt5Core_INCLUDE_DIRS} is a list; I'm expecting the first entry to a # ${Qt5Core_INCLUDE_DIRS} is a list; I'm expecting the first entry to
lways be QtCore.framework. always be QtCore.framework.
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
mac_app mac_app
python util/mac_app.py ${CMAKE_INSTALL_PREFIX} ${PROJECT_SOURCE_DIR python util/mac_app.py ${CMAKE_INSTALL_PREFIX} ${PROJECT_SOURCE_D
} ${CMAKE_BUILD_TYPE} ${Qt5Core_INCLUDE_DIRS} IR} ${CMAKE_BUILD_TYPE} ${Qt5Core_INCLUDE_DIRS}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Stellarium.app DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Stellarium.app
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "making the macosx bundle." COMMENT "making the macosx bundle."
VERBATIM VERBATIM
) )
ENDIF() ENDIF()
########### Windows packaging ############### ########### Windows packaging ###############
IF(WIN32) IF(WIN32)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/stellarium.iss.cmake ${CMAKE CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/stellarium.iss.cmake ${CMAK
_CURRENT_BINARY_DIR}/stellarium.iss @ONLY) E_CURRENT_BINARY_DIR}/stellarium.iss @ONLY)
SET(ISS_COMPILER_FILENAME "ISCC.exe") SET(ISS_COMPILER_FILENAME "ISCC.exe")
FIND_FILE(ISS_COMPILER_PATH ${ISS_COMPILER_FILENAME}) FIND_FILE(ISS_COMPILER_PATH ${ISS_COMPILER_FILENAME})
IF(ISS_COMPILER_PATH) IF(ISS_COMPILER_PATH)
MESSAGE(STATUS "Found Inno Setup (.iss) compiler: ${ISS_COMPILER_PA MESSAGE(STATUS "Found Inno Setup (.iss) compiler: ${ISS_COMPILER_
TH}") PATH}")
# Add installer target # Add installer target
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
stellarium-installer stellarium-installer
COMMAND ${ISS_COMPILER_PATH} "${CMAKE_CURRENT_BINARY_DIR}/st ellarium.iss" COMMAND ${ISS_COMPILER_PATH} "${CMAKE_CURRENT_BINARY_DIR}/st ellarium.iss"
COMMENT "Making an installer package for Windows..." COMMENT "Making an installer package for Windows..."
VERBATIM VERBATIM
) )
ELSE() ELSE()
MESSAGE(WARNING "Inno Setup Compiler not found. You won't be able t MESSAGE(WARNING "Inno Setup Compiler not found. You won't be able
o build setup files.") to build setup files.")
ENDIF() ENDIF()
ENDIF() ENDIF()
########### Generate doxygen doc ############### ########### Generate doxygen doc ###############
FIND_PACKAGE(Doxygen) FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND) IF(DOXYGEN_FOUND)
IF(DOXYGEN_DOT_FOUND) IF(DOXYGEN_DOT_FOUND)
SET(HAVE_DOT "YES") SET(HAVE_DOT "YES")
SET(DOT_PATH ${DOXYGEN_DOT_PATH}) SET(DOT_PATH ${DOXYGEN_DOT_PATH})
ELSE() ELSE()
SET(HAVE_DOT "NO") SET(HAVE_DOT "NO")
SET(DOT_PATH "") SET(DOT_PATH "")
ENDIF() ENDIF()
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/Doxyfile.cmake ${CMAKE_CURRE CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/Doxyfile.cmake ${CMAKE_CURR
NT_BINARY_DIR}/Doxyfile @ONLY) ENT_BINARY_DIR}/Doxyfile @ONLY)
ADD_CUSTOM_TARGET(apidoc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_D ADD_CUSTOM_TARGET(apidoc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_
IR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generat DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Genera
e the doxygen documentation into the doc directory.") te the doxygen documentation into the doc directory.")
ENDIF() ENDIF()
##################### Generate translation copying script ################# ##### ##################### Generate translation copying script ################# #####
IF(WIN32) IF(WIN32)
STRING(REPLACE "/" "\\" PROJECT_SOURCE_DIR_WINPATH ${PROJECT_SOURCE_DIR STRING(REPLACE "/" "\\" PROJECT_SOURCE_DIR_WINPATH ${PROJECT_SOURCE_DI
}) R})
STRING(REPLACE "/" "\\" PROJECT_BINARY_DIR_WINPATH ${PROJECT_BINARY_DIR STRING(REPLACE "/" "\\" PROJECT_BINARY_DIR_WINPATH ${PROJECT_BINARY_DI
}) R})
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/copy-translations.bat.cmake CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/copy-translations.bat.cmake
${PROJECT_SOURCE_DIR}/util/copy-translations.bat @ONLY NEWLINE_STYLE WIN32) ${PROJECT_SOURCE_DIR}/util/copy-translations.bat @ONLY NEWLINE_STYLE WIN32
)
ENDIF() ENDIF()
########### Top level include directories ########### ########### Top level include directories ###########
# This will be used for all compilations in sub-directories # This will be used for all compilations in sub-directories
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/modules ${CMAKE_SOURCE_DIR}/src/core/modules
${CMAKE_SOURCE_DIR}/src/core/planetsephems ${CMAKE_SOURCE_DIR}/src/core/planetsephems
${CMAKE_SOURCE_DIR}/src/core/external ${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/core/external/qtcompress ${CMAKE_SOURCE_DIR}/src/scripting
${CMAKE_SOURCE_DIR}/src/core/external/qcustomplot ${INTL_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/ ${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/libtess
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/scripting
${INTL_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/src
${ZLIB_INCLUDE_DIR}
) )
########### Subdirectories ############### ########### Subdirectories ###############
ADD_SUBDIRECTORY( data ) ADD_SUBDIRECTORY( data )
ADD_SUBDIRECTORY( src ) ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( textures ) ADD_SUBDIRECTORY( textures )
ADD_SUBDIRECTORY( doc ) ADD_SUBDIRECTORY( doc )
IF(ENABLE_NLS) IF(ENABLE_NLS)
ADD_SUBDIRECTORY( po ) ADD_SUBDIRECTORY( po )
ENDIF() ENDIF()
ADD_SUBDIRECTORY( landscapes ) ADD_SUBDIRECTORY( landscapes )
ADD_SUBDIRECTORY( skycultures ) ADD_SUBDIRECTORY( skycultures )
ADD_SUBDIRECTORY( nebulae ) ADD_SUBDIRECTORY( nebulae )
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
ADD_SUBDIRECTORY( scripts ) ADD_SUBDIRECTORY( scripts )
ENDIF() ENDIF()
IF(USE_PLUGIN_SCENERY3D) IF(USE_PLUGIN_SCENERY3D)
# add scenery3d scenes # add scenery3d scenes
ADD_SUBDIRECTORY( scenery3d ) ADD_SUBDIRECTORY( scenery3d )
ENDIF() ENDIF()
ADD_SUBDIRECTORY( stars ) ADD_SUBDIRECTORY( stars )
ADD_SUBDIRECTORY( plugins ) ADD_SUBDIRECTORY( plugins )
 End of changes. 52 change blocks. 
407 lines changed or deleted 553 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/