p-ranav / argparse

Argument Parser for Modern C++

Repository from Github https://github.comp-ranav/argparseRepository from Github https://github.comp-ranav/argparse

CMake package configuration version check is too strict

sergiud opened this issue · comments

While updating from argparse 3.0 to 3.1 I encountered the following problem:

CMake Error at CMakeLists.txt:11 (find_package):
  Could not find a configuration file for package "argparse" that is
  compatible with requested version "3.0.0".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/argparse/argparseConfig.cmake, version: 3.1.0
    /lib/cmake/argparse/argparseConfig.cmake, version: 3.1.0

Is it intentional that minor versions are considered incompatible between each other? If not, this code

argparse/CMakeLists.txt

Lines 57 to 60 in 68fd027

write_basic_package_version_file("${CMAKE_CONFIG_VERSION_FILE_NAME}"
COMPATIBILITY ExactVersion
${OPTIONAL_ARCH_INDEPENDENT}
)

should be updated to use either AnyNewerVersion or SameMajorVersion instead of ExactVersion as the COMPATIBILITY argument.

commented

Is it intentional that minor versions are considered incompatible between each other?

No, this is not intentional. Agreed, should be fixed.