mirror of
https://github.com/OpenHantek/OpenHantek6022.git
synced 2026-11-26 23:29:52 +00:00
build "full-featured" *.tgz packages for Linux and FreeBSD
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
This commit is contained in:
parent
4159e3d7bd
commit
341eb712c2
5 changed files with 59 additions and 60 deletions
|
|
@ -15,7 +15,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")
|
|||
|
||||
INCLUDE_DIRECTORIES(".")
|
||||
|
||||
# Use CPack to make deb/rpm/zip/exe installer packages
|
||||
# Use CPack to make tgz/deb/rpm/zip installer packages
|
||||
include(cmake/CPackInfos.cmake)
|
||||
|
||||
if(MSVC)
|
||||
|
|
@ -55,53 +55,25 @@ message( "-- COMPILE_DEFINITIONS: ${CompDefs}" )
|
|||
add_subdirectory(openhantek)
|
||||
|
||||
if (WIN32)
|
||||
install(FILES COPYING readme.md DESTINATION ".")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
if(EXISTS "/lib/udev/rules.d/")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/utils/udev_rules/60-hantek.rules"
|
||||
DESTINATION "/lib/udev/rules.d/" COMPONENT Runtime)
|
||||
else()
|
||||
message(WARNING "Could not find udev rules directory (/lib/udev/rules.d/), skipping installation of udev rules.")
|
||||
endif()
|
||||
if(EXISTS "/usr/share/applications/")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/utils/applications/OpenHantek.desktop"
|
||||
DESTINATION "/usr/share/applications/" COMPONENT Runtime)
|
||||
else()
|
||||
message(WARNING "Could not find applications directory (/usr/share/applications/), skipping installation of desktop file.")
|
||||
endif()
|
||||
if(EXISTS "/usr/share/icons/hicolor/48x48/apps/")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/openhantek/res/images/OpenHantek.png"
|
||||
DESTINATION /usr/share/icons/hicolor/48x48/apps/ COMPONENT Runtime)
|
||||
else()
|
||||
message(WARNING "Could not find icons directory (/usr/share/icons/hicolor/48x48/apps/), skipping installation of icon.")
|
||||
endif()
|
||||
if(EXISTS "/usr/share/icons/hicolor/scalable/apps/")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/openhantek/res/images/OpenHantek.svg"
|
||||
DESTINATION "/usr/share/icons/hicolor/scalable/apps/" COMPONENT Runtime)
|
||||
else()
|
||||
message(WARNING "Could not find icons directory (/usr/share/icons/hicolor/scalable/apps/), skipping installation of icon.")
|
||||
endif()
|
||||
if(EXISTS "/usr/share/doc/")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/docs/OpenHantek6022_User_Manual.pdf"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/docs/HANTEK6022_AC_Modification.pdf"
|
||||
DESTINATION "/usr/share/doc/openhantek" COMPONENT Runtime)
|
||||
else()
|
||||
message(WARNING "Could not find doc directory (/usr/share/doc/), skipping installation of user documentation.")
|
||||
endif()
|
||||
install(
|
||||
FILES CHANGELOG LICENSE README
|
||||
DESTINATION "."
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add auxiliary files to the project, so that these files appear in VisualStudio/QtCreator
|
||||
file(GLOB_RECURSE MDFILES "docs/*.md" "openhantek/*.md")
|
||||
add_custom_target(readme SOURCES readme.md ${MDFILES})
|
||||
add_custom_target(
|
||||
readme
|
||||
SOURCES CHANGELOG LICENSE README readme.md ${MDFILES}
|
||||
)
|
||||
|
||||
# Add "doc" target to build the documentation.
|
||||
find_package(Doxygen QUIET)
|
||||
if (DOXYGEN_FOUND)
|
||||
add_custom_target(doc
|
||||
add_custom_target(
|
||||
doc
|
||||
COMMAND "${CMAKE_COMMAND} -E remove_directory html"
|
||||
COMMAND "${DOXYGEN_EXECUTABLE} Doxyfile" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
|
||||
COMMAND "${DOXYGEN_EXECUTABLE} Doxyfile" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
4
README
Normal file
4
README
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
OpenHantek is an oscilloscope software for Hantek DSO-6022 USB devices.
|
||||
The source code and detailed developer documentation is available at:
|
||||
https://github.com/OpenHantek/OpenHantek6022 (oscilloscope software)
|
||||
https://github.com/Ho-Ro/Hantek6022API (hardware, firmware and tools)
|
||||
|
|
@ -51,7 +51,7 @@ else()
|
|||
RESULT_VARIABLE CMD_RESULT
|
||||
OUTPUT_VARIABLE VCS_URL
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
)
|
||||
# message( STATUS "VCS_URL: ${VCS_URL}")
|
||||
|
||||
set(ENV{LANG} "en_US")
|
||||
|
|
@ -64,7 +64,7 @@ else()
|
|||
RESULT_VARIABLE CMD_RESULT
|
||||
OUTPUT_VARIABLE CHANGELOG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
)
|
||||
endif()
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/changelog" "${CHANGELOG}")
|
||||
endif()
|
||||
|
|
@ -72,7 +72,6 @@ endif()
|
|||
string(TIMESTAMP DATE_VERSION "%Y%m%d")
|
||||
string(TIMESTAMP CURRENT_TIME "%Y%m%d_%H:%M")
|
||||
|
||||
|
||||
if (UNIX)
|
||||
execute_process(
|
||||
COMMAND uname -m
|
||||
|
|
@ -82,12 +81,45 @@ if (UNIX)
|
|||
)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
if (NOT APPLE)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(CPACK_TARGET "")
|
||||
set(CPACK_GENERATOR ${CPACK_GENERATOR} DEB RPM)
|
||||
else()
|
||||
install(
|
||||
FILES utils/udev_rules/60-hantek.rules
|
||||
DESTINATION lib/udev/rules.d
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(CPACK_TARGET "freebsd_")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
|
||||
install(
|
||||
FILES utils/devd_rules_freebsd/openhantek.conf
|
||||
DESTINATION etc/devd
|
||||
)
|
||||
elseif(APPLE)
|
||||
set(CPACK_TARGET "osx_")
|
||||
endif()
|
||||
|
||||
# install documentation
|
||||
FILE(GLOB PDF "docs/*.pdf")
|
||||
install(
|
||||
FILES CHANGELOG LICENSE README ${PDF}
|
||||
DESTINATION share/doc/openhantek
|
||||
)
|
||||
# install application starter and icons
|
||||
install(
|
||||
FILES utils/applications/OpenHantek.desktop
|
||||
DESTINATION share/applications
|
||||
)
|
||||
install(
|
||||
FILES openhantek/res/images/OpenHantek.png
|
||||
DESTINATION share/icons/hicolor/48x48/apps
|
||||
)
|
||||
install(
|
||||
FILES openhantek/res/images/OpenHantek.svg
|
||||
DESTINATION share/icons/hicolor/scalable/apps
|
||||
)
|
||||
|
||||
elseif(WIN32)
|
||||
set(CPACK_TARGET "win_")
|
||||
set(CPACK_GENERATOR ${CPACK_GENERATOR} ZIP NSIS)
|
||||
|
|
@ -98,19 +130,19 @@ elseif(WIN32)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Packege: ${CPACK_GENERATOR}")
|
||||
message(STATUS "Architecture: ${CPACK_ARCH}")
|
||||
|
||||
set(CPACK_PACKAGE_NAME "openhantek")
|
||||
string(TOLOWER ${CPACK_PACKAGE_NAME} CPACK_PACKAGE_NAME)
|
||||
#set(CPACK_PACKAGE_VERSION "${DATE_VERSION}-${GIT_COMMIT_HASH}")
|
||||
set(CPACK_PACKAGE_VERSION "${DATE_VERSION}-${VCS_REVISION}")
|
||||
set(CPACK_PACKAGE_CONTACT "contact@openhantek.org")
|
||||
set(CPACK_PACKAGE_VENDOR "OpenHantek Community")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Digital oscilloscope software for Hantek DSO6022 USB hardware")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "OpenHantek is an oscilloscope software for\nVoltcraft/Darkwire/Protek/Acetech/Hantek USB devices")
|
||||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/readme.md")
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
endif()
|
||||
|
||||
set(CPACK_STRIP_FILES 1)
|
||||
|
|
|
|||
|
|
@ -97,16 +97,7 @@ if(NOT WIN32)
|
|||
endif()
|
||||
|
||||
# install commands
|
||||
if (APPLE AND BUILD_MACOSX_BUNDLE)
|
||||
#set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
# MACOSX_BUNDLE_NAME "${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
|
||||
else()
|
||||
if ( NOT (APPLE AND BUILD_MACOSX_BUNDLE) )
|
||||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION "bin")
|
||||
endif()
|
||||
include(../cmake/copy_qt5_dlls_to_bin_dir.cmake)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
// Do not edit, will be re-created at each commit!
|
||||
#define OH_BUILD "20200710 build 716"
|
||||
#define OH_BUILD "20200710 build 717"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue