Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_project_ver_issue' into 'master'
Browse files Browse the repository at this point in the history
CMake: fix retrieving PROJECT_VER

See merge request espressif/esp-idf!5842
  • Loading branch information
projectgus committed Aug 22, 2019
2 parents 0a30468 + 4690152 commit f85ba35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/en/api-guides/build-system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ The call requires the target chip to be specified with *target* argument. Option

- PROJECT_DIR - directory of the project; defaults to CMAKE_SOURCE_DIR
- PROJECT_NAME - name of the project; defaults to CMAKE_PROJECT_NAME
- PROJECT_VER - version/revision of the project; defaults to "0.0.0"
- PROJECT_VER - version/revision of the project; defaults to "1"
- SDKCONFIG - output path of generated sdkconfig file; defaults to PROJECT_DIR/sdkconfig or CMAKE_SOURCE_DIR/sdkconfig depending if PROJECT_DIR is set
- SDKCONFIG_DEFAULTS - defaults file to use for the build; defaults to empty
- BUILD_DIR - directory to place ESP-IDF build-related artifacts, such as generated binaries, text files, components; defaults to CMAKE_BINARY_DIR
Expand Down
6 changes: 3 additions & 3 deletions tools/cmake/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ endmacro()
#
macro(__build_set_default var default)
set(_var __${var})
if(${_var})
if(NOT "${_var}" STREQUAL "")
idf_build_set_property(${var} "${${_var}}")
else()
idf_build_set_property(${var} "${default}")
Expand Down Expand Up @@ -330,7 +330,7 @@ endfunction()
# @param[in, optional] PROJECT_DIR (single value) directory of the main project the buildsystem
# is processed for; defaults to CMAKE_SOURCE_DIR
# @param[in, optional] PROJECT_VER (single value) version string of the main project; defaults
# to 0.0.0
# to 1
# @param[in, optional] PROJECT_NAME (single value) main project name, defaults to CMAKE_PROJECT_NAME
# @param[in, optional] SDKCONFIG (single value) sdkconfig output path, defaults to PROJECT_DIR/sdkconfig
# if PROJECT_DIR is set and CMAKE_SOURCE_DIR/sdkconfig if not
Expand Down Expand Up @@ -366,7 +366,7 @@ macro(idf_build_process target)

__build_set_default(PROJECT_DIR ${CMAKE_SOURCE_DIR})
__build_set_default(PROJECT_NAME ${CMAKE_PROJECT_NAME})
__build_set_default(PROJECT_VER "0.0.0")
__build_set_default(PROJECT_VER 1)
__build_set_default(BUILD_DIR ${CMAKE_BINARY_DIR})

idf_build_get_property(project_dir PROJECT_DIR)
Expand Down
1 change: 0 additions & 1 deletion tools/cmake/project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function(__project_get_revision var)
else()
message(STATUS "Project is not inside a git repository, \
will not use 'git describe' to determine PROJECT_VER.")
set(PROJECT_VER "1")
endif()
endif()
endif()
Expand Down

0 comments on commit f85ba35

Please sign in to comment.