How to idomatically set the version number in a CMAKE/CPACK project? -


i'm trying edit cpack settings outputted package file has correct version number in it. that's not all. i'd cmake/cpack have places version number updated set. .so file should set. , whatever else needs it.

from sit, cpack documentation appears telling us repeat ourselves.

if nothing, output file so:

mystuff-0.1.1-linux.tar.gz 

let's version number should 1.2.3.

i think minimalistic cpack settings cause version numbers changed -- , placed these lines in cmakelists.txt file:

set(cpack_package_description_summary "my app great") set(cpack_package_vendor "my name") set(cpack_package_description_file "${cmake_current_source_dir}/readme.md") set(cpack_resource_file_license "${cmake_current_source_dir}/license")  set(cpack_package_version_major "1") set(cpack_package_version_minor "3") set(cpack_package_version_patch "2") 

when build, output file still mystuff-0.1.1-linux.tar.gz

if repeat myself , this:

set(cpack_package_version "${cpack_package_version_major}.${cpack_package_version_minor}.${cpack_package_version_patch}") 

now variable set, file still mystuff-0.1.1-linux.tar.gz

it seems must change cpack_package_file_name

what other places have re-state version number?

this doesn't feel idiomatic. must missing make automatic. supposed specify variable @ earlier point in time? see projects on internet containing cpackconfig.cmake file -- file contains overrides, still see repeating oneself going on in well.

this bug mentions same thing. apparently, want repeat ourselves. (as of 2015) however, if case, wondering if has found work-around?

if no work around, how way re-state variables end automatically set correctly? instance, doing following way compose version number using variables

set(cpack_package_version "${cpack_package_version_major}.${cpack_package_version_minor}.${cpack_package_version_patch}") 

according documentation, file name composed this:

set(cpack_package_file_name "${cpack_package_name}-${cpack_package_version}-${cpack_system_name}")

there other variables need re-setting. if have restate everything, need restate complete?

make sure have following line after setting cpack_... variables:

include (cpack) 

this spot cpack_package_file_name , others automatically set, version variables (such cpack_package_version_major) must set @ point.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -