diff --git a/CMakeLists.txt b/CMakeLists.txt index 52b131895..bec5194cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,446 +1,452 @@ PROJECT(kstars CXX C) set (KStars_VERSION_MAJOR 2) set (KStars_VERSION_MINOR 9) set (KStars_VERSION_REVISION 6) set (CMAKE_CXX_STANDARD 11) #Build KStars Lite with -DKSTARS_LITE=ON option(BUILD_KSTARS_LITE "Build KStars Lite" OFF) # minimal requirements cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) string(TIMESTAMP KSTARS_BUILD_TS UTC) if(BUILD_KSTARS_LITE) set (QT_MIN_VERSION "5.7.0") #QtQuickControls 2 is available only in the Qt 5.7.0 else() set (QT_MIN_VERSION "5.4.0") endif() # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) # Ccache support IF (ANDROID OR UNIX OR APPLE) FIND_PROGRAM(CCACHE_FOUND ccache) SET(CCACHE_SUPPORT OFF CACHE BOOL "Enable ccache support") IF ((CCACHE_FOUND OR ANDROID) AND CCACHE_SUPPORT MATCHES ON) SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) ENDIF () ENDIF () if(CMAKE_SYSTEM_NAME STREQUAL Android) add_definitions(-DANDROID -D__STDC_LIMIT_MACROS) set(ANDROID TRUE) endif() -if(CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) +if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") include(${CMAKE_BINARY_DIR}/kf5/kde/install/share/ECM/cmake/ECMConfig.cmake) endif() find_package(ECM 1.7.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) if(BUILD_KSTARS_LITE) - if(CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) + if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") set(QT_ANDROID $ENV{QT_ANDROID}) + set(Qt5Core_DIR "${QT_ANDROID}/lib/cmake/Qt5Core") + set(Qt5Gui_DIR "${QT_ANDROID}/lib/cmake/Qt5Gui") + set(Qt5Network_DIR "${QT_ANDROID}/lib/cmake/Qt5Network") + set(Qt5Qml_DIR "${QT_ANDROID}/lib/cmake/Qt5Qml") + set(Qt5Quick_DIR "${QT_ANDROID}/lib/cmake/Qt5Quick") + set(Qt5Widgets_DIR "${QT_ANDROID}/lib/cmake/Qt5Widgets") include(${QT_ANDROID}/lib/cmake/Qt5/Qt5Config.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Core/Qt5CoreConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Qml/Qt5QmlConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Quick/Qt5QuickConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5QuickControls2/Qt5QuickControls2Config.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Xml/Qt5XmlConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Svg/Qt5SvgConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Sql/Qt5SqlConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Network/Qt5NetworkConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Positioning/Qt5PositioningConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5Concurrent/Qt5ConcurrentConfig.cmake) include(${QT_ANDROID}/lib/cmake/Qt5AndroidExtras/Qt5AndroidExtrasConfig.cmake) else() if(ANDROID) list(APPEND QT_EXTRA_COMPONENTS AndroidExtras) else() list(APPEND QT_EXTRA_COMPONENTS PrintSupport) endif() find_package(Qt5 5.7 REQUIRED COMPONENTS Gui Qml Quick QuickControls2 Xml Svg Sql Network Positioning Concurrent WebSockets ${QT_EXTRA_COMPONENTS}) endif() else() #find_package(Qt5 5.4 REQUIRED COMPONENTS Gui Qml Quick Xml Sql Svg Network PrintSupport Positioning Concurrent) find_package(Qt5 5.4 REQUIRED COMPONENTS Gui Qml Quick Xml Sql Svg Network PrintSupport Concurrent WebSockets) endif() include(ExternalProject) include(ECMInstallIcons) include(ECMAddAppIcon) include(KDEInstallDirs) include(MacroBoolTo01) include(ECMQtDeclareLoggingCategory) -if(NOT CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) +if (NOT "${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") #We get error "could not find main method" with this module include(KDECompilerSettings NO_POLICY_SCOPE) endif() include(KDECMakeSettings) include(FeatureSummary) # Load the frameworks we need if(BUILD_KSTARS_LITE) - if(CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) + if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") set(KF5_VERSION 5.28.0) set(KF5_HOST_TOOLING /usr/lib/x86_64-linux-gnu/cmake/) include(${CMAKE_BINARY_DIR}/kf5/kde/install/lib/cmake/KF5Config/KF5ConfigConfig.cmake) include(${CMAKE_BINARY_DIR}/kf5/kde/install/lib/cmake/KF5I18n/KF5I18nConfig.cmake) include(${CMAKE_BINARY_DIR}/kf5/kde/install/lib/cmake/KF5Plotting/KF5PlottingConfig.cmake) else() # Find Optional package NotifyConfig for desktop notifications find_package(KF5 COMPONENTS NotifyConfig) MACRO_BOOL_TO_01(KF5NotifyConfig_FOUND HAVE_NOTIFYCONFIG) find_package(KF5 REQUIRED COMPONENTS Auth Config Crash DocTools WidgetsAddons NewStuff I18n KIO XmlGui Plotting Notifications) endif() else(BUILD_KSTARS_LITE) # Find Optional package NotifyConfig for desktop notifications find_package(KF5 COMPONENTS NotifyConfig) MACRO_BOOL_TO_01(KF5NotifyConfig_FOUND HAVE_NOTIFYCONFIG) find_package(KF5 REQUIRED COMPONENTS Auth Config Crash DocTools WidgetsAddons NewStuff I18n KIO XmlGui Plotting Notifications ) endif(BUILD_KSTARS_LITE) ## Eigen3 Library find_package(Eigen3 REQUIRED) add_definitions(${EIGEN_DEFINITIONS}) include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) ## CFITSIO Library if(ANDROID) - if(CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) + if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") set(extra_cmake "-DM_LIB=-lm") endif() externalproject_add(cfitsio SOURCE_DIR "${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio" URL https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3370.tar.gz PATCH_COMMAND bash -c "cd ${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio && dos2unix ${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio/CMakeLists.txt && patch -p1 < ${CMAKE_SOURCE_DIR}/android/3rdparty/cfitsio.patch" CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${extra_cmake} BUILD_COMMAND make cfitsio BUILD_IN_SOURCE 1 INSTALL_COMMAND "") set(CFITSIO_FOUND TRUE) set(CFITSIO_INCLUDE_DIR PUBLIC ${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio) set(CFITSIO_LIBRARIES ${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio/libcfitsio.a) else() if(BUILD_KSTARS_LITE) find_package(CFitsio REQUIRED) else() find_package(CFitsio) endif() endif() MACRO_BOOL_TO_01(CFITSIO_FOUND HAVE_CFITSIO) set_package_properties(CFitsio PROPERTIES DESCRIPTION "FITS IO Library" URL "http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html" TYPE OPTIONAL PURPOSE "Support for the FITS (Flexible Image Transport System) data format in KStars.") ## INDI Library if (ANDROID) set(QT_ANDROID $ENV{QT_ANDROID}) - if(CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) - set(extra_cmake -DCMAKE_AR=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar) + if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") + set(extra_cmake -DCMAKE_AR=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar) endif() externalproject_add(indi SOURCE_DIR "${CMAKE_BINARY_DIR}/android/indi" URL https://github.com/indilib/indi/archive/master.zip CONFIGURE_COMMAND cd libindi && cmake . -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \\ -DINDI_BUILD_POSIX_CLIENT=OFF -DINDI_BUILD_SERVER=OFF -DINDI_BUILD_DRIVERS=OFF -DINDI_BUILD_UNITTESTS=OFF \\ -DINDI_BUILD_DRIVERS=OFF -DINDI_BUILD_QT5_CLIENT=ON -DINDI_CALCULATE_MINMAX=ON \\ -DCFITSIO_DIR=${CMAKE_BINARY_DIR}/android/3rdparty/cfitsio -DQT_ANDROID=${QT_ANDROID} -DCMAKE_PREFIX_PATH=${QT_ANDROID} ${extra_cmake} BUILD_COMMAND make -C libindi BUILD_IN_SOURCE 1 INSTALL_COMMAND "") set(INDI_FOUND TRUE) set(INDI_INCLUDE_DIR ${CMAKE_BINARY_DIR}/android/indi/libindi/libs/indibase ${CMAKE_BINARY_DIR}/android/indi/libindi ${CMAKE_BINARY_DIR}/android/indi/libindi/libs) set(INDI_CLIENT_ANDROID_LIBRARIES ${CMAKE_BINARY_DIR}/android/indi/libindi/libindiclientqt.a) else () find_package(INDI 1.7.1) endif () MACRO_BOOL_TO_01(INDI_FOUND HAVE_INDI) set_package_properties(INDI PROPERTIES DESCRIPTION "Astronomical instrumentation control" URL "http://www.indilib.org" TYPE OPTIONAL PURPOSE "Support for controlling astronomical devices on Linux with KStars.") ## Libraw if(BUILD_KSTARS_LITE AND ANDROID) # OpenMP needed for LibRaw set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp -DLIBRAW_USE_OPENMP") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -DLIBRAW_USE_OPENMP") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgomp") externalproject_add(raw SOURCE_DIR "${CMAKE_BINARY_DIR}/android/3rdparty/libraw" URL https://www.libraw.org/data/LibRaw-0.17.2.tar.gz PATCH_COMMAND bash -c "cd ${CMAKE_BINARY_DIR}/android/3rdparty/libraw && wget -qO- https://github.com/LibRaw/LibRaw-cmake/archive/master.zip | jar xvf /dev/stdin && rm -rf cmake && mv -f LibRaw-cmake-master/CMakeLists.txt LibRaw-cmake-master/cmake . && patch -p1 < ${CMAKE_SOURCE_DIR}/android/3rdparty/libraw.patch" CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_OPENMP=OFF -DENABLE_LCMS=OFF BUILD_COMMAND make raw BUILD_IN_SOURCE 1 INSTALL_COMMAND "") include_directories(${CMAKE_BINARY_DIR}/android/3rdparty/libraw) set(LIBRAW_LIBRARIES ${CMAKE_BINARY_DIR}/android/3rdparty/libraw/libraw.a) set(LibRaw_FOUND true) else() find_package(LibRaw) endif() MACRO_BOOL_TO_01(LibRaw_FOUND HAVE_LIBRAW) set_package_properties(LibRaw PROPERTIES DESCRIPTION "Library for reading RAW files" URL "http://www.libraw.org" TYPE OPTIONAL PURPOSE "Support for reading and displaying RAW files in KStars.") ## WCS Library find_package(WCSLIB) MACRO_BOOL_TO_01(WCSLIB_FOUND HAVE_WCSLIB) set_package_properties(WCSLIB PROPERTIES DESCRIPTION "World Coordinate System library" URL "http://www.atnf.csiro.au/people/mcalabre/WCS" TYPE OPTIONAL PURPOSE "WCS enables KStars to read and process world coordinate systems in FITS header.") ## XPlanet find_package(Xplanet) set_package_properties(Xplanet PROPERTIES DESCRIPTION "Renders an image of all the major planets and most satellites" URL "http://xplanet.sourceforge.net" TYPE RUNTIME PURPOSE "Gives KStars support for xplanet.") # Qt5 Data Visualization find_package(Qt5DataVisualization) MACRO_BOOL_TO_01(Qt5DataVisualization_FOUND HAVE_DATAVISUALIZATION) ## Astrometry.net find_package(AstrometryNet) set_package_properties(AstrometryNet PROPERTIES DESCRIPTION "Astrometrics Library" URL "http://www.astrometry.net" TYPE RUNTIME PURPOSE "Support for plate solving in KStars.") ## Key Chain find_package(Qt5Keychain) MACRO_BOOL_TO_01(Qt5Keychain_FOUND HAVE_KEYCHAIN) ## OpenGL find_package(OpenGL) set_package_properties(OpenGL PROPERTIES DESCRIPTION "Open Graphics Library" URL "http://www.opengl.org" TYPE OPTIONAL PURPOSE "Support for hardware rendering in KStars.") if (${KF5_VERSION} VERSION_GREATER 5.17.0) SET(HAVE_KF5WIT 1) else() SET(HAVE_KF5WIT 0) endif() add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DQT_STRICT_ITERATORS) endif() add_definitions(-DQT_NO_CAST_TO_ASCII) if (UNIX) add_definitions(-Dfexceptions) # TEMPORARY: To disable QCustomPlot warning until 2.0.0 is released which fixes these warnings SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-virtual-dtor") # Optimize binary size by dropping unneeded symbols at linking stage if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") endif() endif(UNIX) # Add security (hardening flags) IF (UNIX OR APPLE OR ANDROID) SET(SEC_COMP_FLAGS "-D_FORTIFY_SOURCE=2 -fstack-protector-all -Wcast-align -fPIE") IF (NOT ANDROID AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT APPLE) SET(SEC_COMP_FLAGS "${SEC_COMP_FLAGS} -Wa,--noexecstack") ENDIF () SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SEC_COMP_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}") SET(SEC_LINK_FLAGS "") IF (NOT APPLE) SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") ENDIF () IF (NOT ANDROID AND NOT APPLE) SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -pie") ENDIF () SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SEC_LINK_FLAGS}") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SEC_LINK_FLAGS}") ENDIF () # Clang Format support IF (UNIX OR APPLE) SET(FORMAT_CODE OFF CACHE BOOL "Enable Clang Format") IF (FORMAT_CODE MATCHES ON) FILE(GLOB_RECURSE ALL_SOURCE_FILES *.c *.cpp *.h) FOREACH(SOURCE_FILE ${ALL_SOURCE_FILES}) STRING(FIND ${SOURCE_FILE} ${CMAKE_SOURCE_DIR} DIR_FOUND) IF (NOT ${DIR_FOUND} EQUAL 0) LIST(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE}) ENDIF () ENDFOREACH () FIND_PROGRAM(CLANGFORMAT_EXE NAMES clang-format-5.0) IF (CLANGFORMAT_EXE) ADD_CUSTOM_TARGET(clang-format COMMAND ${CLANGFORMAT_EXE} -style=file -i ${ALL_SOURCE_FILES}) ENDIF () ENDIF () ENDIF () SET(FIX_WARNINGS OFF CACHE BOOL "Enable strict compilation mode to turn compiler warnings to errors") # Warning, debug and linker flags IF (UNIX OR APPLE) SET(COMP_FLAGS "") SET(LINKER_FLAGS "") # Verbose warnings and turns all to errors SET(COMP_FLAGS "${COMP_FLAGS} -Wall -Wextra") IF (FIX_WARNINGS) SET(COMP_FLAGS "${COMP_FLAGS} -Werror") ENDIF () # Omit problematic warnings IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") SET(COMP_FLAGS "${COMP_FLAGS} -Wno-unused-but-set-variable") ENDIF () IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.9.9) SET(COMP_FLAGS "${COMP_FLAGS} -Wno-format-truncation") ENDIF () IF (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") SET(COMP_FLAGS "${COMP_FLAGS} -Wno-nonnull -Wno-deprecated-declarations") ENDIF () IF (BUILD_KSTARS_LITE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") SET(COMP_FLAGS "${COMP_FLAGS} -Wno-overloaded-virtual") ENDIF () SET(COMP_FLAGS "${COMP_FLAGS} -g") # Note: The following flags are problematic on older systems with gcc 4.8 IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9.9)) IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") SET(COMP_FLAGS "${COMP_FLAGS} -Wno-unused-command-line-argument") ENDIF () FIND_PROGRAM(LDGOLD_FOUND ld.gold) SET(LDGOLD_SUPPORT OFF CACHE BOOL "Enable ld.gold support") # Optional ld.gold is 2x faster than normal ld IF (LDGOLD_FOUND AND LDGOLD_SUPPORT MATCHES ON AND NOT APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES arm) SET(LINKER_FLAGS "${LINKER_FLAGS} -fuse-ld=gold") # We have Gsl library what is a special case for linking: # The gsl library must be linked with cblas. There are two alternatives for this: libcblas or libgslcblas. # For example, CMake gets the GSL_LIBRARIES linking flags from the pkgconfig (gsl.pc) file on Ubuntu. # This file defines -lgsl -lglscblas for linking flags and if KStars is compiled with Clang, the linker # finds out magically that KStars must be linked against glscblas library, but gslcblas is omitted in linking # stage if KStars is built with gcc. The linker must be instructed explicitly to link against all libraries # passed on command line by -Wl,--no-as-needed. SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--no-as-needed") # Use Identical Code Folding SET(COMP_FLAGS "${COMP_FLAGS} -ffunction-sections") SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--icf=safe") # Compress the debug sections # Note: Before valgrind 3.12.0, patch should be applied for valgrind (https://bugs.kde.org/show_bug.cgi?id=303877) IF (NOT APPLE AND NOT ANDROID AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES arm AND NOT CMAKE_CXX_CLANG_TIDY) SET(COMP_FLAGS "${COMP_FLAGS} -Wa,--compress-debug-sections") SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--compress-debug-sections=zlib") ENDIF () ENDIF () ENDIF () # Apply the flags SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMP_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMP_FLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}") ENDIF () # Sanitizer support SET(SANITIZERS OFF CACHE BOOL "Sanitizer support for gcc and Clang") IF (SANITIZERS AND ((UNIX AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR CMAKE_COMPILER_IS_GNUCXX) OR (APPLE AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCXX)))) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer") ENDIF () # Unity build support SET(UNITY_BUILD OFF CACHE BOOL "Enable Unity Build") INCLUDE(UnityBuild) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config-kstars.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kstars.h ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kstars/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kstars/version.h ) # let our config.h be found first in any case include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(doc) add_subdirectory(kstars) add_subdirectory(datahandlers) IF (NOT ANDROID) IF (BUILD_TESTING) enable_testing(true) add_subdirectory(Tests) ENDIF() # Make it possible to use the po files fetched by the fetch-translations step ki18n_install("${CMAKE_CURRENT_BINARY_DIR}/po") ENDIF () install(FILES org.kde.kstars.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) # Only build k5auth for Linux if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") # This helper file is generated to download astrometry.net index files. add_executable(kauth_kstars_helper kstars/auxiliary/downloadhelper.cpp ${helper_mocs}) target_link_libraries(kauth_kstars_helper Qt5::Core) target_link_libraries(kauth_kstars_helper Qt5::Widgets) target_link_libraries(kauth_kstars_helper KF5::Auth) install(TARGETS kauth_kstars_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR}) kauth_install_helper_files(kauth_kstars_helper org.kde.kf5auth.kstars root) kauth_install_actions(org.kde.kf5auth.kstars org.kde.kf5auth.kstars.actions) ENDIF () # Final package generation -if (CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) +if ("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") set(EXPORT_DIR "${CMAKE_BINARY_DIR}/android/kstars_build_apk/") set(ANDROID_APK_DIR "${CMAKE_SOURCE_DIR}/android/apk/") set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/armeabi-v7a/libkstars.so") set(ANDROID_NDK $ENV{ANDROID_NDK}) set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT}) set(ANDROID_API_LEVEL $ENV{ANDROID_API_LEVEL}) set(ANDROID_TOOLCHAIN arm-linux-androideabi) set(ANDROID_GCC_VERSION 4.9) set(ANDROID_ABI armeabi-v7a) set(_HOST "${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}") string(TOLOWER "${_HOST}" _HOST) set(ANDROID_SDK_BUILD_TOOLS_REVISION 21.1.1) set(ANDROID_KEYSTORE $ENV{ANDROID_KEYSTORE}) set(ANDROID_KEYSTORE_ALIAS $ENV{ANDROID_KEYSTORE_ALIAS}) configure_file("${CMAKE_SOURCE_DIR}/android/deployment-file.json.in" "${CMAKE_BINARY_DIR}/android/kstars-deployment.json.in") add_custom_target(create-apk-kstars COMMAND cmake -E echo "Generating $ with $/androiddeployqt" COMMAND cmake -E remove_directory "${EXPORT_DIR}" COMMAND cmake -E copy_directory "${CMAKE_SOURCE_DIR}/android/apk" "${EXPORT_DIR}" COMMAND cmake -E copy "$" "${EXECUTABLE_DESTINATION_PATH}" COMMAND cmake -DINPUT_FILE="${CMAKE_BINARY_DIR}/android/kstars-deployment.json.in" -DOUTPUT_FILE="${CMAKE_BINARY_DIR}/android/kstars-deployment.json" "-DTARGET_DIR=${CMAKE_BINARY_DIR}/kstars" "-DTARGET_NAME=kstars" "-DEXPORT_DIR=${CMAKE_INSTALL_PREFIX}" -P ${CMAKE_SOURCE_DIR}/android/specifydependencies.cmake COMMAND $/androiddeployqt --input "${CMAKE_BINARY_DIR}/android/kstars-deployment.json" --output "${EXPORT_DIR}" --android-platform android-${ANDROID_API_LEVEL} --debug --deployment bundled "\\$(ARGS)" COMMAND $/androiddeployqt --input "${CMAKE_BINARY_DIR}/android/kstars-deployment.json" --output "${EXPORT_DIR}" --android-platform android-${ANDROID_API_LEVEL} --release --deployment bundled "\\$(ARGS)" ) if (ANDROID_KEYSTORE AND ANDROID_KEYSTORE_ALIAS) add_custom_target(sign-apk-kstars COMMAND jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${ANDROID_KEYSTORE} ${CMAKE_BINARY_DIR}/android/kstars_build_apk/bin/QtApp-release-unsigned.apk ${ANDROID_KEYSTORE_ALIAS} COMMAND rm -rf ${CMAKE_BINARY_DIR}/android/kstars_build_apk/bin/kstars-signed.apk COMMAND zipalign -v 4 ${CMAKE_BINARY_DIR}/android/kstars_build_apk/bin/QtApp-release-unsigned.apk ${CMAKE_BINARY_DIR}/android/kstars_build_apk/bin/kstars-signed.apk ) endif () endif () diff --git a/README.android b/README.android index f07d3f502..98330cb51 100644 --- a/README.android +++ b/README.android @@ -1,61 +1,68 @@ Only Linux cross-compilation to Android is supported. Prerequisites: - Install Android NDK and Android SDK - Install Qt 5.7+ for Android under your home directory to be writable. Unfortunately, there is a Qt bug (https://bugreports.qt.io/browse/QTBUG-54666) what can be fixed by only patching one cmake config file. The build files will comment the problematic line. - Get KStars source code from from Github or KDE - Some tools are needed for the compilation: sudo apt-get install dos2unix ccache Set the following environmental variables before building: export QT_ANDROID=Qt SDK for Android target (e.g. /opt/Qt/5.9.2/android_armv7"} -export ANDROID_NDK=Android NDK path +export CMAKE_ANDROID_NDK=Android NDK path export ANDROID_SDK_ROOT=Android SDK path export ANDROID_API_LEVEL=Android API level (currently the minimum is 17) If you want to generate signed release package set the following variables: export ANDROID_KEYSTORE=your_keystore_file export ANDROID_KEYSTORE_ALIAS=your_keystore_alias export KSTARS_ROOT=KStars Path (e.g. /home/jasem/Projects/kstars) First build the KF5 dependencies separately: -1. Make a build directory in a separate location form source (e.g. /home/jasem/build/kstars-android): +- Make a build directory in a separate location form source (e.g. /home/jasem/build/kstars-android): -3. Run build_kf5.sh and verify that the script builds everything without any problem. +- Run build_kf5.sh and verify that the script builds everything without any problem. $KSTARS_ROOT/android/build_kf5.sh When KF5 are ready, build KStars Lite for Android: - Install Eigen3, git and other dependencies - Configure out-of-source build (MinSizeRel build type is recommended for Android): -cmake -B. -H$KSTARS_ROOT -DBUILD_KSTARS_LITE=ON -DCMAKE_TOOLCHAIN_FILE=$KSTARS_ROOT/android/toolchain-android.cmake \ +cmake -B. -H$KSTARS_ROOT -DBUILD_KSTARS_LITE=ON -DCMAKE_TOOLCHAIN_FILE=$CMAKE_ANDROID_NDK/build/cmake/android.toolchain.cmake \ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3/ -DCMAKE_INSTALL_PREFIX=$(pwd)/android/export -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DECM_DIR=/usr/share/ECM/cmake/ -DCMAKE_PREFIX_PATH=$QT_ANDROID \ -DCMAKE_AR=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar - Compile: make -j4 - Install: make -j4 install +- Qt does not work with the newest SDK Tools, you must use v25 as suggested here: + https://stackoverflow.com/questions/42754878/qt-creator-wont-list-any-available-android-build-sdks/42811774#42811774 + + Basically, download https://dl.google.com/android/repository/tools_r25.2.5-linux.zip and replace the ANDROID_SDK_DIR/tools directory or + just use the Android SDK download tool to use this version. + - Generate the Android debug and release packages: make create-apk-kstars - To sign a release package: make sign-apk-kstars - The debug package location: android/kstars_build_apk/bin/QtApp-debug.apk Install: adb install android/kstars_build_apk/bin/QtApp-debug.apk - The release package location: android/kstars_build_apk/bin/kstars-release-signed.apk Install: adb install android/kstars_build_apk/bin/kstars-signed.apk diff --git a/android/3rdparty/cfitsio.patch b/android/3rdparty/cfitsio.patch index 49aa5b8b9..886d2540e 100644 --- a/android/3rdparty/cfitsio.patch +++ b/android/3rdparty/cfitsio.patch @@ -1,46 +1,46 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index c749abb..051960d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ ENDIF() #add_subdirectory (src) -+IF(${CMAKE_TOOLCHAIN_FILE} MATCHES ".*toolchain-android.cmake") ++IF("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") + include(${CMAKE_TOOLCHAIN_FILE}) +ENDIF() + SET (LIB_TYPE STATIC) IF (BUILD_SHARED_LIBS) SET (LIB_TYPE SHARED) @@ -59,8 +63,6 @@ TARGET_LINK_LIBRARIES(${LIB_NAME} m ${PTHREADS_LIBRARY} ) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${LIB_DESTINATION}) -install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) ENABLE_TESTING() diff --git a/fitscore.c b/fitscore.c index 4c90df0..5e59cc1 100644 --- a/fitscore.c +++ b/fitscore.c @@ -9230,7 +9230,7 @@ int ffc2rr(const char *cval, /* I - string representation of the value */ if (!decimalpt) { /* only do this once for efficiency */ lcc = localeconv(); /* set structure containing local decimal point symbol */ - decimalpt = *(lcc->decimal_point); +// decimalpt = *(lcc->decimal_point); } errno = 0; @@ -9300,7 +9300,7 @@ int ffc2dd(const char *cval, /* I - string representation of the value */ if (!decimalpt) { /* only do this once for efficiency */ lcc = localeconv(); /* set structure containing local decimal point symbol */ - decimalpt = *(lcc->decimal_point); +// decimalpt = *(lcc->decimal_point); } errno = 0; diff --git a/android/3rdparty/libraw.patch b/android/3rdparty/libraw.patch index a8b50bc91..d88c01be4 100644 --- a/android/3rdparty/libraw.patch +++ b/android/3rdparty/libraw.patch @@ -1,78 +1,88 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 47f3869..f5df332 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,9 +114,16 @@ INCLUDE(MacroLogFeature) INCLUDE(MacroOptionalFindPackage) INCLUDE(MacroJPEG) -+IF(${CMAKE_TOOLCHAIN_FILE} MATCHES ".*toolchain-android.cmake") ++IF("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") + include(${CMAKE_TOOLCHAIN_FILE}) +ENDIF() +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/android-hack) + # Math library check -IF(NOT WIN32) -+IF(${CMAKE_TOOLCHAIN_FILE} MATCHES ".*toolchain-android.cmake") ++IF("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") + set(MATH_LIBRARY -lm) # toolchain-android.cmake can't find libm.so +ELSEIF(NOT WIN32) FIND_LIBRARY(MATH_LIBRARY m) ENDIF() +@@ -183,6 +183,8 @@ + # For registration to libraw_config.h + MACRO_BOOL_TO_01(JPEG8_FOUND LIBRAW_USE_DNGLOSSYCODEC) + ++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-narrowing") ++ + # OpenMP library check + + SET(OPENMP_FOUND false) diff --git a/android-hack/swab.h b/android-hack/swab.h new file mode 100644 index 0000000..061c61e --- /dev/null +++ b/android-hack/swab.h -@@ -0,0 +1,6 @@ +@@ -0,0 +1,7 @@ + +#pragma once + +#include ++#include + +void swab(const void *from, void*to, ssize_t n); +diff --git a/src/libraw_cxx.cpp b/src/libraw_cxx.cpp +index c977302..2112ba8 100644 +--- a/src/libraw_cxx.cpp ++++ b/src/libraw_cxx.cpp +@@ -16,6 +16,10 @@ it under the terms of the one of two licenses as you choose: + + */ + ++#if ANDROID ++#include ++#endif ++ + #include + #include + #include diff --git a/internal/dcraw_common.cpp b/internal/dcraw_common.cpp index 608641a..0f991e4 100644 --- a/internal/dcraw_common.cpp +++ b/internal/dcraw_common.cpp @@ -19,6 +19,24 @@ it under the terms of the one of two licenses as you choose: */ +#ifdef ANDROID -+#include + ++#include +#include +#include + -+void swab(const void *from, void*to, ssize_t n) -+{ -+ ssize_t i; -+ -+ if (n < 0) -+ return; ++void swab(const void *p_src_, void *p_dst_, ssize_t n) { ++ const uint8_t *p_src = (const uint8_t *)p_src_; ++ uint8_t *p_dst = (uint8_t *)p_dst_; uint8_t tmp; ssize_t i; + -+ for (i = 0; i < (n/2)*2; i += 2) -+ *((uint16_t*)to+i) = __arch__swab16(*((uint16_t*)from+i)); ++ if (n < 0) return; ++ for (i = 0; i < n - 1; i += 2) { ++ tmp = p_src[i + 0]; p_dst[i + 0] = p_src[i + 1]; ++ p_dst[i + 1] = tmp; ++ } +} +#endif + #include #define CLASS LibRaw:: #include "libraw/libraw_types.h" -diff --git a/src/libraw_cxx.cpp b/src/libraw_cxx.cpp -index c977302..2112ba8 100644 ---- a/src/libraw_cxx.cpp -+++ b/src/libraw_cxx.cpp -@@ -16,6 +16,10 @@ it under the terms of the one of two licenses as you choose: - - */ - -+#if ANDROID -+#include -+#endif -+ - #include - #include - #include diff --git a/android/build_kf5.sh b/android/build_kf5.sh index d3bf0643b..2464de7bb 100755 --- a/android/build_kf5.sh +++ b/android/build_kf5.sh @@ -1,54 +1,57 @@ #!/bin/bash : ${QT_ANDROID?"Qt Android SDK path must be set"} -: ${ANDROID_NDK?"Android NDK path must be set"} +: ${CMAKE_ANDROID_NDK?"Android NDK path must be set"} : ${ANDROID_SDK_ROOT?"Android SDK path must be set"} : ${ANDROID_API_LEVEL?"Android API level"} export ANDROID_ARCHITECTURE=arm export ANDROID_ABI=armeabi-v7a export ANDROID_TOOLCHAIN=arm-linux-androideabi export ANDROID_NATIVE_API_LEVEL=android-$ANDROID_API_LEVEL -# Get the directory where the script is stored + # Get the directory where the script is stored SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CURDIR="$(pwd)"/ #git clean -fdx # Clone the KF5 sources mkdir kf5 cd kf5 git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git mkdir -p extragear/kdesrc-build git clone git://anongit.kde.org/kdesrc-build extragear/kdesrc-build ln -s extragear/kdesrc-build/kdesrc-build kdesrc-build ln -s kdesrc-conf-android/kdesrc-buildrc kdesrc-buildrc # Change the build configuration sed -E -i "s|build-dir.*|build-dir $CURDIR/kf5/kde/build/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc sed -E -i "s|source-dir.*|source-dir $CURDIR/kf5/kde/src |g" kdesrc-conf-android/kdesrc-buildrc sed -E -i "s|kdedir.*|kdedir $CURDIR/kf5/kde/install/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc -sed -E -i "s|-DCMAKE_TOOLCHAIN_FILE=.*?\\ |-DCMAKE_TOOLCHAIN_FILE=$SRCDIR/toolchain-android-kf5.cmake |g" kdesrc-conf-android/kdesrc-buildrc +sed -i -- 's/make-options -j8/make-options -j4 VERBOSE=1/g' kdesrc-conf-android/kdesrc-buildrc if [ -e $qt_android_libs ] then - sed -E -i "s|-DCMAKE_PREFIX_PATH=.*?\\ |-DCMAKE_PREFIX_PATH=$QT_ANDROID |g" kdesrc-conf-android/kdesrc-buildrc + sed -E -i "s|-DCMAKE_PREFIX_PATH=.*?\\ |-DCMAKE_PREFIX_PATH=$QT_ANDROID -DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_ANDROID\;$CURDIR/kf5/kde/install -DANDROID_STL=gnustl_static |g" kdesrc-conf-android/kdesrc-buildrc else echo "Qt Android libraries path doesn't exist. Exiting." exit fi sed -E -i "s|use-modules.+|use-modules kconfig ki18n kplotting|g" kdesrc-conf-android/kdesrc-buildrc rm -rf ${kf5_android_path}/kde/build/${android_architecture}/* # clean build folders +# Build ki18n first to get the sources, it needs to be patched +./kdesrc-build libintl-lite ki18n +sed -i -- 's/target_link_libraries(ktranscript PRIVATE Qt5::Script Qt5::Core)/target_link_libraries(ktranscript PRIVATE Qt5::Script Qt5::Core -l:libc.a -Wl,--exclude-libs=ALL)/g' $CURDIR/kf5/kde/src/frameworks/ki18n/src/CMakeLists.txt ./kdesrc-build libintl-lite extra-cmake-modules frameworks-android # Fix some config files -sed -i '/find_package(Gettext/ s/^/#/' kde/install/lib/cmake/KF5I18n/KF5I18NMacros.cmake +sed -i '/find_package(Gettext/ s/^/#/' kde/install/lib/cmake/KFke sed -i '/find_package(PythonInterp/ s/^/#/' kde/install/lib/cmake/KF5I18n/KF5I18NMacros.cmake sed -i '/find_dependency(Qt5Xml/ s/^/#/' kde/install/lib/cmake/KF5Config/KF5ConfigConfig.cmake -sed -i '/cxx_decltype/ s/^/#/' ${QT_ANDROID}/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake +#sed -i '/cxx_decltype/ s/^/#/' ${QT_ANDROID}/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake cp /usr/lib/x86_64-linux-gnu/libexec/kf5/kconfig_compiler_kf5 $CURDIR/kf5/kde/install/lib/libexec/kf5/kconfig_compiler_kf5 cd $CURDIR diff --git a/android/toolchain-android-kf5.cmake b/android/toolchain-android-kf5.cmake deleted file mode 100644 index bfc256167..000000000 --- a/android/toolchain-android-kf5.cmake +++ /dev/null @@ -1,226 +0,0 @@ - -#.rst: -# AndroidToolchain -# ---------------- -# -# Enable easy compilation of cmake projects on Android. -# -# By using this android toolchain, the projects will be set up to compile the -# specified project targeting an Android platform, depending on its input. -# Furthermore, if desired, an APK can be directly generated by using the -# `androiddeployqt `_ tool. -# -# .. note:: -# -# This module requires CMake 3.1. -# -# Since 1.7.0. -# -# Usage -# ===== -# -# To use this file, you need to set the ``CMAKE_TOOLCHAIN_FILE`` to point to -# ``AndroidToolchain.cmake`` on the command line:: -# -# cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake -# -# You will also need to provide the locations of the Android NDK and SDK. This -# can be done on the commandline or with environment variables; in either case -# the variable names are: -# -# ``ANDROID_NDK`` -# The NSK root path. -# ``ANDROID_SDK_ROOT`` -# The SDK root path. -# -# Additional options are specified as cache variables (eg: on the command line): -# -# ``ANDROID_ARCHITECTURE`` -# The architecture to compile for. Default: ``arm``. -# ``ANDROID_TOOLCHAIN`` -# The toolchain to use. See the ``toolchains`` directory of the NDK. -# Default: ``arm-linux-androideabi``. -# ``ANDROID_ABI`` -# The ABI to use. See the ``sources/cxx-stl/gnu-libstdc++/*/libs`` -# directories in the NDK. Default: ``armeabi-v7a``. -# ``ANDROID_GCC_VERSION`` -# The GCC version to use. Default: ``4.9``. -# ``ANDROID_API_LEVEL`` -# The `API level -# `_ -# to require. Default: ``14``. -# ``ANDROID_SDK_BUILD_TOOLS_REVISION`` -# The build tools version to use. Default: ``21.1.1``. -# -# Deploying Qt Applications -# ========================= -# -# After building the application, you will need to generate an APK that can be -# deployed to an Android device. This module integrates androiddeployqt support -# to help with this for Qt-based projects. To enable this, set the -# ``QTANDROID_EXPORTED_TARGET`` variable to the target you wish to export as an -# APK, as well as ``ANDROID_APK_DIR`` to a directory containing some basic -# information. This will create a ``create-apk-`` target that will -# generate the APK file. See the `Qt on Android deployment documentation -# `_ for more information. -# -# For example, you could do:: -# -# cmake \ -# -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake \ -# -DQTANDROID_EXPORTED_TARGET=myapp \ -# -DANDROID_APK_DIR=myapp-apk -# make -# make create-apk-myapp -# -# The APK would then be found in ``myapp_build_apk/bin`` in the build directory. -# -# The create-apk-myapp target will be able to take an ARGS parameter with further -# arguments for androiddeployqt. For example, one can use:: -# -# make create-apk-myapp ARGS="--install" -# -# To install the apk to test. To generate a signed apk, one can do it with the -# following syntax:: -# -# make create-apk-myapp ARGS="--sign ~/my.keystore alias_name" -# -# See Android documentation on how to create a keystore to use - -# ============================================================================= -# Copyright 2014 Aleix Pol i Gonzalez -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -cmake_minimum_required(VERSION "3.1") - -#input -set(ANDROID_NDK "$ENV{ANDROID_NDK}" CACHE path "Android NDK path") -set(ANDROID_SDK_ROOT "$ENV{ANDROID_SDK_ROOT}" CACHE path "Android SDK path") -set(ANDROID_ARCHITECTURE "$ENV{ANDROID_ARCHITECTURE}" CACHE string "Used Architecture, related to the ABI and TOOLCHAIN") -set(ANDROID_TOOLCHAIN "$ENV{ANDROID_TOOLCHAIN}" CACHE string "Used SDK") -set(ANDROID_ABI "$ENV{ANDROID_ABI}" CACHE string "Used ABI") -set(ANDROID_GCC_VERSION "4.9" CACHE string "Used GCC version" ) -set(ANDROID_API_LEVEL "$ENV{ANDROID_API_LEVEL}" CACHE string "Android API Level") -set(ANDROID_SDK_BUILD_TOOLS_REVISION "21.1.1" CACHE string "Android API Level") - -set(_HOST "${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}") -string(TOLOWER "${_HOST}" _HOST) - -get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" PATH) - -cmake_policy(SET CMP0011 OLD) -cmake_policy(SET CMP0017 OLD) - -set(CMAKE_SYSROOT - "${ANDROID_NDK}/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCHITECTURE}") -if(NOT EXISTS ${CMAKE_SYSROOT}) - message(FATAL_ERROR "Couldn't find the Android NDK Root in ${CMAKE_SYSROOT}") -endif() - -#actual code -SET(CMAKE_SYSTEM_NAME Android) -SET(CMAKE_SYSTEM_VERSION 1) - -if(${ANDROID_ARCHITECTURE} STREQUAL "x86" OR ${ANDROID_ARCHITECTURE} STREQUAL "x86_64") - set(ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_ARCHITECTURE}-${ANDROID_GCC_VERSION}/prebuilt/${_HOST}/bin") -else() - set(ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN}-${ANDROID_GCC_VERSION}/prebuilt/${_HOST}/bin") -endif() -set(ANDROID_LIBS_ROOT "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}") - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM "${ANDROID_TOOLCHAIN_ROOT}") -set(ANDROID_LIBRARIES_PATH - "${CMAKE_SYSROOT}/usr/lib") -set(CMAKE_SYSTEM_LIBRARY_PATH - ${ANDROID_LIBRARIES_PATH} - "${ANDROID_LIBS_ROOT}/libs/${ANDROID_ABI}/" -) -set(CMAKE_FIND_LIBRARY_SUFFIXES ".so") -set(CMAKE_FIND_LIBRARY_PREFIXES "lib") -find_library(GNUSTL_SHARED gnustl_shared) -if(NOT GNUSTL_SHARED) - message(FATAL_ERROR "you need gnustl_shared: ${CMAKE_SYSTEM_LIBRARY_PATH}") -endif() -include_directories(SYSTEM - "${ANDROID_LIBS_ROOT}/libs/${ANDROID_ABI}/include" - "${ANDROID_LIBS_ROOT}/include/" - "${CMAKE_SYSROOT}/usr/include" -) - -# needed for Qt to define Q_OS_ANDROID -add_definitions(-DANDROID) - -link_directories(${CMAKE_SYSTEM_LIBRARY_PATH}) - -if(${ANDROID_ARCHITECTURE} STREQUAL "x86") - set(CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/i686-linux-android-gcc") - set(CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/i686-linux-android-g++") -else() - set(CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-gcc") - set(CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-g++") -endif() - -SET(CMAKE_FIND_ROOT_PATH ${ANDROID_NDK}) -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) - -set(CMAKE_EXE_LINKER_FLAGS "${GNUSTL_SHARED} -Wl,-rpath-link,${ANDROID_LIBRARIES_PATH} -llog -lz -lm -ldl -lc -lgcc" CACHE STRING "") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "") - -#we want executables to be shared libraries, hooks will invoke the exported cmake function -set(CMAKE_CXX_LINK_EXECUTABLE - " -o " -) - -if(NOT ${QTANDROID_EXPORTED_TARGET} STREQUAL "") # Build APK only when QTANDROID_EXPORTED_TARGET is set -set(CREATEAPK_TARGET_NAME "create-apk-${QTANDROID_EXPORTED_TARGET}") -# Need to ensure we only get in here once, as this file is included twice: -# from CMakeDetermineSystem.cmake and from CMakeSystem.cmake generated within the -# build directory. -if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) - if(NOT EXISTS "${ANDROID_APK_DIR}/AndroidManifest.xml") - message(FATAL_ERROR "Define an apk dir to initialize from using -DANDROID_APK_DIR=. The specified directory must contain the AndroidManifest.xml file.") - endif() - - find_package(Qt5Core REQUIRED) - - set(EXPORT_DIR "${CMAKE_BINARY_DIR}/${QTANDROID_EXPORTED_TARGET}_build_apk/") - set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/${ANDROID_ABI}/lib${QTANDROID_EXPORTED_TARGET}.so") - configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json.in") - - add_custom_target(${CREATEAPK_TARGET_NAME} - COMMAND cmake -E echo "Generating $ with $/androiddeployqt" - COMMAND cmake -E remove_directory "${EXPORT_DIR}" - COMMAND cmake -E copy_directory "${ANDROID_APK_DIR}" "${EXPORT_DIR}" - COMMAND cmake -E copy "$" "${EXECUTABLE_DESTINATION_PATH}" - COMMAND cmake -DINPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json.in" -DOUTPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json" "-DTARGET_DIR=$" "-DTARGET_NAME=${QTANDROID_EXPORTED_TARGET}" "-DEXPORT_DIR=${CMAKE_INSTALL_PREFIX}" -P ${_CMAKE_ANDROID_DIR}/specifydependencies.cmake - COMMAND $/androiddeployqt --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --android-platform android-${ANDROID_API_LEVEL} --${RELEASE_TYPE} --deployment bundled "\\$(ARGS)" - ) -else() - message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=") -endif() -endif(NOT ${QTANDROID_EXPORTED_TARGET} STREQUAL "") diff --git a/android/toolchain-android.cmake b/android/toolchain-android.cmake deleted file mode 100644 index e3ae80055..000000000 --- a/android/toolchain-android.cmake +++ /dev/null @@ -1,57 +0,0 @@ - -SET(CMAKE_SYSTEM_NAME ${HOST_PREFIX}) -SET(CMAKE_CROSSCOMPILING TRUE) - -SET(ANDROID_NDK_ROOT $ENV{ANDROID_NDK}) -SET(ANDROID_PLATFORM android-$ENV{ANDROID_API_LEVEL}) -SET(ANDROID_ABI armeabi-v7a) -SET(ANDROID_STL gnustl_static) -SET(ANDROID_TOOLCHAIN_NAME armv7-linux-androideabi) - -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) - -SET(ANDROID ON) -SET(CMAKE_C_COMPILER_TARGET "${ANDROID_TOOLCHAIN_NAME}") -SET(CMAKE_C_COMPILER ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang) -SET(CMAKE_CXX_COMPILER_TARGET "${ANDROID_TOOLCHAIN_NAME}") -SET(CMAKE_CXX_COMPILER ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++) -SET(CMAKE_STRIP ${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip) -SET(CMAKE_AR ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar) - -SET(CMAKE_C_FLAGS_RELEASE -Os -gline-tables-only -fomit-frame-pointer -fno-strict-aliasing -DNDEBUG -DRELEASE -D_RELEASE) -SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) -SET(CMAKE_C_FLAGS_DEBUG -O0 -gdwarf-2 -DDEBUG -D_DEBUG) -SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) - -# Link size optimization: https://github.com/android-ndk/ndk/issues/133#issuecomment-324165329 -SET(CMAKE_C_FLAGS "-target ${ANDROID_TOOLCHAIN_NAME} -gcc-toolchain ${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fno-integrated-as") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -fsigned-char -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-strict-aliasing") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -mfpu=neon -marm -march=armv7-a -mfloat-abi=softfp -mthumb") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID -D__ANDROID__ -D__ANDROID_API__=${ANDROID_NATIVE_API_LEVEL} -D_FORTIFY_SOURCE=2 -fno-short-enums -Wno-c++11-narrowing") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Werror=format-security -Wno-unknown-warning-option -Wno-extern-c-compat -Wno-deprecated-register -Wno-gcc-compat") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm/usr/include") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include/backward") -SET(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") - -INCLUDE_DIRECTORIES(${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm/usr/include) -INCLUDE_DIRECTORIES(${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include) -INCLUDE_DIRECTORIES(${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include) -INCLUDE_DIRECTORIES(${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include/backward) -INCLUDE_DIRECTORIES(${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/5.0/include) - -SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -fexceptions -frtti -Wno-unknown-warning-option -Wno-unused-local-typedef -Wa,--noexecstack") - -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -gcc-toolchain ${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -no-canonical-prefixes") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --sysroot=${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -fPIE -L${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm/usr/lib") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,-rpath=${ANDROID_NDK_ROOT}/platforms/${ANDROID_PLATFORM}/arch-arm/usr/lib") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -lgcc -Wl,--exclude-libs,libgcc.a") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -lgnustl_shared") -SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--gc-sections") -SET(CMAKE_CXX_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) -SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}") diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt index 69ce5460a..db43521b5 100644 --- a/kstars/CMakeLists.txt +++ b/kstars/CMakeLists.txt @@ -1,1143 +1,1149 @@ add_subdirectory( data ) add_subdirectory( icons ) add_subdirectory( htmesh ) if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) SET(HAVE_KF5WIT 1) # if(NOT BUILD_KSTARS_LITE) # add_subdirectory( tools/whatsinteresting/qml) # endif(NOT BUILD_KSTARS_LITE) else() SET(HAVE_KF5WIT 0) endif() if (ANDROID AND CMAKE_TOOLCHAIN_FILE) include(${CMAKE_TOOLCHAIN_FILE}) endif () if (NOT ANDROID) find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) endif () if(MSVC) add_definitions(-D_USE_MATH_DEFINES=1) add_definitions(-DNOMINMAX) endif() include_directories( ${kstars_SOURCE_DIR}/kstars ${kstars_SOURCE_DIR}/kstars/skyobjects ${kstars_SOURCE_DIR}/kstars/skycomponents ${kstars_SOURCE_DIR}/kstars/auxiliary ${kstars_SOURCE_DIR}/kstars/time ${kstars_SOURCE_DIR}/kstars/tools ) if (CFITSIO_FOUND) set (sep_SRCS fitsviewer/sep/analyse.c fitsviewer/sep/aperture.c fitsviewer/sep/background.c fitsviewer/sep/convolve.c fitsviewer/sep/deblend.c fitsviewer/sep/extract.c fitsviewer/sep/lutz.c fitsviewer/sep/util.c ) set (fits_SRCS fitsviewer/fitslabel.cpp fitsviewer/fitsviewer.cpp fitsviewer/fitstab.cpp fitsviewer/fitsdebayer.cpp fitsviewer/opsfits.cpp ) if (Qt5DataVisualization_FOUND) set(fits_SRCS ${fits_SRCS} fitsviewer/starprofileviewer.cpp) endif() set (fits2_SRCS fitsviewer/bayer.c fitsviewer/fitshistogram.cpp fitsviewer/fitsview.cpp fitsviewer/fitsdata.cpp ) set (fitsui_SRCS fitsviewer/fitsheaderdialog.ui fitsviewer/statform.ui fitsviewer/fitsdebayer.ui indi/streamform.ui indi/recordingoptions.ui fitsviewer/fitshistogramui.ui fitsviewer/opsfits.ui ) include_directories(${CFITSIO_INCLUDE_DIR}) endif(CFITSIO_FOUND) IF (CFITSIO_FOUND) IF (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) IF (SANITIZERS) SET_SOURCE_FILES_PROPERTIES(fitsviewer/bayer.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align -fno-sanitize=address,undefined -fomit-frame-pointer") SET_SOURCE_FILES_PROPERTIES(fitsviewer/fitsdata.cpp PROPERTIES COMPILE_FLAGS "-fno-sanitize=address,undefined -fomit-frame-pointer") SET_SOURCE_FILES_PROPERTIES(fitsviewer/fitshistogram.cpp PROPERTIES COMPILE_FLAGS "-fno-sanitize=address,undefined -fomit-frame-pointer") SET_SOURCE_FILES_PROPERTIES(fitsviewer/fitsview.cpp PROPERTIES COMPILE_FLAGS "-fno-sanitize=address,undefined -fomit-frame-pointer") ELSE () SET_SOURCE_FILES_PROPERTIES(fitsviewer/bayer.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align") ENDIF () SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/analyse.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/aperture.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align -Wno-pointer-arith") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/background.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/deblend.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/extract.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/lutz.c PROPERTIES COMPILE_FLAGS "-Wno-cast-align") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/util.c PROPERTIES COMPILE_FLAGS "-Wno-incompatible-pointer-types-discards-qualifiers") - #SET_SOURCE_FILES_PROPERTIES(ekos/ekoslive/fpackutil.c PROPERTIES COMPILE_FLAGS "-Wno-implicit-function-decleration") + SET_SOURCE_FILES_PROPERTIES(ekos/ekoslive/fpack.c PROPERTIES COMPILE_FLAGS "-Wno-error") + SET_SOURCE_FILES_PROPERTIES(ekos/ekoslive/fpackutil.c PROPERTIES COMPILE_FLAGS "-Wno-error") ELSEIF (NOT WIN32) SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/aperture.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-arith") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/deblend.c PROPERTIES COMPILE_FLAGS "-Wno-discarded-qualifiers") SET_SOURCE_FILES_PROPERTIES(fitsviewer/sep/util.c PROPERTIES COMPILE_FLAGS "-Wno-discarded-qualifiers") ENDIF () ENDIF () if (INDI_FOUND) if(BUILD_KSTARS_LITE) set (fits_klite_SRCS fitsviewer/fitsdata.cpp ) set (fits2_klite_SRCS fitsviewer/bayer.c ) include_directories(${CFITSIO_INCLUDE_DIR}) include_directories(${NOVA_INCLUDE_DIR}) set (indi_klite_SRCS indi/clientmanagerlite.cpp indi/inditelescopelite.cpp kstarslite/skyitems/skynodes/crosshairnode.cpp kstarslite/skyitems/telescopesymbolsitem.cpp ) endif () set(indiui_SRCS indi/streamform.ui indi/drivermanager.ui indi/opsindi.ui indi/indihostconf.ui indi/telescopewizard.ui ) set(indi_SRCS indi/drivermanager.cpp indi/servermanager.cpp indi/clientmanager.cpp indi/guimanager.cpp indi/driverinfo.cpp indi/deviceinfo.cpp indi/indidevice.cpp indi/indigroup.cpp indi/indiproperty.cpp indi/indielement.cpp indi/indistd.cpp indi/indilistener.cpp indi/inditelescope.cpp indi/indiccd.cpp indi/indifocuser.cpp indi/indifilter.cpp indi/indidome.cpp indi/indiweather.cpp indi/indicap.cpp indi/indilightbox.cpp indi/indidbus.cpp indi/opsindi.cpp indi/telescopewizardprocess.cpp indi/streamwg.cpp indi/videowg.cpp indi/indiwebmanager.cpp ) if (CFITSIO_FOUND) set(ekosui_SRCS ekos/opsekos.ui ekos/ekosmanager.ui ekos/profileeditor.ui ekos/profilewizard.ui # Scheduler ekos/scheduler/scheduler.ui ekos/scheduler/mosaic.ui # Capture ekos/capture/capture.ui ekos/capture/calibrationoptions.ui ekos/capture/dslrinfo.ui ekos/capture/rotatorsettings.ui ekos/capture/customproperties.ui # Align ekos/align/align.ui ekos/align/opsastrometry.ui ekos/align/opsalign.ui ekos/align/opsastrometrycfg.ui ekos/align/opsastrometryindexfiles.ui ekos/align/mountmodel.ui # Focus ekos/focus/focus.ui # Mount ekos/mount/mount.ui # Guide ekos/guide/guide.ui ekos/guide/opscalibration.ui ekos/guide/opsguide.ui #TODO remove from GIT #ekos/guide/guider.ui #ekos/guide/rcalibration.ui # Auxiliary ekos/auxiliary/filtersettings.ui ekos/auxiliary/opslogs.ui # Ekos Live ekos/ekoslive/ekoslivedialog.ui ) set(ekos_SRCS ekos/ekos.cpp ekos/ekosmanager.cpp ekos/profileeditor.cpp ekos/profilewizard.cpp ekos/qMDNS.cpp ekos/opsekos.cpp # Auxiliary ekos/auxiliary/dome.cpp ekos/auxiliary/weather.cpp ekos/auxiliary/dustcap.cpp ekos/auxiliary/darklibrary.cpp ekos/auxiliary/filtermanager.cpp ekos/auxiliary/filterdelegate.cpp ekos/auxiliary/opslogs.cpp # Capture ekos/capture/capture.cpp ekos/capture/sequencejob.cpp ekos/capture/dslrinfodialog.cpp ekos/capture/rotatorsettings.cpp ekos/capture/customproperties.cpp # Scheduler ekos/scheduler/schedulerjob.cpp ekos/scheduler/scheduler.cpp ekos/scheduler/mosaic.cpp # Focus ekos/focus/focus.cpp # Mount ekos/mount/mount.cpp # Align ekos/align/align.cpp ekos/align/alignview.cpp ekos/align/astrometryparser.cpp ekos/align/opsastrometry.cpp ekos/align/opsalign.cpp ekos/align/opsastrometrycfg.cpp ekos/align/opsastrometryindexfiles.cpp ekos/align/offlineastrometryparser.cpp ekos/align/onlineastrometryparser.cpp ekos/align/remoteastrometryparser.cpp # Guide ekos/guide/guide.cpp ekos/guide/guideinterface.cpp ekos/guide/opscalibration.cpp ekos/guide/opsguide.cpp # Internal Guide ekos/guide/internalguide/gmath.cpp ekos/guide/internalguide/internalguider.cpp #ekos/guide/internalguide/guider.cpp ekos/guide/internalguide/matr.cpp #ekos/guide/internalguide/rcalibration.cpp ekos/guide/internalguide/vect.cpp ekos/guide/internalguide/imageautoguiding.cpp # External Guide ekos/guide/externalguide/phd2.cpp ekos/guide/externalguide/linguider.cpp # Ekos Live ekos/ekoslive/ekosliveclient.cpp ekos/ekoslive/message.cpp ekos/ekoslive/media.cpp ekos/ekoslive/cloud.cpp + ) + + set(ekos_C_SRCS ekos/ekoslive/fpack.c ekos/ekoslive/fpackutil.c - ) + ) + endif(CFITSIO_FOUND) include_directories(${INDI_INCLUDE_DIR}) endif (INDI_FOUND) if(WCSLIB_FOUND) include_directories( ${WCSLIB_INCLUDE_DIR} ) endif(WCSLIB_FOUND) set(xplanet_SRCS xplanet/opsxplanet.cpp ) set(xplanetui_SRCS xplanet/opsxplanet.ui ) ########### next target ############### set(libkstarstools_SRCS tools/altvstime.cpp tools/avtplotwidget.cpp tools/calendarwidget.cpp tools/conjunctions.cpp # tools/jmoontool.cpp tools/ksconjunct.cpp tools/eqplotwidget.cpp tools/astrocalc.cpp tools/modcalcangdist.cpp tools/modcalcapcoord.cpp tools/modcalcaltaz.cpp tools/modcalcdaylength.cpp tools/modcalceclipticcoords.cpp tools/modcalcvizequinox.cpp tools/modcalcgalcoord.cpp tools/modcalcgeodcoord.cpp tools/modcalcjd.cpp tools/modcalcplanets.cpp tools/modcalcsidtime.cpp tools/modcalcvlsr.cpp tools/observinglist.cpp tools/obslistpopupmenu.cpp tools/sessionsortfilterproxymodel.cpp tools/obslistwizard.cpp tools/planetviewer.cpp tools/pvplotwidget.cpp tools/scriptargwidgets.cpp tools/scriptbuilder.cpp tools/scriptfunction.cpp tools/skycalendar.cpp tools/wutdialog.cpp tools/flagmanager.cpp tools/horizonmanager.cpp tools/nameresolver.cpp tools/polarishourangle.cpp #FIXME Port to KF5 #tools/moonphasetool.cpp tools/starhopper.cpp tools/eyepiecefield.cpp tools/exporteyepieceview.cpp tools/starhopperdialog.cpp tools/adddeepskyobject.cpp ) if(${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) set(libkstarstools_SRCS ${libkstarstools_SRCS} tools/whatsinteresting/skyobjlistmodel.cpp tools/whatsinteresting/wiview.cpp tools/whatsinteresting/modelmanager.cpp tools/whatsinteresting/skyobjitem.cpp tools/whatsinteresting/wilpsettings.cpp tools/whatsinteresting/wiequipsettings.cpp tools/whatsinteresting/obsconditions.cpp tools/whatsinteresting/skyobjdescription.cpp ) endif() ki18n_wrap_ui(libkstarstools_ui_SRCS tools/altvstime.ui tools/argchangeviewoption.ui tools/argexportimage.ui tools/argloadcolorscheme.ui tools/arglooktoward.ui tools/argfindobject.ui tools/argprintimage.ui tools/argsetaltaz.ui tools/argsetcolor.ui tools/argsetgeolocation.ui tools/argsetlocaltime.ui tools/argsetradec.ui tools/argsettrack.ui tools/argtimescale.ui tools/argwaitfor.ui tools/argwaitforkey.ui tools/argzoom.ui tools/conjunctions.ui tools/modcalcangdist.ui tools/modcalcapcoord.ui tools/modcalcaltaz.ui tools/modcalcdaylength.ui tools/modcalceclipticcoords.ui tools/modcalcvizequinox.ui tools/modcalcgalcoord.ui tools/modcalcgeod.ui tools/modcalcjd.ui tools/modcalcplanets.ui tools/modcalcsidtime.ui tools/modcalcvlsr.ui tools/observinglist.ui tools/obslistwizard.ui tools/optionstreeview.ui tools/planetviewer.ui tools/scriptbuilder.ui tools/scriptnamedialog.ui tools/skycalendar.ui tools/wutdialog.ui tools/flagmanager.ui tools/starhopperdialog.ui tools/horizonmanager.ui tools/adddeepskyobject.ui tools/polarishourangle.ui ) if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0) ki18n_wrap_ui(libkstarstools_ui_SRCS tools/whatsinteresting/wilpsettings.ui tools/whatsinteresting/wiequipsettings.ui ) endif() set(libkstarswidgets_SRCS widgets/clicklabel.cpp widgets/dmsbox.cpp widgets/draglistbox.cpp widgets/fovwidget.cpp widgets/logedit.cpp widgets/magnitudespinbox.cpp widgets/mapcanvas.cpp widgets/thumbimage.cpp widgets/timespinbox.cpp widgets/timestepbox.cpp widgets/timeunitbox.cpp widgets/infoboxwidget.cpp # widgets/genericcalendarwidget.cpp # widgets/moonphasecalendarwidget.cpp widgets/kshelplabel.cpp widgets/unitspinboxwidget.cpp ) ki18n_wrap_ui(libkstarswidgets_ui_SRCS # widgets/genericcalendarwidget.ui widgets/unitspinboxwidget.ui ) set(kstars_KCFG_SRCS Options.kcfgc) set(kstars_options_SRCS options/opsadvanced.cpp options/opscatalog.cpp options/opscolors.cpp options/opsguides.cpp options/opssolarsystem.cpp options/opssatellites.cpp options/opssupernovae.cpp ) set(kstars_optionsui_SRCS options/opsadvanced.ui options/opscatalog.ui options/opscolors.ui options/opsguides.ui options/opssolarsystem.ui options/opssatellites.ui options/opssupernovae.ui ) set(kstars_dialogs_SRCS dialogs/addcatdialog.cpp dialogs/addlinkdialog.cpp dialogs/detaildialog.cpp dialogs/finddialog.cpp dialogs/focusdialog.cpp dialogs/fovdialog.cpp dialogs/locationdialog.cpp dialogs/timedialog.cpp dialogs/exportimagedialog.cpp ) set(kstars_dialogsui_SRCS dialogs/addcatdialog.ui dialogs/addlinkdialog.ui dialogs/details_database.ui dialogs/details_data.ui dialogs/details_data_comet.ui dialogs/details_links.ui dialogs/details_log.ui dialogs/details_position.ui dialogs/finddialog.ui dialogs/focusdialog.ui dialogs/fovdialog.ui dialogs/locationdialog.ui dialogs/wizwelcome.ui dialogs/wizlocation.ui dialogs/wizdownload.ui dialogs/wizdata.ui dialogs/wizastrometry.ui dialogs/newfov.ui dialogs/exportimagedialog.ui ) set(hips_SRCS hips/healpix.cpp hips/hipsrenderer.cpp hips/scanrender.cpp hips/pixcache.cpp hips/urlfiledownload.cpp hips/opships.cpp ) set(hips_manager_SRCS hips/hipsmanager.cpp ) set(oal_SRCS oal/log.cpp oal/observer.cpp oal/site.cpp oal/session.cpp oal/scope.cpp oal/eyepiece.cpp oal/filter.cpp oal/observation.cpp oal/lens.cpp oal/equipmentwriter.cpp oal/observeradd.cpp oal/execute.cpp ) set(printing_SRCS printing/detailstable.cpp printing/finderchart.cpp printing/foveditordialog.cpp printing/fovsnapshot.cpp printing/kstarsdocument.cpp printing/legend.cpp printing/loggingform.cpp printing/printingwizard.cpp printing/pwizchartconfig.cpp printing/pwizchartcontents.cpp printing/pwizfovbrowse.cpp printing/pwizfovconfig.cpp printing/pwizfovmanual.cpp printing/pwizfovsh.cpp printing/pwizfovtypeselection.cpp printing/pwizobjectselection.cpp printing/pwizprint.cpp printing/shfovexporter.cpp printing/simplefovexporter.cpp ) set(printingui_SRCS printing/foveditordialog.ui printing/pwizchartconfig.ui printing/pwizchartcontents.ui printing/pwizfovbrowse.ui printing/pwizfovconfig.ui printing/pwizfovmanual.ui printing/pwizfovsh.ui printing/pwizfovtypeselection.ui printing/pwizobjectselection.ui printing/pwizprint.ui printing/pwizwelcome.ui ) set( kstars_KCFG_SRCS Options.kcfgc ) set(libkstarscomponents_SRCS skycomponents/skylabeler.cpp skycomponents/highpmstarlist.cpp skycomponents/skymapcomposite.cpp skycomponents/skymesh.cpp skycomponents/linelistindex.cpp skycomponents/linelistlabel.cpp skycomponents/noprecessindex.cpp skycomponents/listcomponent.cpp skycomponents/pointlistcomponent.cpp skycomponents/solarsystemsinglecomponent.cpp skycomponents/solarsystemlistcomponent.cpp skycomponents/asteroidscomponent.cpp skycomponents/cometscomponent.cpp skycomponents/planetmoonscomponent.cpp skycomponents/solarsystemcomposite.cpp skycomponents/satellitescomponent.cpp skycomponents/starcomponent.cpp skycomponents/deepstarcomponent.cpp skycomponents/deepskycomponent.cpp skycomponents/catalogcomponent.cpp skycomponents/syncedcatalogcomponent.cpp skycomponents/constellationartcomponent.cpp skycomponents/constellationboundarylines.cpp skycomponents/constellationlines.cpp skycomponents/constellationnamescomponent.cpp skycomponents/supernovaecomponent.cpp skycomponents/coordinategrid.cpp skycomponents/equatorialcoordinategrid.cpp skycomponents/horizontalcoordinategrid.cpp skycomponents/localmeridiancomponent.cpp skycomponents/ecliptic.cpp skycomponents/equator.cpp skycomponents/artificialhorizoncomponent.cpp skycomponents/hipscomponent.cpp skycomponents/horizoncomponent.cpp skycomponents/milkyway.cpp skycomponents/skycomponent.cpp skycomponents/skycomposite.cpp skycomponents/starblock.cpp skycomponents/starblocklist.cpp skycomponents/starblockfactory.cpp skycomponents/culturelist.cpp skycomponents/flagcomponent.cpp skycomponents/targetlistcomponent.cpp ) #LIST(APPEND libkstarscomponents_SRCS # #skycomponents/notifyupdatesui.cpp # ) IF (BUILD_KSTARS_LITE) set(libkstarstools_ui_klite_SRCS tools/nameresolver.cpp ) ENDIF () set(kstars_skyobjects_SRCS skyobjects/constellationsart.cpp skyobjects/deepskyobject.cpp # skyobjects/jupitermoons.cpp skyobjects/planetmoons.cpp skyobjects/ksasteroid.cpp skyobjects/kscomet.cpp skyobjects/ksmoon.cpp skyobjects/ksplanetbase.cpp skyobjects/ksplanet.cpp #skyobjects/kspluto.cpp skyobjects/kssun.cpp skyobjects/skyline.cpp skyobjects/skyobject.cpp skyobjects/skypoint.cpp skyobjects/starobject.cpp skyobjects/trailobject.cpp skyobjects/satellite.cpp skyobjects/satellitegroup.cpp skyobjects/supernova.cpp ) set(kstars_projection_SRCS projections/projector.cpp projections/lambertprojector.cpp projections/gnomonicprojector.cpp projections/stereographicprojector.cpp projections/orthographicprojector.cpp projections/azimuthalequidistantprojector.cpp projections/equirectangularprojector.cpp ) set(kstars_extra_SRCS auxiliary/colorscheme.cpp auxiliary/dms.cpp auxiliary/cachingdms.cpp auxiliary/geolocation.cpp auxiliary/ksfilereader.cpp auxiliary/ksuserdb.cpp auxiliary/binfilehelper.cpp auxiliary/ksutils.cpp auxiliary/ksdssimage.cpp auxiliary/ksdssdownloader.cpp auxiliary/nonlineardoublespinbox.cpp auxiliary/profileinfo.cpp auxiliary/filedownloader.cpp auxiliary/kspaths.cpp auxiliary/QRoundProgressBar.cpp auxiliary/skyobjectlistmodel.cpp auxiliary/ksnotification.cpp auxiliary/QProgressIndicator.cpp time/simclock.cpp time/kstarsdatetime.cpp time/timezonerule.cpp ksnumbers.cpp kstarsdata.cpp texturemanager.cpp #to minimize number of indef KSTARS_LITE skypainter.cpp ) SET(kstars_extra_kstars_SRCS auxiliary/thememanager.cpp auxiliary/schememanager.cpp auxiliary/imageviewer.cpp auxiliary/fov.cpp auxiliary/thumbnailpicker.cpp auxiliary/thumbnaileditor.cpp auxiliary/imageexporter.cpp auxiliary/kswizard.cpp auxiliary/qcustomplot.cpp kstarsdbus.cpp kspopupmenu.cpp ksalmanac.cpp kstarsactions.cpp kstarsinit.cpp kstars.cpp kstarssplash.cpp skymap.cpp skymapdrawabstract.cpp skymapqdraw.cpp skymapevents.cpp skyqpainter.cpp ) # Temporary solution to allow use of qml files from source dir DELETE SET(KSTARSLITE_CPP_OPTIONS -DSOURCE_DIR=\"${kstars_SOURCE_DIR}\" -DQML_IMPORT="${CMAKE_CURRENT_SOURCE_DIR}") set(klite_SRCS kstarslite.cpp kstarsliteinit.cpp skymaplite.cpp skymapliteevents.cpp #Wrappers kstarslite/skypointlite.cpp kstarslite/skyobjectlite.cpp #ImageProvider kstarslite/imageprovider.cpp #Dialogs kstarslite/dialogs/detaildialoglite.cpp kstarslite/dialogs/finddialoglite.cpp kstarslite/dialogs/locationdialoglite.cpp #RootNode kstarslite/skyitems/rootnode.cpp kstarslite/skyitems/skyopacitynode.cpp kstarslite/skyitems/typedeflite.h #SkyItems kstarslite/skyitems/skyitem.cpp kstarslite/skyitems/planetsitem.cpp kstarslite/skyitems/asteroidsitem.cpp kstarslite/skyitems/cometsitem.cpp kstarslite/skyitems/horizonitem.cpp kstarslite/skyitems/labelsitem.cpp kstarslite/skyitems/constellationnamesitem.cpp kstarslite/skyitems/staritem.cpp kstarslite/skyitems/deepstaritem.cpp kstarslite/skyitems/deepskyitem.cpp kstarslite/skyitems/constellationartitem.cpp kstarslite/skyitems/satellitesitem.cpp kstarslite/skyitems/supernovaeitem.cpp kstarslite/skyitems/fovitem.cpp kstarslite/skyitems/syncedcatalogitem.cpp #Line kstarslite/skyitems/lines/linesitem.cpp kstarslite/skyitems/lines/equatoritem.cpp kstarslite/skyitems/lines/eclipticitem.cpp kstarslite/skyitems/lines/milkywayitem.cpp #SkyNodes kstarslite/skyitems/skynodes/planetnode.cpp kstarslite/skyitems/skynodes/skynode.cpp kstarslite/skyitems/skynodes/pointsourcenode.cpp kstarslite/skyitems/skynodes/planetmoonsnode.cpp kstarslite/skyitems/skynodes/horizonnode.cpp kstarslite/skyitems/skynodes/labelnode.cpp kstarslite/skyitems/skynodes/guidelabelnode.cpp kstarslite/skyitems/skynodes/deepskynode.cpp kstarslite/skyitems/skynodes/dsosymbolnode.cpp kstarslite/skyitems/skynodes/skypolygonnode.cpp kstarslite/skyitems/skynodes/constellationartnode.cpp kstarslite/skyitems/skynodes/satellitenode.cpp kstarslite/skyitems/skynodes/supernovanode.cpp kstarslite/skyitems/skynodes/trixelnode.cpp kstarslite/skyitems/skynodes/fovsymbolnode.cpp #Nodes kstarslite/skyitems/skynodes/nodes/pointnode.cpp kstarslite/skyitems/skynodes/nodes/polynode.cpp kstarslite/skyitems/skynodes/nodes/linenode.cpp kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp kstarslite/skyitems/skynodes/nodes/rectnode.cpp #Other kstarslite/deviceorientation.cpp ) set(kstarslite_libtess_SRC #libtess libtess/gluos.h libtess/priorityq-sort.h libtess/sweep.c libtess/tessmono.c libtess/dict-list.h libtess/glu.h libtess/tessellate.c libtess/dict.c libtess/geom.c libtess/memalloc.c libtess/mesh.c libtess/normal.c libtess/priorityq.c libtess/priorityq-heap.c libtess/render.c libtess/tess.c ) IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") SET_SOURCE_FILES_PROPERTIES(${kstarslite_libtess_SRC} PROPERTIES COMPILE_FLAGS "-Wno-error") ENDIF () #Qml files will be probably moved to user's data dir, but for use #with QtCreator it is more convenient to have them here set(kstarsliteqml_SRCS kstarslite/qml/main.qml kstarslite/qml/constants/Constants.qml kstarslite/qml/modules/SkyMapLiteWrapper.qml kstarslite/qml/modules/BottomMenu.qml kstarslite/qml/modules/KSPage.qml kstarslite/qml/modules/KSListView.qml kstarslite/qml/modules/KSLabel.qml kstarslite/qml/modules/KSText.qml kstarslite/qml/modules/KSTabButton.qml kstarslite/qml/modules/KSTab.qml kstarslite/qml/modules/KSTabBarArrow.qml kstarslite/qml/modules/KSTextField.qml kstarslite/qml/modules/KSButton.qml kstarslite/qml/modules/TopMenu.qml kstarslite/qml/modules/helpers/TopMenuButton.qml kstarslite/qml/modules/helpers/BottomMenuButton.qml kstarslite/qml/modules/Splash.qml kstarslite/qml/modules/helpers/TimeSpinBox.qml kstarslite/qml/modules/TimePage.qml #Popups kstarslite/qml/modules/popups/ProjectionsPopup.qml kstarslite/qml/modules/popups/FOVPopup.qml kstarslite/qml/modules/popups/ColorSchemePopup.qml #Menus kstarslite/qml/modules/menus/ContextMenu.qml #Helpers kstarslite/qml/modules/helpers/PassiveNotification.qml kstarslite/qml/modules/helpers/KSMenuItem.qml kstarslite/qml/modules/helpers/TelescopeControl.qml #Dialogs kstarslite/qml/dialogs/FindDialog.qml kstarslite/qml/dialogs/LocationDialog.qml kstarslite/qml/dialogs/DetailsDialog.qml kstarslite/qml/dialogs/helpers/DetailsItem.qml kstarslite/qml/dialogs/helpers/DetailsAddLink.qml kstarslite/qml/dialogs/helpers/LocationEdit.qml kstarslite/qml/dialogs/helpers/LocationLoading.qml kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml #INDI kstarslite/qml/indi/INDIControlPanel.qml kstarslite/qml/indi/DevicePanel.qml kstarslite/qml/indi/ImagePreview.qml kstarslite/qml/indi/modules/MotionControl.qml kstarslite/qml/indi/modules/Led.qml kstarslite/qml/indi/modules/KSLed.qml kstarslite/qml/indi/modules/Property.qml kstarslite/qml/indi/modules/KSComboBox.qml kstarslite/qml/indi/modules/KSButtonSwitch.qml kstarslite/qml/indi/modules/KSCheckBox.qml kstarslite/qml/indi/modules/KSINDIText.qml kstarslite/qml/indi/modules/KSINDITextField.qml kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml #Tutorial kstarslite/qml/modules/tutorial/TutorialPopup.qml kstarslite/qml/modules/tutorial/TutorialExitPopup.qml kstarslite/qml/modules/tutorial/TutorialStep1.qml kstarslite/qml/modules/tutorial/TutorialStep2.qml kstarslite/qml/modules/tutorial/TutorialStep3.qml kstarslite/qml/modules/tutorial/TutorialStep4.qml kstarslite/qml/modules/tutorial/TutorialStep5.qml kstarslite/qml/modules/tutorial/TutorialPane.qml ) add_subdirectory(kstarslite/qml) ADD_CUSTOM_TARGET(kstarsliteqml SOURCES ${kstarsliteqml_SRCS}) if(ANDROID) add_subdirectory(kstarslite/res) endif(ANDROID) set(kstars_SRCS ${indi_SRCS} ${fits_SRCS} ${ekos_SRCS} ${libkstarswidgets_SRCS} ${libkstarscomponents_SRCS} ${libkstarstools_SRCS} ${kstars_extra_SRCS} ${kstars_extra_kstars_SRCS} ${kstars_projection_SRCS} ${xplanet_SRCS} ${kstars_options_SRCS} ${kstars_skyobjects_SRCS} ${kstars_dialogs_SRCS} ${hips_SRCS} ${oal_SRCS} ${printing_SRCS} #KStars Lite ${kstarslite_SRCS} # Generated files ${libkstarstools_ui_SRCS} ${libkstarswidgets_ui_SRCS} ) set(kstarslite_SRCS ${indi_klite_SRCS} ${libkstarscomponents_SRCS} ${kstars_extra_SRCS} ${kstars_projection_SRCS} ${kstars_skyobjects_SRCS} # KStars Lite sources ${klite_SRCS} # Generated files ${libkstarstools_ui_klite_SRCS} ) # Generate all the necessary QLoggingCategory files ecm_qt_declare_logging_category(kstars_SRCS HEADER kstars_debug.h IDENTIFIER KSTARS CATEGORY_NAME org.kde.kstars) ecm_qt_declare_logging_category(kstars_SRCS HEADER indi_debug.h IDENTIFIER KSTARS_INDI CATEGORY_NAME org.kde.kstars.indi) ecm_qt_declare_logging_category(kstars_SRCS HEADER fits_debug.h IDENTIFIER KSTARS_FITS CATEGORY_NAME org.kde.kstars.fits) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_debug.h IDENTIFIER KSTARS_EKOS CATEGORY_NAME org.kde.kstars.ekos) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_capture_debug.h IDENTIFIER KSTARS_EKOS_CAPTURE CATEGORY_NAME org.kde.kstars.ekos.capture) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_focus_debug.h IDENTIFIER KSTARS_EKOS_FOCUS CATEGORY_NAME org.kde.kstars.ekos.focus) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_align_debug.h IDENTIFIER KSTARS_EKOS_ALIGN CATEGORY_NAME org.kde.kstars.ekos.align) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_guide_debug.h IDENTIFIER KSTARS_EKOS_GUIDE CATEGORY_NAME org.kde.kstars.ekos.guide) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_mount_debug.h IDENTIFIER KSTARS_EKOS_MOUNT CATEGORY_NAME org.kde.kstars.ekos.mount) ecm_qt_declare_logging_category(kstars_SRCS HEADER ekos_scheduler_debug.h IDENTIFIER KSTARS_EKOS_SCHEDULER CATEGORY_NAME org.kde.kstars.ekos.scheduler) kconfig_add_kcfg_files(kstars_SRCS ${kstars_KCFG_SRCS}) ecm_qt_declare_logging_category(kstarslite_SRCS HEADER kstars_debug.h IDENTIFIER KSTARS CATEGORY_NAME org.kde.kstars) ecm_qt_declare_logging_category(kstarslite_SRCS HEADER fits_debug.h IDENTIFIER KSTARS_FITS CATEGORY_NAME org.kde.kstars.fits) kconfig_add_kcfg_files(kstarslite_SRCS ${kstars_KCFG_SRCS}) IF (UNITY_BUILD) ENABLE_UNITY_BUILD(kstars kstars_SRCS 10 cpp) ENABLE_UNITY_BUILD(kstarslite kstarslite_SRCS 10 cpp) ENDIF () -set(kstars_SRCS ${kstars_SRCS} ${fits2_SRCS} ${sep_SRCS} ${hips_manager_SRCS}) -set(kstarslite_SRCS ${kstarslite_SRCS} ${fits_klite_SRCS} ${fits2_klite_SRCS} ${kstarslite_libtess_SRC}) +set(kstars_SRCS ${kstars_SRCS} ${fits2_SRCS} ${sep_SRCS} ${hips_manager_SRCS} ${ekos_C_SRCS}) +set(kstarslite_SRCS ${kstarslite_SRCS} ${fits_klite_SRCS} ${sep_SRCS} ${fits2_klite_SRCS} ${kstarslite_libtess_SRC}) + +IF (NOT ANDROID) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock) + + IF (INDI_FOUND) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.INDI.xml indi/indidbus.h INDIDBus) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.xml ekos/ekosmanager.h EkosManager) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Capture.xml ekos/capture/capture.h Ekos::Capture) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Focus.xml ekos/focus/focus.h Ekos::Focus) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Guide.xml ekos/guide/guide.h Ekos::Guide) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Align.xml ekos/align/align.h Ekos::Align) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Mount.xml ekos/mount/mount.h Ekos::Mount) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Dome.xml ekos/auxiliary/dome.h Ekos::Dome) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Weather.xml ekos/auxiliary/weather.h Ekos::Weather) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.DustCap.xml ekos/auxiliary/dustcap.h Ekos::DustCap) + qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Scheduler.xml ekos/scheduler/scheduler.h Ekos::Scheduler) + ENDIF () -qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars) -qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock) + ki18n_wrap_ui(kstars_SRCS + ${indiui_SRCS} + ${ui_SRCS} + ${fitsui_SRCS} + ${ekosui_SRCS} + ${xplanetui_SRCS} + ${kstars_optionsui_SRCS} + ${kstars_dialogsui_SRCS} + ${printingui_SRCS} + auxiliary/thumbnailpicker.ui + auxiliary/thumbnaileditor.ui + oal/observeradd.ui + oal/equipmentwriter.ui + oal/execute.ui + hips/opships.ui + hips/opshipsdisplay.ui + hips/opshipscache.ui + #skycomponents/notifyupdatesui.ui + ) -if (INDI_FOUND) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.INDI.xml indi/indidbus.h INDIDBus) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.xml ekos/ekosmanager.h EkosManager) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Capture.xml ekos/capture/capture.h Ekos::Capture) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Focus.xml ekos/focus/focus.h Ekos::Focus) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Guide.xml ekos/guide/guide.h Ekos::Guide) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Align.xml ekos/align/align.h Ekos::Align) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Mount.xml ekos/mount/mount.h Ekos::Mount) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Dome.xml ekos/auxiliary/dome.h Ekos::Dome) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Weather.xml ekos/auxiliary/weather.h Ekos::Weather) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.DustCap.xml ekos/auxiliary/dustcap.h Ekos::DustCap) - qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Scheduler.xml ekos/scheduler/scheduler.h Ekos::Scheduler) -endif(INDI_FOUND) + add_library(KStarsLib STATIC ${kstars_SRCS}) -ki18n_wrap_ui(kstars_SRCS - ${indiui_SRCS} - ${ui_SRCS} - ${fitsui_SRCS} - ${ekosui_SRCS} - ${xplanetui_SRCS} - ${kstars_optionsui_SRCS} - ${kstars_dialogsui_SRCS} - ${printingui_SRCS} - auxiliary/thumbnailpicker.ui - auxiliary/thumbnaileditor.ui - oal/observeradd.ui - oal/equipmentwriter.ui - oal/execute.ui - hips/opships.ui - hips/opshipsdisplay.ui - hips/opshipscache.ui - #skycomponents/notifyupdatesui.ui -) + target_link_libraries(KStarsLib + LibKSDataHandlers + htmesh + KF5::Crash + KF5::I18n + KF5::NewStuff + KF5::KIOFileWidgets + KF5::WidgetsAddons + KF5::Plotting + KF5::Notifications + Qt5::Gui + Qt5::PrintSupport + Qt5::Sql + Qt5::Svg + Qt5::Qml + Qt5::Quick + Qt5::Network + #Qt5::Positioning + Qt5::Concurrent + Qt5::WebSockets + ${ZLIB_LIBRARIES} + ) + + if (Qt5Keychain_FOUND) + include_directories(KStarsLib PUBLIC ${QTKEYCHAIN_INCLUDE_DIRS}) + target_link_libraries(KStarsLib ${QTKEYCHAIN_LIBRARIES}) + endif(Qt5Keychain_FOUND) + + + if (Qt5DataVisualization_FOUND) + target_link_libraries(KStarsLib Qt5::DataVisualization) + endif(Qt5DataVisualization_FOUND) -add_library(KStarsLib STATIC ${kstars_SRCS}) + if (KF5NotifyConfig_FOUND) + target_link_libraries(KStarsLib KF5::NotifyConfig) + endif(KF5NotifyConfig_FOUND) + + if(NOT WIN32) + target_link_libraries(KStarsLib m) + endif(NOT WIN32) +ENDIF () if (BUILD_KSTARS_LITE) add_library(KStarsLiteLib STATIC ${kstarslite_SRCS}) target_link_libraries(KStarsLiteLib LibKSDataHandlers htmesh KF5::I18n KF5::Plotting KF5::ConfigGui Qt5::Gui Qt5::Sql Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Positioning Qt5::Concurrent ${ZLIB_LIBRARIES} ) if (ANDROID) target_link_libraries(KStarsLiteLib Qt5::AndroidExtras) endif () endif () -target_link_libraries(KStarsLib - LibKSDataHandlers - htmesh - KF5::Crash - KF5::I18n - KF5::NewStuff - KF5::KIOFileWidgets - KF5::WidgetsAddons - KF5::Plotting - KF5::Notifications - Qt5::Gui - Qt5::PrintSupport - Qt5::Sql - Qt5::Svg - Qt5::Qml - Qt5::Quick - Qt5::Network - #Qt5::Positioning - Qt5::Concurrent - Qt5::WebSockets - ${ZLIB_LIBRARIES} - ) - -if (Qt5Keychain_FOUND) - include_directories(KStarsLib PUBLIC ${QTKEYCHAIN_INCLUDE_DIRS}) - target_link_libraries(KStarsLib ${QTKEYCHAIN_LIBRARIES}) -endif(Qt5Keychain_FOUND) - - -if (Qt5DataVisualization_FOUND) - target_link_libraries(KStarsLib Qt5::DataVisualization) -endif(Qt5DataVisualization_FOUND) - -if (KF5NotifyConfig_FOUND) - target_link_libraries(KStarsLib KF5::NotifyConfig) -endif(KF5NotifyConfig_FOUND) - -if(NOT WIN32) - target_link_libraries(KStarsLib m) -endif(NOT WIN32) if (CFITSIO_FOUND) - target_include_directories(KStarsLib PUBLIC ${CFITSIO_INCLUDE_DIR}) - target_link_libraries(KStarsLib ${CFITSIO_LIBRARIES}) + if (NOT ANDROID) + target_include_directories(KStarsLib PUBLIC ${CFITSIO_INCLUDE_DIR}) + target_link_libraries(KStarsLib ${CFITSIO_LIBRARIES}) + endif() if (BUILD_KSTARS_LITE) target_include_directories(KStarsLiteLib PUBLIC ${CFITSIO_INCLUDE_DIR}) target_link_libraries(KStarsLiteLib ${CFITSIO_LIBRARIES}) endif() endif(CFITSIO_FOUND) if(INDI_FOUND) if (NOT ANDROID) find_package(Nova REQUIRED) include_directories(${NOVA_INCLUDE_DIR}) endif () ## Support Multiple Platforms. All Require INDI ## WIN32 Desktop: Requires INDI Qt5 Client + GSL ## WIN32 Lite: Requires INDI Qt5 Client ## Linux + MacOS Desktop: Requires INDI Client + GSL ## Linux + MacOS Lite: Requires INDI Qt5 Client ## Android: Requires INDI Qt5 Client built for Android - find_package(GSL REQUIRED) - include_directories(${GSL_INCLUDE_DIRS}) - target_link_libraries(KStarsLib ${GSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} KF5::Notifications) + if (NOT ANDROID) + find_package(GSL REQUIRED) + include_directories(${GSL_INCLUDE_DIRS}) + target_link_libraries(KStarsLib ${GSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} KF5::Notifications) + endif () if(WIN32 OR ANDROID) if(ANDROID) target_link_libraries(KStarsLiteLib ${INDI_CLIENT_ANDROID_LIBRARIES} ${CFITSIO_LIBRARIES} ${LIBRAW_LIBRARIES}) target_compile_options(KStarsLiteLib PRIVATE ${KSTARSLITE_CPP_OPTIONS} -DUSE_QT5_INDI -DKSTARS_LITE) else(ANDROID) target_link_libraries(KStarsLib ${INDI_CLIENT_LIBRARIES} ${NOVA_LIBRARIES}) endif(ANDROID) else(WIN32 OR ANDROID) if (BUILD_KSTARS_LITE) target_link_libraries(KStarsLiteLib ${INDI_CLIENT_QT_LIBRARIES} ${NOVA_LIBRARIES} z) target_compile_options(KStarsLiteLib PRIVATE ${KSTARSLITE_CPP_OPTIONS} -DUSE_QT5_INDI -DKSTARS_LITE) endif(BUILD_KSTARS_LITE) target_link_libraries(KStarsLib ${INDI_CLIENT_LIBRARIES} ${NOVA_LIBRARIES} z) endif(WIN32 OR ANDROID) endif(INDI_FOUND) if(WCSLIB_FOUND) target_link_libraries(KStarsLib ${WCSLIB_LIBRARIES}) if (BUILD_KSTARS_LITE) target_link_libraries(KStarsLiteLib ${WCSLIB_LIBRARIES}) endif() endif (WCSLIB_FOUND) if(LibRaw_FOUND) - target_link_libraries(KStarsLib ${LibRaw_LIBRARIES}) + if (NOT ANDROID) + target_link_libraries(KStarsLib ${LibRaw_LIBRARIES}) + endif() if (BUILD_KSTARS_LITE) target_link_libraries(KStarsLiteLib ${LibRaw_LIBRARIES}) endif() endif (LibRaw_FOUND) #FIXME Enable OpenGL Later #if( OPENGL_FOUND ) # target_link_libraries(KStarsLib # ${OPENGL_LIBRARIES} # ${QT_QTOPENGL_LIBRARY} # ) #endif( OPENGL_FOUND ) set (KSTARS_APP_SRCS main.cpp ) # add icon to application sources ecm_add_app_icon(KSTARS_APP_SRCS ICONS ${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kstars.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kstars.png ) qt5_add_resources(KSTARS_APP_SRCS data/kstars.qrc) -if (CMAKE_TOOLCHAIN_FILE STREQUAL ${CMAKE_SOURCE_DIR}/android/toolchain-android.cmake) +if ("${CMAKE_TOOLCHAIN_FILE}" MATCHES "android.toolchain.cmake$") add_library(kstars SHARED ${KSTARS_APP_SRCS}) - add_dependencies(KStarsLib cfitsio indi raw) - set(ANDROID_NDK $ENV{ANDROID_NDK}) - # This hack is needed by a strange NDK bug. Some symbols are missing in locale.o (libc.a) at linking stage. But - # if we force-link with a working libc.a from android-24, there will be duplicated symbols, some symbols will - # conflict with libandroid_support.a what is also needed. - # Workaround: Extract the needed locale.o from libc.a of android-24 and link KStars Lite with it. - ADD_CUSTOM_TARGET(extract_locale_o - COMMAND ar -xv ${ANDROID_NDK}/platforms/android-24/arch-arm/usr/lib/libc.a locale.o - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - ADD_DEPENDENCIES(kstars extract_locale_o) - target_link_libraries(kstars KStarsLiteLib ${CMAKE_BINARY_DIR}/locale.o -lgnustl_static) + target_compile_options(kstars PRIVATE ${KSTARSLITE_CPP_OPTIONS} -DUSE_QT5_INDI -DKSTARS_LITE) + add_dependencies(KStarsLiteLib cfitsio indi raw) + target_link_libraries(kstars KStarsLiteLib) else () if (BUILD_KSTARS_LITE) add_executable(kstars_lite ${KSTARS_APP_SRCS}) target_compile_options(kstars_lite PRIVATE ${KSTARSLITE_CPP_OPTIONS} -DUSE_QT5_INDI -DKSTARS_LITE) target_link_libraries(kstars_lite KStarsLiteLib) endif() add_executable(kstars ${KSTARS_APP_SRCS}) target_link_libraries(kstars KStarsLib) endif () install(TARGETS kstars ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### install(PROGRAMS org.kde.kstars.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES kstars.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES kstars.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) if(INDI_FOUND) #install(FILES ekos/mount/mountbox.qml DESTINATION ${KDE_INSTALL_DATADIR}/kstars/ekos/mount/qml) #install(DIRECTORY ekos/mount/ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/ekos/mount/qml # FILES_MATCHING PATTERN "*.png") endif() if (NOT ANDROID AND BUILD_KSTARS_LITE) install(TARGETS kstars_lite ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) endif() diff --git a/kstars/ekos/ekoslive/fpack.h b/kstars/ekos/ekoslive/fpack.h index 985c5fecb..3ecab708a 100644 --- a/kstars/ekos/ekoslive/fpack.h +++ b/kstars/ekos/ekoslive/fpack.h @@ -1,198 +1,200 @@ /* used by FPACK and FUNPACK * R. Seaman, NOAO * W. Pence, NASA/GSFC */ +#pragma once + #include #include #include /* not needed any more */ /* #include */ /* #include */ /* #include */ #define FPACK_VERSION "1.7.0 (Dec 2013)" /* VERSION History 1.7.0 (Dec 2013) - extensive changes to the binary table compression method. All types of binary table columns, including variable length array columns are now supported. The command line table compression flag has been changed to "-table" instead of "-BETAtable", and a new "-tableonly" flag has been introduced to only compress the binary tables in the input files(s) and not the image HDUs. 1.6.1 (Mar 2013) - numerous changes to the BETAtable compression method used to compress binary tables - added support for compression 'steering' keywords that specify the desired compression parameters that should be used when compressing that particular HDU, thus overriding the fpack command line parameter values. 1.6.0 (June 2012) - Fixed behavior of the "rename" function on Windows platforms so that it will clobber/delete an existing file before renaming a file to that name (the rename command behaves differently on POSIX and non-POSIX environments). 1.6.0 (February 2011) - Added full support for compressing and uncompressing FITS binary tables using a newly proposed format convention. This is intended only for further feasibility studies, and is not recommended for use with publicly distributed FITS files. - Use the minimum of the MAD 2nd, 3rd, and 5th order values as a more conservative extimate of the noise when quantizing floating point images. - Enhanced the tile compression routines so that a tile that contains all NaN pixel values will be compressed. - When uncompressing an image that was originally in a FITS primary array, funpack will also append any new keywords that were written into the primary array of the compressed FITS file after the file was compressed. - Added support for the GZIP_2 algorithm, which shuffles the bytes in the pixel values prior to compressing them with gzip. 1.5.1 (December 2010) Added prototype, mainly hidden, support for compressing binary tables. 1.5.0 (August 2010) Added the -i2f option to lossy compress integer images. 1.4.0 (Jan 2010) Reduced the default value for the q floating point image quantization parameter from 16 to 4. This results in about 50% better compression (from about 4.6x to 6.4) with no lost of significant information (with the new subtractive dithering enhancement). Replaced the code for generating temporary filenames to make the code more portable (to Windows). Replaced calls to the unix 'access' and 'stat' functions with more portable code. When unpacking a file, write it first to a temporary file, then rename it when finished, so that other tasks cannot try to read the file before it is complete. 1.3.0 (Oct 2009) added randomization to the dithering pattern so that the same pattern is not used for every image; also added an option for losslessly compressing floating point images with GZIP for test purposes (not recommended for general use). Also added support for reading the input FITS file from the stdin file streams. 1.2.0 (Sept 2009) added subtractive dithering feature (in CFITSIO) when quantizing floating point images; When packing an IRAF .imh + .pix image, the file name is changed to FILE.fits.fz, and if the original file is deleted, then both the .imh and .pix files are deleted. 1.1.4 (May 2009) added -E option to funpack to unpack a list of HDUs 1.1.3 (March 2009) minor modifications to the content and format of the -T report 1.1.2 (September 2008) */ #define FP_INIT_MAGIC 42 #define FPACK 0 #define FUNPACK 1 /* changed from 16 in Jan. 2010 */ #define DEF_QLEVEL 4. #define DEF_HCOMP_SCALE 0. #define DEF_HCOMP_SMOOTH 0 #define DEF_RESCALE_NOISE 0 #define SZ_STR 513 #define SZ_CARD 81 typedef struct { int comptype; float quantize_level; int no_dither; int dither_offset; int dither_method; float scale; float rescale_noise; int smooth; int int_to_float; float n3ratio; float n3min; long ntile[MAX_COMPRESS_DIM]; int to_stdout; int listonly; int clobber; int delete_input; int do_not_prompt; int do_checksums; int do_gzip_file; int do_images; int do_tables; int test_all; int verbose; char prefix[SZ_STR]; char extname[SZ_STR]; int delete_suffix; char outfile[SZ_STR]; int firstfile; int initialized; int preflight_checked; } fpstate; typedef struct { int n_nulls; double minval; double maxval; double mean; double sigma; double noise1; double noise2; double noise3; double noise5; } imgstats; #ifdef __cplusplus extern "C" { #endif int fp_get_param (int argc, char *argv[], fpstate *fpptr); void abort_fpack(int sig); void fp_abort_output (fitsfile *infptr, fitsfile *outfptr, int stat); int fp_usage (void); int fp_help (void); int fp_hint (void); int fp_init (fpstate *fpptr); int fp_list (int argc, char *argv[], fpstate fpvar); int fp_info (char *infits); int fp_info_hdu (fitsfile *infptr); int fp_preflight (int argc, char *argv[], int unpack, fpstate *fpptr); int fp_loop (int argc, char *argv[], int unpack, char *output_filename, fpstate fpvar); int fp_pack (char *infits, char *outfits, fpstate fpvar, int *islossless); int fp_unpack (char *infits, char *outfits, fpstate fpvar); int fp_test (char *infits, char *outfits, char *outfits2, fpstate fpvar); int fp_pack_hdu (fitsfile *infptr, fitsfile *outfptr, fpstate fpvar, int *islossless, int *status); int fp_unpack_hdu (fitsfile *infptr, fitsfile *outfptr, fpstate fpvar, int *status); int fits_read_image_speed (fitsfile *infptr, float *whole_elapse, float *whole_cpu, float *row_elapse, float *row_cpu, int *status); int fp_test_hdu (fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2, fpstate fpvar, int *status); int fp_test_table (fitsfile *infptr, fitsfile *outfptr, fitsfile *outfptr2, fpstate fpvar, int *status); int marktime(int *status); int gettime(float *elapse, float *elapscpu, int *status); int fits_read_image_speed (fitsfile *infptr, float *whole_elapse, float *whole_cpu, float *row_elapse, float *row_cpu, int *status); int fp_i2stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status); int fp_i4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status); int fp_r4stat(fitsfile *infptr, int naxis, long *naxes, imgstats *imagestats, int *status); int fp_i2rescale(fitsfile *infptr, int naxis, long *naxes, double rescale, fitsfile *outfptr, int *status); int fp_i4rescale(fitsfile *infptr, int naxis, long *naxes, double rescale, fitsfile *outfptr, int *status); int fp_msg (char *msg); int fp_version (void); int fp_noop (void); int fu_get_param (int argc, char *argv[], fpstate *fpptr); int fu_usage (void); int fu_hint (void); int fu_help (void); #ifdef __cplusplus } #endif