set(prefix_option -DCMAKE_INSTALL_PREFIX="${ARG_PREFIX}")
endif()
+ set(file_dependencies)
+ set(target_dependencies)
+ foreach(dependency ${ARG_DEPENDS})
+ if(TARGET ${dependency})
+ list(APPEND target_dependencies ${dependency})
+ else()
+ list(APPEND file_dependencies ${dependency})
+ endif()
+ endforeach()
+
add_custom_target(${target}
- DEPENDS ${ARG_DEPENDS}
+ DEPENDS ${file_dependencies}
COMMAND "${CMAKE_COMMAND}"
${component_option}
${prefix_option}
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
USES_TERMINAL)
add_custom_target(${target}-stripped
- DEPENDS ${ARG_DEPENDS}
+ DEPENDS ${file_dependencies}
COMMAND "${CMAKE_COMMAND}"
${component_option}
${prefix_option}
-DCMAKE_INSTALL_DO_STRIP=1
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
USES_TERMINAL)
+ if(target_dependencies)
+ add_dependencies(${target} ${target_dependencies})
+ add_dependencies(${target}-stripped ${target_dependencies})
+ endif()
endfunction()
macro(add_llvm_library name)