[CMake] Try to fix r239612, not to miss resources/windows_version_resource.rc in...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 14 Jun 2015 21:47:29 +0000 (21:47 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 14 Jun 2015 21:47:29 +0000 (21:47 +0000)
  - Who defines ${LLVM_SOURCE_DIR} ?
  - Would windows_version_resource.rc be available in an *installed* llvm tree?
    I suggest it may be installed in ${PREFIX}/share.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239703 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddLLVM.cmake

index 06919d9..63a76ad 100644 (file)
@@ -237,9 +237,11 @@ function(add_windows_version_resource_file OUT_VAR)
   set(sources ${ARGN})
   if (MSVC)
     set(resource_file ${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc)
-    set(sources ${sources} ${resource_file})
-    source_group("Resource Files" ${resource_file})
-    set(windows_resource_file ${resource_file} PARENT_SCOPE)
+    if(EXISTS ${resource_file})
+      set(sources ${sources} ${resource_file})
+      source_group("Resource Files" ${resource_file})
+      set(windows_resource_file ${resource_file} PARENT_SCOPE)
+    endif()
   endif(MSVC)
 
   set(${OUT_VAR} ${sources} PARENT_SCOPE)