From 63efb4344490e200b5622ac8cf4a2ee465bde80b Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 24 Apr 2021 14:04:04 +0200 Subject: [PATCH] cmake: deduplicate install directives --- CMakeLists.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d60b219..9a64dd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,27 +76,23 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) IF(NOT WIN32) set(CPACK_GENERATOR "DEB;TGZ") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}") - - if (TARGET aptdec) - install(TARGETS aptdec) - install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") - endif() - - install(TARGETS apt) - install(FILES ${LIB_C_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt) else() #set(CPACK_GENERATOR "ZIP;NSIS") set(CPACK_GENERATOR "ZIP") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") if (TARGET aptdec) - install(TARGETS aptdec) file(GLOB_RECURSE DLLS *.dll) install(FILES ${DLLS} DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() - install(TARGETS apt) - install(FILES ${LIB_C_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt) +endif() + +if (TARGET aptdec) + install(TARGETS aptdec) install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") endif() +install(TARGETS apt) +install(FILES ${LIB_C_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt) + include(CPack)