build: do not pollute source tree with icd-dispatch-table.h
authorChia-I Wu <olv@lunarg.com>
Wed, 19 Nov 2014 14:55:33 +0000 (22:55 +0800)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 26 Nov 2014 17:03:12 +0000 (10:03 -0700)
Generate icd-dispatch-table.h in the binary directory and add the diretory to
ICD_INCLUDE_DIRS.

icd/common/CMakeLists.txt

index 866d2b6..5086b44 100644 (file)
@@ -1,6 +1,5 @@
-# the use of CMAKE_CURRENT_SOURCE_DIR pollutes the source tree
 add_custom_command(OUTPUT icd-dispatch-table.h
-       COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-table > ${CMAKE_CURRENT_SOURCE_DIR}/icd-dispatch-table.h
+       COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-table > icd-dispatch-table.h
                   DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py
                           ${PROJECT_SOURCE_DIR}/xgl.py)
 
@@ -25,6 +24,12 @@ endif()
 
 pkg_check_modules(ICD REQUIRED ${ICD_REQUIRED_MODULES})
 
+# icd-dispatch-table.h was generated in ${CMAKE_CURRENT_BINARY_DIR}
+set(ICD_INCLUDE_DIRS
+       ${ICD_INCLUDE_DIRS}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       CACHE INTERNAL "")
+
 include_directories(
        ${ICD_INCLUDE_DIRS}
 )