Ticket #46575: patch-CMakeFiles.patch

File patch-CMakeFiles.patch, 3.2 KB (added by RJVB (René Bertin), 10 years ago)
  • CMakeLists.txt

    diff --git CMakeLists.txt CMakeLists.txt
    index 4e735a1..55f78bc 100644
    CMAKE_MINIMUM_REQUIRED( VERSION 2.6.0 ) 
    3838SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake" )
    3939SET( CMAKE_AUTOMOC ON )
    4040
    41 # try Qt5 first, and prefer that if found
    42 find_package(Qt5Core QUIET)
     41if(NOT WITH_QT4)
     42    # try Qt5 first, and prefer that if found
     43    find_package(Qt5Core QUIET)
     44endif()
    4345IF (Qt5Core_FOUND)
    4446    find_package(Qt5Widgets REQUIRED)
    4547    find_package(Qt5Xml REQUIRED)
    IF (Qt5Core_FOUND) 
    6163        SET(QT_PLATFORM_SPECIFIC_LIBRARIES)
    6264    ENDIF()
    6365
    64     IF(APPLE)
     66#     IF(APPLE)
    6567        find_package(Qt5MacExtras REQUIRED)
    6668        include_directories(${Qt5MacExtras_INCLUDE_DIRS})
    6769        set(QT_PLATFORM_SPECIFIC_LIBRARIES ${Qt5MacExtras_LIBRARIES})
    68     ENDIF()
     70#     ENDIF()
    6971
    7072    IF(NOT APPLE)
    7173        find_package(Qt5DBus)
    ELSE() 
    124126
    125127    SET(CHARM_MAC_HIGHRES_SUPPORT_ENABLED OFF)
    126128
    127     IF(UNIX AND NOT APPLE)
     129    IF(UNIX) # AND NOT APPLE)
    128130        find_package(Qt4 COMPONENTS QtDBus)
    129131        IF (QT_QTDBUS_FOUND)
    130132            set(HAVE_DBUS ON)
    IF( UNIX AND NOT APPLE ) 
    197199    SET( DOC_INSTALL_DIR share/doc/${Charm_EXECUTABLE} )
    198200ELSE()
    199201    set( Charm_EXECUTABLE Charm )
    200     SET( BIN_INSTALL_DIR . )
    201     SET( DOC_INSTALL_DIR . )
     202    if(NOT BIN_INSTALL_DIR)
     203        SET( BIN_INSTALL_DIR . )
     204    endif()
     205    SET( DOC_INSTALL_DIR share/doc/${Charm_EXECUTABLE} )
    202206ENDIF()
    203207SET( ICONS_DIR "${CMAKE_SOURCE_DIR}/Charm/Icons" )
    204208
    CONFIGURE_FILE( CharmCMake.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/CharmCMake.h ) 
    223227
    224228SET( LICENSE_FILE "License.txt" )
    225229SET( README_FILE "ReadMe.txt" )
    226 IF( NOT APPLE )
     230#IF( NOT APPLE )
    227231    INSTALL( FILES "${LICENSE_FILE}" "${README_FILE}" DESTINATION ${DOC_INSTALL_DIR} )
    228 ENDIF()
     232#ENDIF()
    229233
    230234    # Only support CPack packaging on newer versions of CMake.
    231235IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" )
    IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" ) 
    252256            "${README_FILE}" "Readme"
    253257        )
    254258        SET( CPACK_NSIS_MUI_FINISHPAGE_RUN "${CPACK_NSIS_INSTALLED_ICON_NAME}" )
    255     ELSEIF( APPLE )
     259    ELSEIF( APPLENATIVE )
    256260        SET( CPACK_GENERATOR "DragNDrop" )
    257261        SET( CPACK_DMG_FORMAT "UDBZ" )
    258262        SET( CPACK_DMG_VOLUME_NAME "Charm" )
  • Charm/CMakeLists.txt

    diff --git Charm/CMakeLists.txt Charm/CMakeLists.txt
    index e11bae3..a9faff9 100644
    IF( WIN32 ) 
    180180ENDIF()
    181181MESSAGE( STATUS "Charm will be installed to ${CMAKE_INSTALL_PREFIX}" )
    182182
    183 IF( UNIX AND NOT APPLE )
     183IF( UNIX) # AND NOT APPLE )
    184184    SET( XDG_APPS_INSTALL_DIR share/applications )
    185185    INSTALL( FILES charmtimetracker.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
    186186    INSTALL( FILES Icons/Charm-128x128.png DESTINATION share/icons/hicolor/128x128/apps )
    IF( NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.4" ) 
    217217                 DESTINATION ${BIN_INSTALL_DIR} )
    218218    ENDIF()
    219219
    220     IF( APPLE OR WIN32 )
    221         INCLUDE( DeployQt4 )
    222         INSTALL_QT4_EXECUTABLE( "${EXECUTABLE}" "qsqlite" )
    223     ENDIF()
     220#     IF( APPLE OR WIN32 )
     221#         INCLUDE( DeployQt4 )
     222#         INSTALL_QT4_EXECUTABLE( "${EXECUTABLE}" "qsqlite" )
     223#     ENDIF()
    224224ENDIF()