With ESP-IDF v4.3, I wish to set the project version (e.g. "1.2.3") in the CMake call to `project(... VERSION 1.2.3 ...)`, however from what I can tell, this is a redefined `project()` macro that doesn't seem to pass on the VERSION parameter.
Therefore the variables CMAKE_PROJECT_VERSION and PROJECT_VERSION are not set:
Code: Select all
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(myproject VERSION 1.2.3 LANGUAGES C)
message(STATUS "PROJECT_VERSION: ${PROJECT_VERSION}")
message(STATUS "CMAKE_PROJECT_VERSION: ${CMAKE_PROJECT_VERSION}")
Obviously I can set these manually in the top-level CMakeLists.txt, which is tedious because there are a lot of them (CMAKE_PROJECT_VERSION_MAJOR, CMAKE_PROJECT_VERSION_MINOR, ..., PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, ...) but apart from that, is there an intention for the redefined `project` to not pass in such parameters? Is this a bug-by-omission or intended?
Looking at esp-idf/tools/cmake/project.cmake I see:
Code: Select all
macro(project project_name)
...
# The actual call to project()
__project(${project_name} C CXX ASM)
I found some docs for `PROJECT_VER`: https://docs.espressif.com/projects/esp ... ystem.html
However this does not automatically expand out to PROJECT_VERSION_MAJOR, _MINOR, etc.
For context, I need the _MAJOR, _MINOR, _PATCH numbers to pass to CPack.