From dea579fde3b86968a9ca26c0f62eddb0bff3b5b9 Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Mon, 23 Nov 2009 00:32:42 +0000 Subject: [PATCH] CMake: Do not try to install a target before it is defined. llvm-svn: 89636 --- llvm/cmake/modules/AddLLVM.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 27ed9565117b..0ecd153c6be4 100755 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -72,23 +72,25 @@ endmacro(add_llvm_executable name) macro(add_llvm_tool name) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR}) - if( LLVM_BUILD_TOOLS ) - install(TARGETS ${name} RUNTIME DESTINATION bin) - else() + if( NOT LLVM_BUILD_TOOLS ) set(EXCLUDE_FROM_ALL ON) endif() add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_TOOLS ) + install(TARGETS ${name} RUNTIME DESTINATION bin) + endif() endmacro(add_llvm_tool name) macro(add_llvm_example name) # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_EXAMPLES_BINARY_DIR}) - if( LLVM_BUILD_EXAMPLES ) - install(TARGETS ${name} RUNTIME DESTINATION examples) - else() + if( NOT LLVM_BUILD_EXAMPLES ) set(EXCLUDE_FROM_ALL ON) endif() add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) + install(TARGETS ${name} RUNTIME DESTINATION examples) + endif() endmacro(add_llvm_example name)