From e03b720290a4a8882fe70c13c4522807e2a1b62a Mon Sep 17 00:00:00 2001 From: Sergey Yagovtsev Date: Wed, 2 Nov 2016 22:37:51 +0300 Subject: [PATCH] Prepare for make package by cpack --- CMakeLists.txt | 22 ++++++++++++++++++++++ profiler_gui/CMakeLists.txt | 22 ++++++++++++++++++++++ src/CMakeLists.txt | 18 +++++++++++++++++- 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78876ce..dce803f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ project(profiling_tool) cmake_minimum_required(VERSION 2.8) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set( ROOT ${CMAKE_CURRENT_LIST_DIR} @@ -35,7 +37,27 @@ else() ) endif(UNIX) +set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/sdk) + add_subdirectory(src) add_subdirectory(sample) add_subdirectory(reader) add_subdirectory(profiler_gui) + +install(FILES +COPYING +DESTINATION . +) + +set(CPACK_PACKAGE_NAME "easy_profiler") +set(CPACK_PACKAGE_RELEASE 1) +set(CPACK_PACKAGE_CONTACT "Easy Profiler Team") +set(CPACK_PACKAGE_VENDOR "Easy Profiler Team") +if(UNIX) + set(CPACK_GENERATOR "TGZ") +else() + set(CPACK_GENERATOR "ZIP") +endif(UNIX) + +set(CPACK_PACKAGE_VERSION "v1.0.0") +include(CPack) diff --git a/profiler_gui/CMakeLists.txt b/profiler_gui/CMakeLists.txt index b77084e..f652659 100644 --- a/profiler_gui/CMakeLists.txt +++ b/profiler_gui/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5Network REQUIRED) +find_package(Qt5Svg REQUIRED) add_executable(${PROJECT_NAME} main.cpp @@ -47,3 +48,24 @@ if(UNIX) endif(UNIX) target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::Network easy_profiler ${SPECIAL_LIB}) + +install(TARGETS ${PROJECT_NAME} + DESTINATION bin + COMPONENT binaries +) + +get_target_property(QtCore_location Qt5::Core LOCATION) +get_target_property(QtWidgets_location Qt5::Widgets LOCATION) +get_target_property(QtNetwork_location Qt5::Network LOCATION) +get_target_property(QtGui_location Qt5::Gui LOCATION) +get_target_property(QtSvg_location Qt5::Svg LOCATION) + +install(FILES + ${QtCore_location} + ${QtWidgets_location} + ${QtNetwork_location} + ${QtGui_location} + ${QtSvg_location} + DESTINATION bin + COMPONENT binaries +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 22de932..8b2546d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,23 @@ endif(WIN32) add_library(${PROJECT_NAME} SHARED ${SOURCES}) if(UNIX) -set(PLATFORM_LIBS pthread) + set(PLATFORM_LIBS pthread) endif(UNIX) target_link_libraries(${PROJECT_NAME} ${PLATFORM_LIBS}) + +install(TARGETS easy_profiler + DESTINATION lib + COMPONENT sdk +) + +install(TARGETS easy_profiler + RUNTIME DESTINATION bin + COMPONENT sdk +) + +install(DIRECTORY ${ROOT}/include/easy + DESTINATION include/ + COMPONENT sdk + FILES_MATCHING PATTERN "*.h" +) \ No newline at end of file