ensure custom install targets don't conflict

(required when building as subdirectory)
This commit is contained in:
Martchus 2016-01-21 16:35:12 +01:00
parent 020f2b7992
commit f76a72c866
2 changed files with 36 additions and 24 deletions

View File

@ -8,7 +8,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION "A simple password manager.") set(META_APP_DESCRIPTION "A simple password manager.")
set(META_VERSION_MAJOR 2) set(META_VERSION_MAJOR 2)
set(META_VERSION_MINOR 1) set(META_VERSION_MINOR 1)
set(META_VERSION_PATCH 0) set(META_VERSION_PATCH 1)
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}) set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
# stringification of meta data # stringification of meta data
@ -158,28 +158,40 @@ install(FILES ${QM_FILES}
DESTINATION share/${META_PROJECT_NAME}/translations DESTINATION share/${META_PROJECT_NAME}/translations
COMPONENT localization COMPONENT localization
) )
add_custom_target(install-binary if(NOT TARGET install-binary)
DEPENDS ${META_PROJECT_NAME} add_custom_target(install-binary
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" DEPENDS ${META_PROJECT_NAME}
) COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
add_custom_target(install-desktop )
DEPENDS ${META_PROJECT_NAME} endif()
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=desktop -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" if(NOT TARGET install-desktop)
) add_custom_target(install-desktop
add_custom_target(install-localization DEPENDS ${META_PROJECT_NAME}
DEPENDS ${META_PROJECT_NAME} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=desktop -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=localization -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" )
) endif()
add_custom_target(strip-mingw-w64 if(NOT TARGET install-localization)
DEPENDS install-binary install-localization add_custom_target(install-localization
) DEPENDS ${META_PROJECT_NAME}
add_custom_target(install-binary-strip COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=localization -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
DEPENDS ${META_PROJECT_NAME} )
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" endif()
) if(NOT TARGET strip-mingw-w64)
add_custom_target(install-mingw-w64-strip add_custom_target(strip-mingw-w64
DEPENDS install-binary-strip install-localization DEPENDS install-binary install-localization
) )
endif()
if(NOT TARGET install-binary-strip)
add_custom_target(install-binary-strip
DEPENDS ${META_PROJECT_NAME}
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
)
endif()
if(NOT TARGET install-mingw-w64-strip)
add_custom_target(install-mingw-w64-strip
DEPENDS install-binary-strip install-localization
)
endif()
# manual stripping # manual stripping

View File

@ -4,7 +4,7 @@ appname = "Password Manager"
appauthor = Martchus appauthor = Martchus
appurl = "https://github.com/$${appauthor}/$${projectname}" appurl = "https://github.com/$${appauthor}/$${projectname}"
QMAKE_TARGET_DESCRIPTION = "A simple password manager." QMAKE_TARGET_DESCRIPTION = "A simple password manager."
VERSION = 2.1.0 VERSION = 2.1.1
# include ../../common.pri when building as part of a subdirs project; otherwise include general.pri # include ../../common.pri when building as part of a subdirs project; otherwise include general.pri
!include(../../common.pri) { !include(../../common.pri) {