summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCedric Venet <cedric.venet@laposte.net>2008-11-02 16:28:53 +0000
committerCedric Venet <cedric.venet@laposte.net>2008-11-02 16:28:53 +0000
commitfe2f808a51f1d3f74510f5bbd5198671dc7631a5 (patch)
tree1f962e34dd7c8306334257ea8e6b5754bc1b7c65 /CMakeLists.txt
parent04b90bc00fc6ce8bc6c559e56220ceb77cdbccf6 (diff)
Add header files to CMake build solution. It use globing so it doesn't need to be manually maintained, but it won't automatically detect a new header. I think this is a good compromise for the header files, since there presence in the solution is just an help for the user. Moreover, a new header is often introduced with a new cpp source file which need a makefile change, which will regenerate the solution and detect the new header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ccc1158376..a033a9b15b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)