CMakeLists.txt   CMakeLists.txt 
# Minimal version of cmake for using with Qt5 is 2.8.9 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
# Avoid repeating the IF statement in the ENDIF and ELSE
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF()
########### Project name ########### ########### Project name ###########
PROJECT(Stellarium) PROJECT(Stellarium)
SET(STELLARIUM_MAJOR "0") SET(STELLARIUM_MAJOR "0")
SET(STELLARIUM_MINOR "12") SET(STELLARIUM_MINOR "13")
SET(STELLARIUM_PATCH "4") SET(STELLARIUM_PATCH "0")
SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}") SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")
SET(PACKAGE stellarium) SET(PACKAGE stellarium)
SET(PACKAGE_VERSION "${VERSION}") SET(PACKAGE_VERSION "${VERSION}")
ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}") ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
SET(MINIMAL_QT_VERSION "5.1.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)
########### 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, opti ons are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FORC E) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, opti ons are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FORC E)
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")
skipping to change at line 44 skipping to change at line 38
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(NOT STELLARIUM_SPLASH)
SET(STELLARIUM_SPLASH Release CACHE STRING "Choose the type of Stellarium'
s splash image, options are: Release Development ReleaseCandidate." FORCE)
ENDIF()
ADD_DEFINITIONS(-DSTELLARIUM_SPLASH="${STELLARIUM_SPLASH}")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(APPLE 1) SET(APPLE 1)
ENDIF() ENDIF()
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS "-v" OUTPUT_VARIABLE _clang_version_
info)
STRING(REGEX REPLACE "^.*[ ]([0-9]+)\\.[0-9].*$" "\\1" CLANG_MAJOR "${_cla
ng_version_info}")
STRING(REGEX REPLACE "^.*[ ][0-9]+\\.([0-9]).*$" "\\1" CLANG_MINOR "${_cla
ng_version_info}")
MESSAGE(STATUS "Found Clang ${CLANG_MAJOR}.${CLANG_MINOR}")
ELSE()
SET(CLANG_MAJOR 0)
SET(CLANG_MINOR 0)
ENDIF()
SET(CLANG_VERSION "${CLANG_MAJOR}.${CLANG_MINOR}")
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS "-dumpversion" OUTPUT_VARIABLE _gcc_ # The stars structs rely on gnu gcc packing of bit-fields.
version_info) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields")
STRING(REGEX REPLACE "^([0-9]+).*$" "\\1" GCC_MAJOR ${_g SET(GCC_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
cc_version_info})
STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" GCC_MINOR ${_g
cc_version_info})
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GCC_PATCH ${_g
cc_version_info})
IF(GCC_PATCH MATCHES "\\.+")
SET(GCC_PATCH "")
ENDIF()
IF(GCC_MINOR MATCHES "\\.+")
SET(GCC_MINOR "")
ENDIF()
IF(GCC_MAJOR MATCHES "\\.+")
SET(GCC_MAJOR "")
ENDIF()
MESSAGE(STATUS "Found GCC ${GCC_MAJOR}.${GCC_MINOR}")
SET(COMPILER_VERSION gcc${GCC_MAJOR}${GCC_MINOR}${GCC_PATCH})
ELSE() ELSE()
SET(GCC_MAJOR 0) SET(GCC_VERSION "0.0")
SET(GCC_MINOR 0)
ENDIF() ENDIF()
SET(GCC_VERSION "${GCC_MAJOR}.${GCC_MINOR}")
IF(UNIX AND NOT WIN32) IF(WIN32)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter") IF(NOT MSVC)
# additional C compile flags SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fexceptions -fident -mthread
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-paramete s")
r") # additional CPP compile flags SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wsign-promo -fexceptions
ELSEIF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") -fident -mthreads")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fexceptions -fident -mthreads") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wsign-promo -fex
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wsign-promo -fexceptions -f ceptions -fident -mthreads -mwindows")
ident -mthreads") ELSE()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wsign-promo -fexcep # Prevent MSVC from complaining about M_PI no matter where <cmath> is i
tions -fident -mthreads -mwindows") # --large-address-aware --enable-runt ncluded first
ime-pseudo-reloc --verbose ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
ELSEIF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") ENDIF()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fexceptions -fident -mthreads") ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wsign-promo -fexceptions -f SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
ident -mthreads") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-paramet
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wsign-promo -fexcep er -Wno-unused-result")
tions -fident -mthreads -mwindows") # --enable-runtime-pseudo-reloc --verb
ose
ENDIF() ENDIF()
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wno-unused-p rivate-field -Wno-uninitialized -Wno-tautological-constant-out-of-range-com pare") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wno-unused-p rivate-field -Wno-uninitialized -Wno-tautological-constant-out-of-range-com pare")
# The cosmetic fix for Clang 3.4
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 3.3)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-const-variable -Wno-u
nused-result")
ENDIF()
ENDIF() ENDIF()
SET(OPTIMIZE_INTEL_ATOM 0 CACHE BOOL "Activate optimizations for atom proce ssor.") SET(OPTIMIZE_INTEL_ATOM 0 CACHE BOOL "Activate optimizations for atom proce ssor.")
IF(OPTIMIZE_INTEL_ATOM) IF(OPTIMIZE_INTEL_ATOM)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=generic -msse -msse2 -msse3 -mf IF (MSVC)
pmath=sse") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2 ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse -msse2 -msse3 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 ")
-mfpmath=sse") ELSE()
ENDIF() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=generic -msse -msse2 -msse3 -m
fpmath=sse")
SET(BUILD_FOR_MAEMO 0 CACHE BOOL "Set to 1 or true if you want to build for SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse -msse2 -msse
maemo target") 3 -mfpmath=sse")
IF(BUILD_FOR_MAEMO) ENDIF()
# Optimize for N900 ARM processor
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fno-optimize
-sibling-calls -D_REENTRANT -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GL
YPH_CACHE_WIDTH=1024 -mtune=cortex-a8 -march=armv7-a -ftree-vectorize -mfpu
=neon -mfloat-abi=softfp -ffast-math -funroll-loops -DBUILD_FOR_MAEMO")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fno-opti
mize-sibling-calls -D_REENTRANT -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTUR
E_GLYPH_CACHE_WIDTH=1024 -mtune=cortex-a8 -march=armv7-a -ftree-vectorize -
mfpu=neon -mfloat-abi=softfp -ffast-math -funroll-loops -DBUILD_FOR_MAEMO")
ENDIF() ENDIF()
# FreeBSD-specific compiler flags # FreeBSD-specific compiler flags
# resolve bug for FreeBSD/amd64 and NVIDIA proprietary drivers # resolve bug for FreeBSD/amd64 and NVIDIA proprietary drivers
IF (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") IF(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
# Use -pthread compilation option to properly link to threading library # Use -pthread compilation option to properly link to threading library
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
IF(${GCC_VERSION} STRGREATER "4.7") IF(${GCC_VERSION} VERSION_GREATER 4.7)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
ENDIF() ENDIF()
ENDIF (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") ENDIF()
# best way to get to APPLE? # best way to get to APPLE?
IF(APPLE) IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Wall -Wextra") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Wall -Wextra")
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field -Wno- unknown-warning-option") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field -Wno- unknown-warning-option -Wno-unused-const-variable -Wno-unused-result")
ENDIF() ENDIF()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common -Wall -Wextra -Wno-unused- parameter") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common -Wall -Wextra -Wno-unused- parameter")
# uncomment one of the following, depending on minimum OS level you want # We support only 64 bits MacOSX
#SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5")
#SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk/")
#SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
#SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk/")
# uncomment one of the following, depending on what platforms you want.
# NOTE: Qt build for Cocoa is Intel only. Qt with Carbon is both, but doe
s not seem
# to handle 64bit well.
#SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64;ppc;ppc64")
#SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
SET(CMAKE_OSX_ARCHITECTURES "x86_64") SET(CMAKE_OSX_ARCHITECTURES "x86_64")
ENDIF() ENDIF()
########### Check functions ###########
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES "-lm")
CHECK_FUNCTION_EXISTS(pow10 HAVE_POW10)
SET(CMAKE_REQUIRED_LIBRARIES)
IF(HAVE_POW10)
ADD_DEFINITIONS(-DHAVE_POW10)
ENDIF()
########### Others ########### ########### Others ###########
# Activate translation with gettext # Activate translation
SET(ENABLE_NLS 1 CACHE BOOL "Define whether program translation should be s upported.") SET(ENABLE_NLS 1 CACHE BOOL "Define whether program translation should be s upported.")
IF(ENABLE_NLS) IF(ENABLE_NLS)
ADD_DEFINITIONS(-DENABLE_NLS) ADD_DEFINITIONS(-DENABLE_NLS)
ENDIF() ENDIF()
SET(RELEASE_BUILD 1 CACHE BOOL "Flag this build as an official release.") SET(RELEASE_BUILD 1 CACHE BOOL "Flag this build as an official release.")
# Activate sound support # Activate sound support
SET(ENABLE_SOUND 0 CACHE BOOL "Define whether sound support should be activ ated.") SET(ENABLE_SOUND 0 CACHE BOOL "Define whether sound support should be activ ated.")
skipping to change at line 183 skipping to change at line 130
SET(ENABLE_SCRIPT_CONSOLE 1 CACHE BOOL "Define whether to build the scrip t console feature.") SET(ENABLE_SCRIPT_CONSOLE 1 CACHE BOOL "Define whether to build the scrip t console feature.")
IF(ENABLE_SCRIPT_CONSOLE) IF(ENABLE_SCRIPT_CONSOLE)
ADD_DEFINITIONS(-DENABLE_SCRIPT_CONSOLE) ADD_DEFINITIONS(-DENABLE_SCRIPT_CONSOLE)
ENDIF() ENDIF()
SET(ENABLE_STRATOSCRIPT_COMPAT 0 CACHE BOOL "Set to 1 or true if you want to build the Stratoscript compatibility mode") SET(ENABLE_STRATOSCRIPT_COMPAT 0 CACHE BOOL "Set to 1 or true if you want to build the Stratoscript compatibility mode")
ELSE() ELSE()
ADD_DEFINITIONS(-DDISABLE_SCRIPTING) ADD_DEFINITIONS(-DDISABLE_SCRIPTING)
ENDIF() ENDIF()
SET(GUI_MODE Standard CACHE STRING "Choose the type of GUI to build, option s are: Standard, None, External") SET(GUI_MODE Standard CACHE STRING "Choose the type of GUI to build, option s are: Standard, None, External")
SET(OPENGL_MODE Desktop CACHE STRING "Choose the type of openGL to use, opt ions are: Desktop, ES2")
SET(GENERATE_PACKAGE_TARGET 1 CACHE BOOL "Set to 1 or true if you want to h ave make package target") SET(GENERATE_PACKAGE_TARGET 1 CACHE BOOL "Set to 1 or true if you want to h ave make package target")
# On WIN32 we need to split the main binary into a small binary and a dll # On WIN32 we need to split the main binary into a small binary and a dll
# This is for allowing to link dynamic plug-ins afterward # This is for allowing to link dynamic plug-ins afterward
IF(WIN32) # It does not seem to work with MSVC, so I disable it for the moment.
IF(WIN32 AND NOT MSVC)
SET(GENERATE_STELMAINLIB 1) SET(GENERATE_STELMAINLIB 1)
ELSE() ELSE()
SET(GENERATE_STELMAINLIB 0) SET(GENERATE_STELMAINLIB 0)
ENDIF() ENDIF()
# For Windows, the default back end for the graphics system should be "nati
ve", as "raster"
# causes problems for many ATI users. However, for other platforms we shou
ld use raster
# as the default as it is faster.
# Mac 10.6 requires native as well.
IF(WIN32 OR APPLE)
ADD_DEFINITIONS(-DDEFAULT_GRAPHICS_SYSTEM="native")
ELSE()
ADD_DEFINITIONS(-DDEFAULT_GRAPHICS_SYSTEM="raster")
ENDIF()
########### Plugin setup ############# ########### Plugin setup #############
SET(BUILD_STATIC_PLUGINS 1 CACHE BOOL "Define whether plugins should be com
piled statically and linked to the main program")
SET(BUILD_DYNAMIC_PLUGINS 0 CACHE BOOL "Define whether plugins should be co
mpiled dynamically")
#### demo plugins #### SET(STELLARIUM_PLUGINS) # Global list of all the plugins.
SET(USE_PLUGIN_HELLOSTELMODULE 0 CACHE BOOL "Define whether the HelloStelMo MACRO(ADD_PLUGIN NAME DEFAULT)
dule plugin should be created.") STRING(TOUPPER ${NAME} NAME_UP)
SET(USE_PLUGIN_SIMPLEDRAWLINE 0 CACHE BOOL "Define whether the Simple Draw SET(USE_PLUGIN_${NAME_UP} ${DEFAULT} CACHE BOOL "Define wheter the ${NAME
Line plugin should be created.") } plugin should be created.")
SET(STELLARIUM_PLUGINS ${STELLARIUM_PLUGINS} ${NAME})
ENDMACRO()
#### demo plugins ####
ADD_PLUGIN(HelloStelModule 0)
ADD_PLUGIN(SimpleDrawLine 0)
#### work plugins #### #### work plugins ####
SET(USE_PLUGIN_ANGLEMEASURE 1 CACHE BOOL "Define whether the AngleMeasure p ADD_PLUGIN(AngleMeasure 1)
lugin should be created.") ADD_PLUGIN(CompassMarks 1)
SET(USE_PLUGIN_COMPASSMARKS 1 CACHE BOOL "Define whether the CompassMarks p ADD_PLUGIN(Exoplanets 1)
lugin should be created.") ADD_PLUGIN(EquationOfTime 1)
SET(USE_PLUGIN_EXOPLANETS 1 CACHE BOOL "Define whether the Exoplanets plugi ADD_PLUGIN(FOV 1)
n should be created.") ADD_PLUGIN(LogBook 0)
SET(USE_PLUGIN_LOGBOOK 0 CACHE BOOL "Define whether the LogBook plugin shou ADD_PLUGIN(MeteorShowers 1)
ld be created.") ADD_PLUGIN(NavStars 1)
SET(USE_PLUGIN_NOVAE 1 CACHE BOOL "Define whether the Novae plugin should b ADD_PLUGIN(Novae 1)
e created.") ADD_PLUGIN(Observability 1)
SET(USE_PLUGIN_OBSERVABILITY 1 CACHE BOOL "Define whether the Observability ADD_PLUGIN(Oculars 1)
plugin should be created.") ADD_PLUGIN(PointerCoordinates 1)
SET(USE_PLUGIN_OCULARS 1 CACHE BOOL "Define whether the Oculars plugin shou ADD_PLUGIN(Pulsars 1)
ld be created.") ADD_PLUGIN(Quasars 1)
SET(USE_PLUGIN_PULSARS 1 CACHE BOOL "Define whether the Pulsars plugin shou ADD_PLUGIN(Satellites 1)
ld be created.") ADD_PLUGIN(SolarSystemEditor 1)
SET(USE_PLUGIN_QUASARS 1 CACHE BOOL "Define whether the Quasars plugin shou ADD_PLUGIN(Supernovae 1)
ld be created.") ADD_PLUGIN(SVMT 0)
SET(USE_PLUGIN_RENDERERSTATISTICS 0 CACHE BOOL "Define whether the Renderer ADD_PLUGIN(TextUserInterface 1)
Statistics plugin should be created.") ADD_PLUGIN(TelescopeControl 1)
SET(USE_PLUGIN_SATELLITES 1 CACHE BOOL "Define whether the Satellites plugi ADD_PLUGIN(TimeZoneConfiguration 1)
n should be created.") ADD_PLUGIN(VirGO 0)
SET(USE_PLUGIN_SOLARSYSTEMEDITOR 1 CACHE BOOL "Define whether the Solar Sys
tem Editor should be built.")
SET(USE_PLUGIN_SUPERNOVAE 1 CACHE BOOL "Define whether the Historical Super
nova plugin should be created.")
SET(USE_PLUGIN_SVMT 0 CACHE BOOL "Define whether the SVMT plugin should be
created.")
SET(USE_PLUGIN_TELESCOPECONTROL 1 CACHE BOOL "Define whether the TelescopeC
ontrol plug-in should be created.")
SET(USE_PLUGIN_TEXTUSERINTERFACE 1 CACHE BOOL "Define whether the TextUserI
nterface plugin should be created.")
SET(USE_PLUGIN_TIMEZONECONFIGURATION 1 CACHE BOOL "Define whether the TimeZ
oneConfiguration plugin should be created.")
SET(USE_PLUGIN_VIRGO 0 CACHE BOOL "Define whether the VirGO plugin should b
e created.")
########## Static plugins need to define includes and libraries ########## Static plugins need to define includes and libraries
########## for the compilation of Stellarium itself ########## for the compilation of Stellarium itself
IF (BUILD_STATIC_PLUGINS) IF(USE_PLUGIN_SVMT)
IF (USE_PLUGIN_SVMT) SET(QT_USE_QTXML TRUE) # For SVMT we also need QtXml module
SET(QT_USE_QTXML TRUE) # For SVMT we also need QtXml module SET(QT_USE_QTDECLARATIVE TRUE) # For SVMT we also need QML module, this
SET(QT_USE_QTDECLARATIVE TRUE) # For SVMT we also need QML module, t line doesn't seem to work right now
his line doesn't seem to work right now SET(QT_USE_QTWEBKIT TRUE) # For SVMT we also need QML module, this line
SET(QT_USE_QTWEBKIT TRUE) # For SVMT we also need QML module, this l doesn't seem to work right now
ine doesn't seem to work right now ENDIF()
ENDIF()
IF(USE_PLUGIN_VIRGO)
IF (USE_PLUGIN_VIRGO) ## Library for loading FITS image files
## Library for loading FITS image files FIND_PATH(CFITSIO_INCLUDE_DIR fitsio.h
FIND_PATH(CFITSIO_INCLUDE_DIR fitsio.h /usr/include
/usr/include /usr/local/include
/usr/local/include DOC "Should point to the directory where the include files for libc
DOC "Should point to the directory where the include files for lib fitsio are installed")
cfitsio are installed") FIND_LIBRARY(CFITSIO_LIBRARIES cfitsio
FIND_LIBRARY(CFITSIO_LIBRARIES cfitsio PATHS
PATHS /usr/lib/
/usr/lib/ /usr/local/lib
/usr/local/lib /opt/local/lib
/opt/local/lib DOC "cfitsio link options")
DOC "cfitsio link options") SET(QT_USE_QTXML TRUE) # For VirGO we also need QtXml module
SET(QT_USE_QTXML TRUE) # For VirGO we also need QtXml module ENDIF()
ENDIF()
IF (USE_PLUGIN_LOGBOOK)
SET(QT_USE_QTSQL TRUE) # For LogBook we also need SQL module
ENDIF()
IF(USE_PLUGIN_LOGBOOK)
SET(QT_USE_QTSQL TRUE) # For LogBook we also need SQL module
ENDIF() ENDIF()
# Custom target used to manage dependencies of stellarium -> Static plugins # Custom target used to manage dependencies of stellarium -> Static plugins
# It is important that static plugins are compiled before stellarium main e xecutable is linked # It is important that static plugins are compiled before stellarium main e xecutable is linked
ADD_CUSTOM_TARGET(AllStaticPlugins ALL) ADD_CUSTOM_TARGET(AllStaticPlugins ALL)
########### Find packages ########### ########### Find packages ###########
SET(QT_MIN_VERSION "4.8.0") FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt4 REQUIRED) GET_TARGET_PROPERTY(QMAKE_LOCATION Qt5::qmake LOCATION)
IF(${Qt5Core_VERSION_STRING} VERSION_LESS MINIMAL_QT_VERSION)
MESSAGE(FATAL_ERROR "Found Qt5: ${QMAKE_LOCATION} (found unsuitable ver
sion \"${Qt5Core_VERSION_STRING}\", required is \"${MINIMAL_QT_VERSION}\")"
)
ELSE()
MESSAGE(STATUS "Found Qt5: ${QMAKE_LOCATION} (found suitable version \"
${Qt5Core_VERSION_STRING}\", required is \"${MINIMAL_QT_VERSION}\")")
ENDIF()
FIND_PACKAGE(Qt5Concurrent REQUIRED)
FIND_PACKAGE(Qt5Declarative REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED)
FIND_PACKAGE(Qt5OpenGL REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
IF(WIN32)
FIND_PACKAGE(Qt5Sql REQUIRED)
FIND_PACKAGE(Qt5XmlPatterns REQUIRED)
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 # As moc files are generated in the binary dir, tell CMake to always look f
# to always look for includes there: or includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(QT_USE_QTOPENGL TRUE)
IF(ENABLE_SCRIPTING) IF(ENABLE_SCRIPTING)
SET(QT_USE_QTSCRIPT TRUE) SET(QT_USE_QTSCRIPT TRUE)
FIND_PACKAGE(Qt5Script REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Script_INCLUDE_DIRS})
ENDIF() ENDIF()
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTTEST TRUE)
IF(ENABLE_SOUND) IF(ENABLE_SOUND)
ADD_DEFINITIONS(-DHAVE_QT_PHONON) ADD_DEFINITIONS(-DENABLE_SOUND)
SET(QT_USE_PHONON TRUE) FIND_PACKAGE(Qt5Multimedia REQUIRED)
FIND_PACKAGE(Qt5MultimediaWidgets REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Multimedia_INCLUDE_DIRS})
ENDIF() ENDIF()
INCLUDE(${QT_USE_FILE})
# Get rid of the QtTest dependency for the main binary. It is re-added manu
ally when compiling tests.
STRING(REPLACE "${QT_QTTEST_LIBRARY}" "" QT_LIBRARIES "${QT_LIBRARIES}")
# Get rid of the GLU dependency, it's not needed in stellarium.
STRING(REPLACE "-lGLU " "" QT_LIBRARIES "${QT_LIBRARIES}")
FIND_PACKAGE(OpenGL) # Introduced in revision 5284, may cause problems when
compiling in OpenGL ES mode - see lines 248-255 below. --BM
FIND_PACKAGE(ZLIB)
IF(ENABLE_NLS) # I add this test because on Windows with angle we should not link
FIND_PACKAGE(Iconv REQUIRED) # with OpenGL. Maybe there is a better way to do that.
FIND_PATH(INTL_INCLUDE_DIR libintl.h IF("${Qt5Gui_OPENGL_LIBRARIES}" MATCHES "opengl")
PATHS FIND_PACKAGE(OpenGL REQUIRED)
/usr/include
/sw/include
/usr/local/include)
FIND_LIBRARY(INTL_LIBRARIES intl c
PATHS
/usr/lib/
/sw/lib
/usr/local/lib) # NO_DEFAULT_PATH
FIND_PACKAGE(Gettext REQUIRED)
FIND_PACKAGE(XGettext REQUIRED)
ENDIF()
IF (OPENGL_MODE STREQUAL "Desktop")
FIND_PACKAGE(OpenGL REQUIRED)
ENDIF()
IF(OPENGL_MODE STREQUAL "ES2")
ADD_DEFINITIONS(-DUSE_OPENGL_ES2 -DQT_OPENGL_LIB -D_REENTRANT -DQT_GUI_LI
B -DQT_CORE_LIB -DQT_SHARED)
# Make sure that no desktop OpenGL libraries are linked when OpenGLES is
used
STRING(REPLACE "-lGL" "-lGLESv2" QT_LIBRARIES "${QT_LIBRARIES}")
ENDIF() ENDIF()
IF(NOT WIN32)
FIND_PACKAGE(ZLIB)
ELSE()
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/external/zlib)
ENDIF()
FIND_PACKAGE(Qt5Test)
INCLUDE_DIRECTORIES(${Qt5Test_INCLUDE_DIRS})
########### 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/Contents") SET(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/Stellarium.app/Cont
ELSE(APPLE) ents")
ADD_DEFINITIONS(-DINSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share/stellari ELSE()
um") ADD_DEFINITIONS(-DINSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share/st
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/locale ellarium")
") ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/
# Used in generating the documentation (doc/stellarium.pod.cmake): locale")
SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/stellarium") # Used in generating the documentation (doc/stellarium.pod.cmake):
ENDIF(APPLE) SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/stellarium")
ELSE(UNIX AND NOT WIN32) ENDIF()
ADD_DEFINITIONS(-DINSTALL_DATADIR=".") ELSE()
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="./locale") ADD_DEFINITIONS(-DINSTALL_DATADIR=".")
ENDIF(UNIX AND NOT WIN32) ADD_DEFINITIONS(-DINSTALL_LOCALEDIR="./locale")
ENDIF()
########### Get revision number for non-release builds ########### ########### Get revision number for non-release builds ###########
IF(NOT RELEASE_BUILD) IF(NOT RELEASE_BUILD)
#Hack until CMake detection for Bazaar is finished #Hack until CMake detection for Bazaar is finished
IF(BZR_REVISION) IF(BZR_REVISION)
SET(PACKAGE_VERSION "bzr${BZR_REVISION}") SET(PACKAGE_VERSION "bzr${BZR_REVISION}")
ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}") ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}")
ELSE() ELSE()
FIND_PACKAGE(Subversion) FIND_PACKAGE(Subversion)
IF(Subversion_FOUND) IF(Subversion_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} StelSvn) Subversion_WC_INFO(${PROJECT_SOURCE_DIR} StelSvn)
SET(SVN_REVISION ${StelSvn_WC_REVISION}) SET(SVN_REVISION ${StelSvn_WC_REVISION})
ADD_DEFINITIONS(-DSVN_REVISION="${SVN_REVISION}") ADD_DEFINITIONS(-DSVN_REVISION="${SVN_REVISION}")
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(ENABLE_STRATOSCRIPT_COMPAT) IF(ENABLE_STRATOSCRIPT_COMPAT)
ADD_DEFINITIONS(-DENABLE_STRATOSCRIPT_COMPAT) ADD_DEFINITIONS(-DENABLE_STRATOSCRIPT_COMPAT)
ENDIF() ENDIF()
### [Optional] Embed icon in the Windows executable ### ### [Optional] Embed icon in the Windows executable ###
IF(WIN32) IF(WIN32)
SET(ENABLE_WINDOWS_EXE_ICON 1 CACHE BOOL "Determine if it should try to e SET(ENABLE_WINDOWS_EXE_ICON 1 CACHE BOOL "Determine if it should try to
mbed the Stellarium icon in the Windows .exe file") 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)
#The mingGW snapshot distributed with the Qt SDK has it under this name IF(NOT MSVC)
. #The mingGW snapshot distributed with the Qt SDK has it under t
SET(RC_COMPILER_FILENAME "windres.exe") his name.
FIND_FILE(RC_COMPILER_PATH ${RC_COMPILER_FILENAME}) SET(RC_COMPILER_FILENAME "windres.exe")
IF (RC_COMPILER_PATH) FIND_FILE(RC_COMPILER_PATH ${RC_COMPILER_FILENAME})
MESSAGE(STATUS "Found .rc compiler: ${RC_COMPILER_PATH}") ENDIF()
ENDIF(RC_COMPILER_PATH) IF(RC_COMPILER_PATH)
ENDIF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH) MESSAGE(STATUS "Found .rc compiler: ${RC_COMPILER_PATH}")
ENDIF(WIN32) ENDIF(RC_COMPILER_PATH)
ENDIF(ENABLE_WINDOWS_EXE_ICON AND NOT RC_COMPILER_PATH)
ENDIF()
### Generate an Inno Setup project file ### ### Generate an Inno Setup project file ###
IF(WIN32) IF(WIN32)
# 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 line s SET(ISS_ARCHITECTURE_SPECIFIC ";In the 64-bit only version, this li
witches the installer to 64-bit mode.") ne switches the installer to 64-bit mode.")
SET(ISS_PACKAGE_PLATFORM "win32") SET(ISS_PACKAGE_PLATFORM "win32")
SET(ISS_ARCH_SPECIFIC_MINGW_LIBS "Source: \"${MINGW_BIN_DIRECTORY}/libs IF(MSVC)
tdc++*.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_ #SET(REDIST_FILES "Source: \"${CMAKE_INSTALL_PREFIX}/bin/msvc*.dl
s_dw2-1.dll\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/mingwm l\"; DestDir: \"{app}\";")
10.dll\"; DestDir: \"{app}\";") SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredist/vcr
ELSEIF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") edist_x86.exe\"; DestDir: \"{tmp}\";")
SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on win64:\n SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x86.exe\"; Parameters:
ArchitecturesAllowed=x64\n;Switch to 64-bit install mode:\nArchitecturesIns \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg: \"{c
tallIn64BitMode=x64") m:RedistRun}\"")
SET(ISS_PACKAGE_PLATFORM "win64") ELSE()
SET(ISS_ARCH_SPECIFIC_MINGW_LIBS "Source: \"${MINGW_BIN_DIRECTORY}/libs SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++*.dll
tdc++*.dll\"; DestDir: \"{app}\";\nSource: \"@QT_BINARY_DIR@/libwinpthread* \"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_dw2-1.dl
.dll\"; DestDir: \"{app}\";\nSource: \"@QT_BINARY_DIR@/libgcc_s_sjlj*.dll\" l\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthread*.d
; DestDir: \"{app}\";") ll\"; DestDir: \"{app}\";")
ENDIF() SET(REDIST_RUN "; Redistributable package not required for MinGW"
SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been automat )
ically generated by CMake. Your changes will be lost the next time CMake is ENDIF()
run.") ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/stellarium.iss.cmake ${CMAKE_SOURCE_DI SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on win6
R}/stellarium.iss @ONLY) 4:\nArchitecturesAllowed=x64\n;Switch to 64-bit install mode:\nArchitecture
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/stellarium-patch.iss.cmake ${CMAKE_SOU sInstallIn64BitMode=x64")
RCE_DIR}/stellarium-patch.iss @ONLY) SET(ISS_PACKAGE_PLATFORM "win64")
ENDIF(WIN32) IF(MSVC)
#SET(REDIST_FILES "Source: \"${CMAKE_INSTALL_PREFIX}/bin/msvc*.dl
########## Release build tweaks ########### l\"; DestDir: \"{app}\";")
SET(REDIST_FILES "Source: \"${CMAKE_SOURCE_DIR}/util/vcredist/vcr
#-O1 and -O2 break build (cause crash at startup) on Windows. edist_x64.exe\"; DestDir: \"{tmp}\";")
# SET(REDIST_RUN "Filename: \"{tmp}/vcredist_x64.exe\"; Parameters:
# However, setting all -O1 and -O2 options _except_ -fomit-frame-pointer wo \"/passive /Q:a /c:\"\"msiexec /qb /i vcredist.msi\"\" \"; StatusMsg: \"{c
rks. m:RedistRun}\"")
# yet -O1 with -fno-omit-frame-pointer does not. So we use this workaround. ELSE()
# SET(REDIST_FILES "Source: \"${MINGW_BIN_DIRECTORY}/libstdc++*.dll
# Yes, it's ugly. \"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libwinpthread*.dl
# l\"; DestDir: \"{app}\";\nSource: \"${MINGW_BIN_DIRECTORY}/libgcc_s_sjlj*.d
# (This happens with MinGW port of GCC 4.6/4.7 - ll\"; DestDir: \"{app}\";")
# maybe it won't happen with newer versions so we only use this for 4.6/4. SET(REDIST_RUN "; Redistributable package not required for MinGW"
7) )
IF(WIN32) ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
IF(GCC_VERSION VERSION_EQUAL 4.4)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O0 -fauto-inc-de
c -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -fguess-branch
-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-refere
nce -fmerge-constants -fsplit-wide-types -ftree-builtin-call-dce -ftree-ccp
-ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -f
tree-fre -ftree-sra -ftree-ter -funit-at-a-time -fthread-jumps -falign-func
tions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcrossjump
ing -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-checks -fexp
ensive-optimizations -fgcse -fgcse-lm -finline-small-functions -findirect-i
nlining -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks -fr
eorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fs
chedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-
switch-conversion -ftree-pre -ftree-vrp")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O0 -fauto-in
c-dec -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -fguess-br
anch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-re
ference -fmerge-constants -fsplit-wide-types -ftree-builtin-call-dce -ftree
-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-ds
e -ftree-fre -ftree-sra -ftree-ter -funit-at-a-time -fthread-jumps -falign-
functions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcross
jumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-checks -
fexpensive-optimizations -fgcse -fgcse-lm -finline-small-functions -findire
ct-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks
-freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec
-fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ft
ree-switch-conversion -ftree-pre -ftree-vrp")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0
-fauto-inc-dec -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse
-fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-cons
t -fipa-reference -fmerge-constants -fsplit-wide-types -ftree-builtin-call-
dce -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts
-ftree-dse -ftree-fre -ftree-sra -ftree-ter -funit-at-a-time -fthread-jump
s -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-sav
es -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointe
r-checks -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-function
s -findirect-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -freor
der-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -f
sched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-ov
erflow -ftree-switch-conversion -ftree-pre -ftree-vrp")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-O0 -fauto-inc-dec -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -f
dse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-
const -fipa-reference -fmerge-constants -fsplit-wide-types -ftree-builtin-c
all-dce -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-
opts -ftree-dse -ftree-fre -ftree-sra -ftree-ter -funit-at-a-time -fthread-
jumps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller
-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-po
inter-checks -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-func
tions -findirect-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -f
reorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interbloc
k -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstric
t-overflow -ftree-switch-conversion -ftree-pre -ftree-vrp")
ELSEIF(GCC_VERSION VERSION_EQUAL 4.6 OR GCC_VERSION VERSION_EQUAL 4.7)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O0 -fauto-inc-de
c -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse
-fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-con
st -fipa-reference -fipa-profile -fmerge-constants -fsplit-wide-types -ftre
e-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -f
tree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree
-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fthread-jumps -
falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves
-fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-c
hecks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-sm
all-functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpart
ial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions -fr
erun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fsche
dule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversion -f
tree-pre -ftree-vrp")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O0 -fauto-in
c-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -
fdse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure
-const -fipa-reference -fipa-profile -fmerge-constants -fsplit-wide-types -
ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrenam
e -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -f
tree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fthread-jum
ps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-sa
ves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-point
er-checks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finlin
e-small-functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -f
partial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions
-frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -f
schedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversio
n -ftree-pre -ftree-vrp")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -fauto-inc-dec -f
compare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -fg
uess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -
fipa-reference -fipa-profile -fmerge-constants -fsplit-wide-types -ftree-bi
t-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -ftree
-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-phi
prop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fthread-jumps -fali
gn-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcr
ossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-check
s -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-
functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpartial-
inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun
-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule
-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversion -ftree
-pre -ftree-vrp")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -fauto-inc-de
c -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse
-fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-con
st -fipa-reference -fipa-profile -fmerge-constants -fsplit-wide-types -ftre
e-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -f
tree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree
-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fthread-jumps -
falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves
-fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-c
hecks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-sm
all-functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpart
ial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions -fr
erun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fsche
dule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversion -f
tree-pre -ftree-vrp")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0
-fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelaye
d-branch -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion
-fipa-pure-const -fipa-reference -fipa-profile -fmerge-constants -fsplit-wi
de-types -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree
-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ft
ree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -f
thread-jumps -falign-functions -falign-jumps -falign-loops -falign-labels -
fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-
null-pointer-checks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-
lm -finline-small-functions -findirect-inlining -fipa-sra -foptimize-siblin
g-calls -fpartial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder
-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedul
e-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch
-conversion -ftree-pre -ftree-vrp")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-O0 -fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fde
layed-branch -fdse -fguess-branch-probability -fif-conversion2 -fif-convers
ion -fipa-pure-const -fipa-reference -fipa-profile -fmerge-constants -fspli
t-wide-types -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -f
tree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop
-ftree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-tim
e -fthread-jumps -falign-functions -falign-jumps -falign-loops -falign-labe
ls -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdel
ete-null-pointer-checks -fdevirtualize -fexpensive-optimizations -fgcse -fg
cse-lm -finline-small-functions -findirect-inlining -fipa-sra -foptimize-si
bling-calls -fpartial-inlining -fpeephole2 -fregmove -freorder-blocks -freo
rder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fsch
edule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-sw
itch-conversion -ftree-pre -ftree-vrp")
ENDIF() ENDIF()
ENDIF() SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been autom
ENDIF(WIN32) atically generated by CMake. Your changes will be lost the next time CMake
is run.")
IF(GENERATE_STELMAINLIB)
SET(STELMAINLIB "Source: \"${CMAKE_INSTALL_PREFIX}/lib/libstelMain.
dll\"; DestDir: \"{app}\";")
ELSE()
SET(STELMAINLIB "; StelMainLib don't used")
ENDIF()
GET_TARGET_PROPERTY(QtConcurrent_location Qt5::Concurrent LOCATION)
GET_TARGET_PROPERTY(QtCore_location Qt5::Core LOCATION)
GET_TARGET_PROPERTY(QtGui_location Qt5::Gui LOCATION)
GET_TARGET_PROPERTY(QtOpenGL_location Qt5::OpenGL LOCATION)
GET_TARGET_PROPERTY(QtNetwork_location Qt5::Network LOCATION)
GET_TARGET_PROPERTY(QtWidgets_location Qt5::Widgets LOCATION)
GET_TARGET_PROPERTY(QtDeclarative_location Qt5::Declarative LOCATION)
GET_TARGET_PROPERTY(QtSql_location Qt5::Sql LOCATION)
GET_TARGET_PROPERTY(QtXmlPatterns_location Qt5::XmlPatterns LOCATION)
IF(ENABLE_SCRIPTING)
GET_TARGET_PROPERTY(QtScript_location Qt5::Script LOCATION)
SET(ISS_QT_SCRIPT "Source: \"${QtScript_location}\"; DestDir: \"{ap
p}\";")
ELSE()
SET(ISS_QT_SCRIPT "; QtScript don't used")
ENDIF()
IF(ENABLE_SOUND)
GET_TARGET_PROPERTY(QtMultimedia_location Qt5::Multimedia LOCATION)
GET_TARGET_PROPERTY(QtMultimediaWidgets_location Qt5::MultimediaWid
gets LOCATION)
SET(ISS_QT_MULTIMEDIA "Source: \"${QtMultimedia_location}\"; DestDi
r: \"{app}\";\nSource: \"${QtMultimediaWidgets_location}\"; DestDir: \"{app
}\";")
ELSE()
SET(ISS_QT_MULTIMEDIA "; QtMultimedia don't used")
ENDIF()
GET_FILENAME_COMPONENT(QT5_LIBS ${QtCore_location} PATH)
IF(MSVC)
SET(ISS_ANGLE_LIBS "; ANGLE support (libEGL.dll, libGLESv2.dll and
d3dcompiler_*.dll)\nSource: \"${QT5_LIBS}/libEGL.dll\"; DestDir: \"{app}\";
\nSource: \"${QT5_LIBS}/libGLESv2.dll\"; DestDir: \"{app}\";\nSource: \"${Q
T5_LIBS}/d3dcompiler_*.dll\"; DestDir: \"{app}\";")
ELSE()
SET(ISS_ANGLE_LIBS "; ANGLE support doesn't exists for MinGW")
ENDIF()
SET(ISS_ICU_LIBS "; ICU support\nSource: \"${QT5_LIBS}/icu*.dll\"; Dest
Dir: \"{app}\";")
# Deploy related stuff
SET(ISS_WINDOWS_PLUGIN "Source: \"${QT5_LIBS}/../plugins/platforms/qwin
dows.dll\"; DestDir: \"{app}/platforms/\";")
IF(ENABLE_SOUND)
SET(ISS_MULTIMEDIA_PLUGINS "Source: \"${QT5_LIBS}/../plugins/medias
ervice/dsengine.dll\"; DestDir: \"{app}/mediaservice/\";\nSource: \"${QT5_L
IBS}/../plugins/mediaservice/qtmedia_audioengine.dll\"; DestDir: \"{app}/me
diaservice/\";\nSource: \"${QT5_LIBS}/../plugins/playlistformats/qtmultimed
ia_m3u.dll\"; DestDir: \"{app}/playlistformats/\";")
ELSE()
SET(ISS_MULTIMEDIA_PLUGINS "; QtMultimedia don't used")
ENDIF()
SET(ISS_QML_DIR "Source: \"${QT5_LIBS}/../imports/Qt/labs/shaders/qmldi
r\"; DestDir: \"{app}/Qt/labs/shaders/\";")
SET(ISS_QML_PLUGINS "Source: \"${QT5_LIBS}/../imports/Qt/labs/shaders/p
lugins.qmltypes\"; DestDir: \"{app}/Qt/labs/shaders/\";")
SET(ISS_QML_SHADERS "Source: \"${QT5_LIBS}/../imports/Qt/labs/shaders/q
mlshadersplugin.dll\"; DestDir: \"{app}/Qt/labs/shaders/\";")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/stellarium.iss.cmake ${CMAKE_SOURCE_
DIR}/stellarium.iss @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/stellarium-patch.iss.cmake ${CMAKE_S
OURCE_DIR}/stellarium-patch.iss @ONLY)
ENDIF()
# Nothing's here right now IF(APPLE)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/data/Info.plist.cmake ${CMAKE_SOURCE
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") _DIR}/data/Info.plist @ONLY)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") ENDIF()
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
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}/data/default_config.ini.cmake ${CMAKE_SO
URCE_DIR}/data/default_config.ini @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/data/updates.json.cmake ${CMAKE_SOURCE_D
IR}/data/updates.json @ONLY)
########### uninstall files ############### ########### uninstall files ###############
CONFIGURE_FILE( CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/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.cmake" ) "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
########### Packaging info for CPack ########### ########### Packaging info for CPack ###########
skipping to change at line 467 skipping to change at line 439
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <stellarium- pubdevel@lists.sourceforge.net>") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <stellarium- 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()
########### Macosx Bundling ############### ########### Macosx Bundling ###############
IF(APPLE) IF(APPLE)
ADD_CUSTOM_TARGET( # ${Qt5Core_INCLUDE_DIRS} is a list; I'm expecting the first entry t
macosx_bundle o always be QtCore.framework.
bash util/macosx_bundle.sh ${CMAKE_INSTALL_PREFIX} ${PROJECT_SOURCE_DIR} ADD_CUSTOM_TARGET(
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Stellarium.app mac_app
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} python util/mac_app.py ${CMAKE_INSTALL_PREFIX} ${PROJECT_SOU
COMMENT "making the macosx bundle." RCE_DIR} ${CMAKE_BUILD_TYPE} ${Qt5Core_INCLUDE_DIRS}
VERBATIM DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Stellarium.app
) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "making the macosx bundle."
VERBATIM
)
ENDIF() ENDIF()
########### Generate doxygen doc ############### ########### Generate doxygen doc ###############
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_ DIR}/Doxyfile @ONLY) CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_ DIR}/Doxyfile @ONLY)
ADD_CUSTOM_TARGET(apidoc doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKI NG_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate the doxygen docu mentation into the doc directory.") ADD_CUSTOM_TARGET(apidoc doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKI NG_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate the doxygen docu mentation into the doc directory.")
##################### 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_DIR})
STRING(REPLACE "/" "\\" PROJECT_BINARY_DIR_WINPATH ${PROJECT_BINARY_DIR}) STRING(REPLACE "/" "\\" PROJECT_BINARY_DIR_WINPATH ${PROJECT_BINARY_DIR})
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/util/copy-translations.bat.cmake ${PR OJECT_SOURCE_DIR}/util/copy-translations.bat @ONLY NEWLINE_STYLE WIN32) CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/util/copy-translations.bat.cmake ${PR OJECT_SOURCE_DIR}/util/copy-translations.bat @ONLY NEWLINE_STYLE WIN32)
ENDIF(WIN32) 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/renderer
${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/core/external
${CMAKE_SOURCE_DIR}/src/core/external/kfilter ${CMAKE_SOURCE_DIR}/src/core/external/qtcompress
${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/ ${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/
${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/libtess ${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/libtess
${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/scripting ${CMAKE_SOURCE_DIR}/src/scripting
${INTL_INCLUDE_DIR} ${INTL_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/src ${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()
 End of changes. 51 change blocks. 
498 lines changed or deleted 329 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/