From ccdceeba5eaad83aae309babe9f01f3b305e00f4 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 9 Nov 2019 22:53:30 +0100 Subject: [PATCH] next CMake / MacOSX change Signed-off-by: Martin --- openhantek/CMakeLists.txt | 45 ++++++++++++++++++++------------------- openhantek/src/OH_BUILD.h | 2 +- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/openhantek/CMakeLists.txt b/openhantek/CMakeLists.txt index 06ddfa2b..cd71583a 100644 --- a/openhantek/CMakeLists.txt +++ b/openhantek/CMakeLists.txt @@ -38,29 +38,10 @@ if(WIN32 AND MINGW) set(EXECTYPE WIN32) endif() -# make executable -add_executable(${PROJECT_NAME} ${EXECTYPE} ${SRC} ${HEADERS} ${UI} -${QRC} ${TRANSLATION_BIN_FILES} ${TRANSLATION_QRC} ${ICONS}) -target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL ${OPENGL_LIBRARIES} ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for) -if(MSVC) - target_compile_options(${PROJECT_NAME} PRIVATE "/W4" "/wd4251" "/wd4127" "/wd4275" "/wd4200" "/nologo" "/J" "/Zi") - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:/MDd>") -else() - target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic) - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-DDEBUG>") - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-O0>") - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-fno-rtti>") -endif() - - # Enable MacOSX bundle magic in the next line option(BUILD_MACOSX_BUNDLE "Build MacOS app bundle" ON) # if( APPLE AND BUILD_MACOSX_BUNDLE ) - # Use own template that defines NSPrincipalClass=NSApplication & NSHighResolutionCapable=True - set_target_properties( ${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/../cmake/OpenHantekBundleInfo.plist.in ) - # set( EXECTYPE MACOSX_BUNDLE ) set( MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}" ) set( MACOSX_BUNDLE_INFO_STRING "Digital oscilloscope software for Hantek DSO6022" ) @@ -74,6 +55,26 @@ if( APPLE AND BUILD_MACOSX_BUNDLE ) set_source_files_properties( ${ICONS} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources" ) endif() +# make executable +add_executable(${PROJECT_NAME} ${EXECTYPE} ${SRC} ${HEADERS} ${UI} +${QRC} ${TRANSLATION_BIN_FILES} ${TRANSLATION_QRC} ${ICONS}) +target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL ${OPENGL_LIBRARIES} ) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for) +if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE "/W4" "/wd4251" "/wd4127" "/wd4275" "/wd4200" "/nologo" "/J" "/Zi") + target_compile_options(${PROJECT_NAME} PRIVATE "$<$:/MDd>") +else() + if( APPLE AND BUILD_MACOSX_BUNDLE ) + # Use own template that defines NSPrincipalClass=NSApplication & NSHighResolutionCapable=True + set_target_properties( ${PROJECT_NAME} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/../cmake/OpenHantekBundleInfo.plist.in + ) + endif() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic) + target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-DDEBUG>") + target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-O0>") + target_compile_options(${PROJECT_NAME} PRIVATE "$<$:-fno-rtti>") +endif() include(../cmake/fftw_on_windows.cmake) include(../cmake/libusb_on_windows.cmake) @@ -93,10 +94,10 @@ endif() # install commands if (APPLE AND BUILD_MACOSX_BUNDLE) - # set_target_properties(${PROJECT_NAME} PROPERTIES + #set_target_properties(${PROJECT_NAME} PROPERTIES # MACOSX_BUNDLE_NAME "${PROJECT_NAME}" - # # MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME}" - # ) + # MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME}" + #) # no install, it's already in openhantek/OpenHantek.app/... # install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents/MacOS/${PROJECT_NAME}) # install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${CMAKE_BINARY_DIR}) # -> build diff --git a/openhantek/src/OH_BUILD.h b/openhantek/src/OH_BUILD.h index 18605ad5..f8b68f7f 100644 --- a/openhantek/src/OH_BUILD.h +++ b/openhantek/src/OH_BUILD.h @@ -1,2 +1,2 @@ // Do not edit, will be re-created at each commit! -#define OH_BUILD "20191109 build 546" +#define OH_BUILD "20191109 build 547"