aboutsummaryrefslogtreecommitdiff
path: root/test/includes/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/includes/CMakeLists.txt')
-rw-r--r--test/includes/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/includes/CMakeLists.txt b/test/includes/CMakeLists.txt
new file mode 100644
index 0000000000..a139683b42
--- /dev/null
+++ b/test/includes/CMakeLists.txt
@@ -0,0 +1,15 @@
+file(GLOB_RECURSE PRE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} pre/*.h)
+
+foreach(hfile ${PRE_HEADERS})
+ string(REGEX REPLACE ^pre/ post/ post_hfile ${hfile})
+ get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} PATH)
+ file(MAKE_DIRECTORY ${hdir})
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile}
+ COMMAND ${CMAKE_C_COMPILER} -std=c99 -E -P
+ ${CMAKE_CURRENT_SOURCE_DIR}/${hfile}
+ -o ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile})
+ list(APPEND POST_HEADERS ${post_hfile})
+endforeach()
+
+add_custom_target(unittest-headers DEPENDS ${POST_HEADERS})