1 # Copyright (C) 2015, Ivailo Monev, <xakepa10@gmail.com>
2 # Redistribution and use is allowed according to the terms of the BSD license.
4 # UNIFDEF_EXECUTABLE and HEADERS_DIRECTORY origin from the macro call
6 set(headers_directory "$ENV{DESTDIR}/${HEADERS_DIRECTORY}")
7 file(GLOB_RECURSE headers "${headers_directory}/*.h")
21 -UQT_NO_REGEXP_ANCHOR_ALT
22 -UQT_NO_REGEXP_BACKREF
23 -UQT_NO_REGEXP_CAPTURE
26 -UQT_NO_REGEXP_INTERVAL
27 -UQT_NO_REGEXP_LOOKAHEAD
29 -UQT_NO_REGEXP_WILDCARD
39 -UKtDeclarative_EXPORTS
42 -UKtScriptTools_EXPORTS
48 message(STATUS "Optimizing header in: ${headers_directory}")
50 COMMAND ${UNIFDEF_EXECUTABLE} -m ${unifdef_arguments} ${headers}
51 RESULT_VARIABLE unifdef_result
52 ERROR_VARIABLE unifdef_output
53 OUTPUT_VARIABLE unifdef_output
55 # unifdef exits with status 1 if the output differes, see its man page
56 if(unifdef_result GREATER 1)
57 message(FATAL_ERROR "${unifdef_output} (${unifdef_result})")