vengi/cmake/GenerateUnity.cmake

15 lines
379 B
CMake

file(WRITE ${UNITY_SRC}.in "")
foreach(SRC ${SRCS})
get_filename_component(extension ${SRC} EXT)
if (NOT "${extension}" STREQUAL ".cpp")
continue()
endif()
if (IS_ABSOLUTE ${SRC})
file(APPEND ${UNITY_SRC}.in "#include \"${SRC}\"\n")
else()
file(APPEND ${UNITY_SRC}.in "#include \"${DIR}/${SRC}\"\n")
endif()
endforeach()
configure_file(${UNITY_SRC}.in ${UNITY_SRC})