Generate_Schema.cmake 674 Bytes
Newer Older
1 2 3 4 5
find_program(XXD_PROG xxd)
if (XXD_PROG)
  ADD_CUSTOM_COMMAND(
        OUTPUT ${CMAKE_SOURCE_DIR}/io/xml/inputSchema.h
        COMMAND ${XXD_PROG} -i FleurInputSchema.xsd inputSchema.h
6
        DEPENDS ${CMAKE_SOURCE_DIR}/io/xml/FleurInputSchema.xsd
7 8 9 10 11
	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/io/xml/
        COMMENT "Putting current Schema into inputSchema.h")
else()
  ADD_CUSTOM_COMMAND(
        OUTPUT ${CMAKE_SOURCE_DIR}/io/xml/inputSchema.h
12
        COMMAND cp  ${CMAKE_SOURCE_DIR}/io/xml/inputSchema.h.backup ${CMAKE_SOURCE_DIR}/io/xml/inputSchema.h
13 14
        COMMENT "No xxd found using backup")
  message("No xxd command found! Using backup of inputSchema.h")
15
endif()