Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator 4.4 && cmake mac project don run by CTRL+R
Forum Updated to NodeBB v4.3 + New Features

QtCreator 4.4 && cmake mac project don run by CTRL+R

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
cmake
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patrik08
    wrote on last edited by
    #1

    I have set cmake to build bundle in this way:
    and its run by build
    cmake && make
    after make install the bundle mac is ready to use.
    but QtCreator 4.4 give error i set 2 project in the same time
    to run in console only ./sax & bundle other name is this not correct to QtCreator?

       cmake_minimum_required(VERSION 3.7)
       # the Info.plist template to fill after cmake md Info.plist is ready on bundle dir
       set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
       project(Sax VERSION 0.4.0)
       # Project information 2 app one console e other bundle mac.
       set(PRO_MAC_NAME "SaxMac")
       set(CURRENT_VERSION "0.4.0")
       set(PRO_UNIX_NAME "sax")
       # Project Bundle to info plist xml file information.
       set(PROJECT_COMPANY_NAME "Sax Company XX")
       set(PROJECT_DESCRIPTION "A simple app..")
       set(PROJECT_URL "https://www.qt.io/")
       # the property added to Info.plist
       set(MACOSX_BUNDLE_ICON_FILE "macicon.icns")
       # Set the OS X Bundle specific CMake variables which will be used to populate the plist for
       # the application bundle
       set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
       set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.qt.io")
       set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} Version ${CURRENT_VERSION}")
       set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
       set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${CURRENT_VERSION})
       set(MACOSX_BUNDLE_BUNDLE_VERSION ${CURRENT_VERSION})
       string(TIMESTAMP PROJECT_COPYRIGHT "Copyright © 1999-%Y User Name All Rights Reserved." UTC)
       set(MACOSX_BUNDLE_COPYRIGHT ${PROJECT_COPYRIGHT})
       set(MACOSX_BUNDLE_EXECUTABLE_NAME ${PRO_MAC_NAME})
       # And this part tells CMake where to find and install the file itself
       set(MAC_APP_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/macicon.icns)
       set_source_files_properties(${MAC_APP_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
       set(CMAKE_CXX_STANDARD 14)
       set(SOURCE_FILES main.cpp)
       find_package( Qt5Core REQUIRED )
       find_package( Qt5Widgets REQUIRED )
       find_package( Qt5Gui REQUIRED )
    
       #Mac Bundle (Built on Mac)
       add_executable(${PRO_MAC_NAME} MACOSX_BUNDLE main.cpp ${MAC_APP_ICON} )
       qt5_use_modules(${PRO_MAC_NAME} Core Widgets Gui )
       target_link_libraries(${PRO_MAC_NAME} Qt5::Widgets)
       add_executable(${PRO_UNIX_NAME} ${SOURCE_FILES})
       qt5_use_modules(${PRO_UNIX_NAME} Core Widgets Gui )
       target_link_libraries(${PRO_UNIX_NAME} Qt5::Widgets)
       set(APP_MAC_BUNDLE ${PRO_MAC_NAME}.app )
       # shell script or:
       set(MACDEPLOYQT macdeployqt)
       install(CODE "execute_process(COMMAND ${MACDEPLOYQT} ${APP_MAC_BUNDLE} -dmg) ")
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What exact error are you getting ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        patrik08
        wrote on last edited by
        #3

        Hi...
        i see vtable error link library error...
        i solved to create a normal file.pro...
        other way i must create a extra cmake file compatible to QtCreator 4.4...
        tanks...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved