CMakeLists.txt   CMakeLists.txt 
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Avoid repeating the IF statement in the ENDIF and ELSE
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
########### Project name ########### ########### Project name ###########
PROJECT(Stellarium) PROJECT(Stellarium)
SET(STELLARIUM_MAJOR "0") SET(STELLARIUM_MAJOR "0")
SET(STELLARIUM_MINOR "10") SET(STELLARIUM_MINOR "10")
SET(STELLARIUM_PATCH "0") SET(STELLARIUM_PATCH "1")
SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}") SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")
SET(PACKAGE stellarium) SET(PACKAGE stellarium)
########### Main global variables ########### ########### Main global variables ###########
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, opti
"Choose the type of build, options are: None Debug Release RelWithDeb ons are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
Info MinSizeRel." ENDIF()
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(MACOSX 1) SET(APPLE 1)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ENDIF()
IF(UNIX AND NOT WIN32) IF(UNIX AND NOT WIN32)
SET(CMAKE_C_FLAGS -Wall) # additional C compile flags SET(CMAKE_C_FLAGS -Wall) # additional C compile flags
SET(CMAKE_CXX_FLAGS -Wall) # additional CPP compile flags SET(CMAKE_CXX_FLAGS -Wall) # additional CPP compile flags
ELSE(UNIX AND NOT WIN32) ELSE()
SET(CMAKE_C_FLAGS "-Wall -fexceptions -fident -mthreads") SET(CMAKE_C_FLAGS "-Wall -fexceptions -fident -mthreads")
SET(CMAKE_CXX_FLAGS "-Wall -Wsign-promo -fexceptions -fident -mthreads") SET(CMAKE_CXX_FLAGS "-Wall -Wsign-promo -fexceptions -fident -mthreads")
SET(CMAKE_EXE_LINKER_FLAGS "-Wsign-promo -fexceptions -fident -mthreads") SET(CMAKE_EXE_LINKER_FLAGS "-Wsign-promo -fexceptions -fident -mthreads -m
ENDIF(UNIX AND NOT WIN32) windows --large-address-aware")
ENDIF()
# best way to get to MACOSX? # best way to get to APPLE?
IF(MACOSX) IF(APPLE)
SET(CMAKE_INCLUDE_PATH "/usr/X11/include:/usr/X11/include/freetype2:/Devel oper/SDKs/MacOSX10.5.sdk/usr/X11/include:/Developer/SDKs/MacOSX10.5.sdk/usr /X11/include/freetype2:/sw/include:${CMAKE_INCLUDE_PATH}") SET(CMAKE_INCLUDE_PATH "/usr/X11/include:/usr/X11/include/freetype2:/Devel oper/SDKs/MacOSX10.5.sdk/usr/X11/include:/Developer/SDKs/MacOSX10.5.sdk/usr /X11/include/freetype2:/sw/include:${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib:/sw/lib :${CMAKE_LIBRARY_PATH}") SET(CMAKE_LIBRARY_PATH "/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib:/sw/lib :${CMAKE_LIBRARY_PATH}")
SET(CMAKE_C_FLAGS "-fno-common -Wall -DMACOSX -I/Developer/SDKs/MacOSX10.5 .sdk/usr/X11/include -I/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/freet ype2") SET(CMAKE_C_FLAGS "-fno-common -Wall -DMACOSX -I/Developer/SDKs/MacOSX10.5 .sdk/usr/X11/include -I/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/freet ype2")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "-dylib_file /System/Library/Frameworks/OpenGL. framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenG L.framework/Versions/A/Libraries/libGL.dylib") SET(CMAKE_EXE_LINKER_FLAGS "-dylib_file /System/Library/Frameworks/OpenGL. framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenG L.framework/Versions/A/Libraries/libGL.dylib")
ENDIF(MACOSX) ENDIF()
########### Check headers ########### ########### Check headers ###########
INCLUDE(CheckIncludeFiles) INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES( byteswap.h HAVE_BYTESWAP_H) CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
########### Check functions ########### ########### Check functions ###########
INCLUDE(CheckFunctionExists) INCLUDE(CheckFunctionExists)
#toupper strcasecmp strdup putenv setlocale tzset strchr pow10 timegm #toupper strcasecmp strdup putenv setlocale tzset strchr pow10 timegm
CHECK_FUNCTION_EXISTS(tzset HAVE_TZSET) CHECK_FUNCTION_EXISTS(tzset HAVE_TZSET)
CHECK_FUNCTION_EXISTS(pow10 HAVE_POW10) CHECK_FUNCTION_EXISTS(pow10 HAVE_POW10)
CHECK_FUNCTION_EXISTS(setlocale HAVE_SETLOCALE) CHECK_FUNCTION_EXISTS(setlocale HAVE_SETLOCALE)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
########### Others ########### ########### Others ###########
# Activate translation with gettext # Activate translation with gettext
SET(ENABLE_NLS 1) SET(RELEASE_BUILD 1 CACHE BOOL "Flag this build as an official release, 1 o
r 0.")
SET(ENABLE_NLS 1 CACHE BOOL "Define whether program translation should be s
upported, option are: 1 or 0.")
# Generate python wrappers # Generate python wrappers
SET(GENERATE_PYTHON_WRAPPERS 0 CACHE BOOL "Define whether python wrapper sh ould be build using SIP, options are: 1 or 0.") SET(GENERATE_PYTHON_WRAPPERS 0 CACHE BOOL "Define whether python wrapper sh ould be build using SIP, options are: 1 or 0.")
# Create a dynamic library libstelMain # Create a dynamic library libstelMain
SET(GENERATE_STELMAINLIB 0) SET(GENERATE_STELMAINLIB 0)
# Activate sound support
SET(ENABLE_SOUND 0 CACHE BOOL "Define whether sound support should be activ
ated, options are: 1 or 0.")
SET(ENABLE_STRATOSCRIPT_COMPAT 0 CACHE BOOL "Set to 1 or true if you want t
o build the Stratoscript compatibility mode")
# 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 plug-ins afterward # This is for allowing to link plug-ins afterward
IF (WIN32 OR GENERATE_PYTHON_WRAPPERS) IF (WIN32 OR GENERATE_PYTHON_WRAPPERS)
SET(GENERATE_STELMAINLIB 1) SET(GENERATE_STELMAINLIB 1)
ENDIF(WIN32 OR GENERATE_PYTHON_WRAPPERS) ENDIF()
IF(WIN32) IF(WIN32)
LINK_LIBRARIES(wsock32) LINK_LIBRARIES(wsock32)
ENDIF(WIN32) ENDIF()
IF(COMMAND cmake_policy) IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW) CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy) ENDIF()
########### Find packages ########### ########### Find packages ###########
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
SET(QT_MIN_VERSION "4.4.1") SET(QT_MIN_VERSION "4.4.2")
FIND_PACKAGE(Qt4 REQUIRED) FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTSCRIPT TRUE) SET(QT_USE_QTSCRIPT TRUE)
SET(QT_USE_QTNETWORK TRUE) SET(QT_USE_QTNETWORK TRUE)
IF(ENABLE_SOUND)
SET(QT_USE_PHONON TRUE)
ADD_DEFINITIONS(-DHAVE_QT_PHONON)
ENDIF()
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
SET(SDL_LIBRARY "")
FIND_PACKAGE(SDL_mixer)
IF(SDLMIXER_LIBRARY)
MESSAGE(STATUS "Found SDL_mixer. Activate sound support.")
SET(HAVE_SDL_SDL_MIXER_H 1)
ELSE(SDLMIXER_LIBRARY)
MESSAGE(STATUS "No sound support.")
SET(SDLMIXER_INCLUDE_DIR "")
SET(SDLMIXER_LIBRARY "")
ENDIF(SDLMIXER_LIBRARY)
IF(ENABLE_NLS) IF(ENABLE_NLS)
FIND_PACKAGE(Iconv REQUIRED) FIND_PACKAGE(Iconv REQUIRED)
FIND_PATH(INTL_INCLUDE_DIR libintl.h FIND_PATH(INTL_INCLUDE_DIR libintl.h
/usr/include /usr/include
/usr/local/include) /usr/local/include)
FIND_LIBRARY(INTL_LIBRARIES intl c FIND_LIBRARY(INTL_LIBRARIES intl c
PATHS PATHS
/usr/lib/ /usr/lib/
/usr/local/lib) /usr/local/lib)
FIND_PACKAGE(Gettext REQUIRED) FIND_PACKAGE(Gettext REQUIRED)
ENDIF(ENABLE_NLS) ENDIF()
FIND_PACKAGE(OpenGL REQUIRED) FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(JPEG REQUIRED) FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(Boost REQUIRED) FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(FreeType2 REQUIRED) FIND_PACKAGE(FreeType2 REQUIRED)
########### Set some global variables ########### ########### Set some global variables ###########
IF(UNIX AND NOT WIN32) IF(UNIX AND NOT WIN32)
IF(MACOSX) IF(APPLE)
SET(CMAKE_INSTALL_PREFIX "/Users/Shared/stellarium/Stellarium.app/Content s") SET(CMAKE_INSTALL_PREFIX "/Users/Shared/stellarium/Stellarium.app/Content s")
SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/Resources/data") SET(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/Resources/data")
SET(INSTALL_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/Resources/locale") SET(INSTALL_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/Resources/locale")
ELSE(MACOSX) ELSE(APPLE)
SET(INSTALL_DATADIR ${CMAKE_INSTALL_PREFIX}/share/stellarium) SET(INSTALL_DATADIR ${CMAKE_INSTALL_PREFIX}/share/stellarium)
SET(INSTALL_LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) SET(INSTALL_LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
ENDIF(MACOSX) ENDIF(APPLE)
ELSE(UNIX AND NOT WIN32) ELSE()
SET(INSTALL_DATADIR .) SET(INSTALL_DATADIR .)
SET(INSTALL_LOCALEDIR ./locale) SET(INSTALL_LOCALEDIR ./locale)
ENDIF(UNIX AND NOT WIN32) ENDIF()
########### Get SVN revision for non-release builds ###########
IF(NOT RELEASE_BUILD)
FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} StelSvn)
# MESSAGE("Current SVN revision is ${StelSvn_WC_REVISION}")
SET(SVN_REVISION ${StelSvn_WC_REVISION})
ENDIF()
ENDIF()
IF(ENABLE_STRATOSCRIPT_COMPAT)
ADD_DEFINITIONS(-DENABLE_STRATOSCRIPT_COMPAT)
ENDIF()
########### Generate a config.h ########### ########### Generate a config.h ###########
INCLUDE(TestBigEndian) INCLUDE(TestBigEndian)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN) TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
SET(PACKAGE_VERSION ${VERSION}) SET(PACKAGE_VERSION ${VERSION})
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/confi g.h) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/confi g.h)
########### Add macros ########### ########### Add macros ###########
ADD_DEFINITIONS(-DHAVE_CONFIG_H) ADD_DEFINITIONS(-DHAVE_CONFIG_H)
IF(CMAKE_BUILD_TYPE STREQUAL "Release") IF(CMAKE_BUILD_TYPE STREQUAL "Release")
ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_NO_DEBUG)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") ADD_DEFINITIONS(-DNDEBUG)
ENDIF()
########### 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" )
skipping to change at line 166 skipping to change at line 179
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-${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/" "builds/" "Stellari um.tag$" "Stellarium.kdevelop.pcs$" "~$" "\\\\.swp$" "\\\\.#" "/#") SET(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/.svn/" "/.git/" "builds/" "Stellari um.tag$" "Stellarium.kdevelop.pcs$" "~$" "\\\\.swp$" "\\\\.#" "/#")
INCLUDE(CPack) INCLUDE(CPack)
########### Generate doxygen doc ############### ########### Generate doxygen doc ###############
ADD_CUSTOM_TARGET(apidoc doxygen Doxyfile WORKING_DIRECTORY ${PROJECT_SOURC E_DIR} COMMENT "Generate the doxygen documentation into the builds/doc dire ctory.") ADD_CUSTOM_TARGET(apidoc doxygen Doxyfile WORKING_DIRECTORY ${PROJECT_SOURC E_DIR} COMMENT "Generate the doxygen documentation into the builds/doc dire ctory.")
########### enable testing ########### ########### enable testing ###########
ENABLE_TESTING() ENABLE_TESTING()
########### 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 )
ADD_SUBDIRECTORY( po ) IF(ENABLE_NLS)
ADD_SUBDIRECTORY( po )
ENDIF()
ADD_SUBDIRECTORY( landscapes ) ADD_SUBDIRECTORY( landscapes )
ADD_SUBDIRECTORY( skycultures ) ADD_SUBDIRECTORY( skycultures )
ADD_SUBDIRECTORY( nebulae ) ADD_SUBDIRECTORY( nebulae )
ADD_SUBDIRECTORY( scripts ) ADD_SUBDIRECTORY( scripts )
ADD_SUBDIRECTORY( stars ) ADD_SUBDIRECTORY( stars )
IF (GENERATE_PYTHON_WRAPPERS) IF (GENERATE_PYTHON_WRAPPERS)
ADD_SUBDIRECTORY( sip ) ADD_SUBDIRECTORY( sip )
ENDIF(GENERATE_PYTHON_WRAPPERS) ENDIF()
########### Macosx Bundling ############### ########### Macosx Bundling ###############
IF(MACOSX) IF(APPLE)
ADD_CUSTOM_TARGET(macosx_bundle mv ${CMAKE_INSTALL_PREFIX}/bin ${CMAKE_INST ADD_CUSTOM_TARGET(macosx_bundle bash util/macosx_bundle.sh ${CMAKE_INSTALL_
ALL_PREFIX}/MacOS COMMAND mv ${CMAKE_INSTALL_PREFIX}/share ${CMAKE_INSTALL_ PREFIX} ${PROJECT_SOURCE_DIR} DEPENDS install WORKING_DIRECTORY ${PROJECT_S
PREFIX}/Resources COMMAND mv ${CMAKE_INSTALL_PREFIX}/Resources/stellarium/* OURCE_DIR} COMMENT "making the macosx bundle." VERBATIM)
${CMAKE_INSTALL_PREFIX}/Resources COMMAND rmdir ${CMAKE_INSTALL_PREFIX}/Re ENDIF()
sources/stellarium COMMAND mkdir ${CMAKE_INSTALL_PREFIX}/Frameworks COMMAND
perl util/pkgApp.pl ${CMAKE_INSTALL_PREFIX} MacOS/stellarium Frameworks DE
PENDS install WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "making the m
acosx bundle." VERBATIM)
ENDIF(MACOSX)
 End of changes. 27 change blocks. 
45 lines changed or deleted 66 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/