File: WriteVersionInclude.cmake

package info (click to toggle)
kicad 9.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 769,124 kB
  • sloc: cpp: 960,330; ansic: 121,001; xml: 66,428; python: 18,382; sh: 1,010; awk: 301; asm: 292; makefile: 227; javascript: 167; perl: 10
file content (25 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Part of the KiCad Documentation Project
#
# (c) KiCad Developers

set( GIT_VERSION_TEXT
":kicad-version-long: ${KICAD_VERSION_LONG}
:kicad-version-short: ${KICAD_VERSION_SHORT}
:doc-commit: ${DOC_COMMIT}
" )

set( _write_version_file ON )
if( EXISTS ${OUTPUT_FILE} )
    file( READ ${OUTPUT_FILE} _old_contents )
    if( _old_contents STREQUAL GIT_VERSION_TEXT )
        message( STATUS "Not updating ${OUTPUT_FILE}" )
        set( _write_version_file OFF )
    endif()
endif()

if( _write_version_file )
    message( STATUS "Writing ${OUTPUT_FILE} with versions: ${DOC_COMMIT}, ${KICAD_VERSION_LONG}. ${KICAD_VERSION_SHORT}" )
    file( WRITE ${OUTPUT_FILE} ${GIT_VERSION_TEXT} )
endif()