summaryrefslogtreecommitdiff
path: root/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-11-23 00:32:42 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-11-23 00:32:42 +0000
commit7be498e6e241396b71080410b9e66232409809bc (patch)
treeb943cbbd142b13fc29fb4ea138e90e0cbe9fce65 /cmake/modules/AddLLVM.cmake
parentb8352de5514276e7e66998744e5d9eb477076d29 (diff)
downloadllvm-7be498e6e241396b71080410b9e66232409809bc.tar.gz
llvm-7be498e6e241396b71080410b9e66232409809bc.tar.bz2
llvm-7be498e6e241396b71080410b9e66232409809bc.tar.xz
CMake: Do not try to install a target before it is defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake14
1 files changed, 8 insertions, 6 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 27ed956511..0ecd153c6b 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/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)