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

  • 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
       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_GUI_IDENTIFIER "com.qt.io")
       string(TIMESTAMP PROJECT_COPYRIGHT "Copyright © 1999-%Y User Name All Rights Reserved." UTC)
       # 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) ")

  • Lifetime Qt Champion


    What exact error are you getting ?

  • 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...

Log in to reply