LLDB_VERSION works analogous to CLANG_VERSION, with the exception that it includes the optional LLDB_VERSION_SUFFIX. Thus it should be equal to LLDB_VERSION_STRING and we could use it instead of extracting the plist value.
My preference would be to streamline version handling completely, including the code using it:
if(APPLE) set(apple_version_inc "${CMAKE_CURRENT_BINARY_DIR}/AppleVersion.inc") set(apple_version_script "${LLDB_SOURCE_DIR}/cmake/modules/EmbedAppleVersion.cmake") set(info_plist ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist) # Create custom target to generate the VC revision include. add_custom_command(OUTPUT "${apple_version_inc}" DEPENDS "${apple_version_script}" "${info_plist}" COMMAND ${CMAKE_COMMAND} "-DLLDB_INFO_PLIST=${info_plist}" "-DHEADER_FILE=${apple_version_inc}" -P "${apple_version_script}") # Mark the generated header as being generated. set_source_files_properties("${apple_version_inc}" PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. set_property(SOURCE lldb.cpp APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_APPLE_VERSION_INC") list(APPEND lldbBase_SOURCES ${apple_version_inc}) else()
What do you think?