~raffi-enficiaud-x/yayi/develop

« back to all changes in this revision

Viewing changes to cmake/version_generator.cmake

  • Committer: Raffi Enficiaud
  • Date: 2020-09-26 22:47:46 UTC
  • mfrom: (210.1.1)
  • Revision ID: git-v1:430058354ad3176f85139f3ecf131ad1e693f976
Merged in conan-integration (pull request #2)

Conan integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    set(_current_branch "master")
72
72
    set(_should_generate TRUE)
73
73
  else()
74
 
 
75
 
 
76
74
    set(_current_rev)
77
75
    set(_current_date)
78
76
    set(_current_branch)
79
77
    get_git_revisions(_current_rev _current_date _current_branch)
80
 
    if(${_current_rev} STREQUAL "none")
 
78
    if("${_current_rev}" STREQUAL "none")
81
79
      message(STATUS "[REVISION] looks like a tarball")
82
80
      set(_is_archive TRUE)
83
81
      if(NOT EXISTS ${filename_to_generate})
84
82
        set(_current_rev "archive")
85
83
        set(_current_date "archive")
86
84
        set(_should_generate TRUE)
87
 
        message(FATAL_ERROR "[REVISION] Cannot determine the version of the current code. The file ${filename_to_generate} is missing.")
 
85
        message(FATAL_ERROR "[REVISION] Cannot determine the version of the current code. The file '${filename_to_generate}' is missing.")
88
86
      else()
89
 
        message(STATUS "[REVISION] file ${filename_to_generate} already contains the version")
 
87
        message(STATUS "[REVISION] file '${filename_to_generate}' already contains the version")
90
88
      endif()
91
89
    endif()
92
90
  endif()
108
106
  endif()
109
107
 
110
108
  if(_should_generate)
111
 
    set(${_yayi_previous_revision_file} ${_current_rev} CACHE INTERNAL "internal revision to avoid repeated rebuild for file ${filename_to_generate}" FORCE)
 
109
    set(${_yayi_previous_revision_file} ${_current_rev} CACHE INTERNAL "internal revision to avoid repeated rebuild for file '${filename_to_generate}'" FORCE)
112
110
 
113
111
    set(yayi_version      ${YAYI_VERSION})
114
112
    if(NOT _current_branch STREQUAL master)
117
115
    set(revision_version  ${_current_rev})
118
116
    set(revision_date     ${_current_date})
119
117
 
120
 
    message(STATUS "[REVISION] Yayi version ${yayi_version}, revision ${_current_rev}, branch ${_current_branch}, commited at ${_current_date} flushed into file ${filename_to_generate}")
 
118
    message(STATUS "[REVISION] Yayi version '${yayi_version}', revision '${_current_rev}', branch '${_current_branch}', commited at '${_current_date}' flushed into file ${filename_to_generate}")
121
119
    configure_file(${template_file_name} ${filename_to_generate})
122
120
    set_source_files_properties(${filename_to_generate} PROPERTIES GENERATED TRUE)
123
121
    unset(revision_version)
131
129
  unset(_current_date)
132
130
 
133
131
endmacro(generate_library_version)
134
 
 
135