ensure custom install targets don't conflict

(required when building as subdirectory)
This commit is contained in:
Martchus 2016-01-21 16:26:39 +01:00
parent a8f7644350
commit 780b608529
1 changed files with 28 additions and 18 deletions

View File

@ -127,21 +127,31 @@ foreach(HEADER_FILE ${HEADER_FILES})
COMPONENT header COMPONENT header
) )
endforeach() endforeach()
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-header )
DEPENDS ${META_PROJECT_NAME} endif()
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=header -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" if(NOT TARGET install-header)
) add_custom_target(install-header
add_custom_target(install-mingw-w64 DEPENDS ${META_PROJECT_NAME}
DEPENDS install-binary install-header COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=header -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
) )
add_custom_target(install-binary-strip endif()
DEPENDS ${META_PROJECT_NAME} if(NOT TARGET install-mingw-w64)
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" add_custom_target(install-mingw-w64
) DEPENDS install-binary install-header
add_custom_target(install-mingw-w64-strip )
DEPENDS install-binary-strip install-header 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-header
)
endif()