]> granicus.if.org Git - clang/commitdiff
Add header files to CMake build solution. It use globing so it doesn't need to be...
authorCedric Venet <cedric.venet@laposte.net>
Sun, 2 Nov 2008 16:28:53 +0000 (16:28 +0000)
committerCedric Venet <cedric.venet@laposte.net>
Sun, 2 Nov 2008 16:28:53 +0000 (16:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58566 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index ccc1158376da41bd3622cf866eed1a718b9b2330..a033a9b15b6e2ffdfefcea85dc953ec8df22600b 100644 (file)
@@ -1,5 +1,14 @@
 macro(add_clang_library name)
-  add_library( ${name} ${ARGN} )
+  set(srcs ${ARGN})
+  if(MSVC_IDE)
+    file( GLOB_RECURSE headers *.h)
+    set(srcs ${srcs} ${headers})
+    string( REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
+    list( GET split_path -1 dir)
+    file( GLOB_RECURSE headers ../../include/clang${dir}/*.h)
+    set(srcs ${srcs} ${headers})
+  endif(MSVC_IDE)
+  add_library( ${name} ${srcs} )
   if( LLVM_COMMON_DEPENDS )
     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
   endif( LLVM_COMMON_DEPENDS )
@@ -9,7 +18,12 @@ macro(add_clang_library name)
 endmacro(add_clang_library)
 
 macro(add_clang_executable name)
-  add_llvm_executable( ${name} ${ARGN} )
+  set(srcs ${ARGN})
+  if(MSVC_IDE)
+    file( GLOB_RECURSE headers *.h)
+    set(srcs ${srcs} ${headers})
+  endif(MSVC_IDE)
+  add_llvm_executable( ${name} ${srcs} )
   install(TARGETS ${name}
     RUNTIME DESTINATION bin)
 endmacro(add_clang_executable)