Skip to content

Uninitialized CMake variable JSONCPP_VERSION #1656

@oold

Description

@oold

Describe the bug
In configure_file("${PROJECT_SOURCE_DIR}/version.in" "${PROJECT_BINARY_DIR}/version" NEWLINE_STYLE UNIX), the variable JSONCPP_VERSION used in the template header is not set. This causes the version file in the binary directory to be empty.

CMake Warning (dev) at src/CDK/CORELIB/MAIN/3rdparty/jsoncpp/CMakeLists.txt:100 (configure_file):
  uninitialized variable 'JSONCPP_VERSION'

You probably meant to use the jsoncpp_VERSION variable in version.in.

To Reproduce
Steps to reproduce the behavior:

  1. Configure project with CMake. Use --warn-uninitialized to see the warning.

Expected behavior
The correct variable is used and the project version is written to the version file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions