Commit 3b8525c4 authored by Tobias Mayer's avatar Tobias Mayer

Avoid clash of duplicate uninstall target

This can happen if CAF is integrated into a larget cmake build
through add_subdirectory(). In case another project in the
superbuild defines a target with the same name, cmake aborts.
parent ad35a5c7
......@@ -404,12 +404,15 @@ install(DIRECTORY libcaf_test/caf/ DESTINATION include/caf
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
# add uninstall target
add_custom_target(uninstall
# add uninstall target if it does not exist yet
if(NOT TARGET uninstall)
add_custom_target(uninstall)
endif()
add_custom_command(TARGET uninstall
PRE_BUILD
COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
################################################################################
# set inclue paths for subprojects #
################################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment