Generate icd-dispatch-table.h in the binary directory and add the diretory to
ICD_INCLUDE_DIRS.
-# 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)
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}
)