mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-26 16:11:02 +08:00
Prepare for make package by cpack
This commit is contained in:
parent
064a486be8
commit
e03b720290
@ -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)
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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"
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user