Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ARCH_INDEPENDENT parameter to write_basic_package_version_file() #893

Merged
merged 1 commit into from
Jun 10, 2020
Merged

Conversation

xvitaly
Copy link
Contributor

@xvitaly xvitaly commented Jun 6, 2020

Added ARCH_INDEPENDENT parameter to write_basic_package_version_file(), because this is a architecture agnostic header-only library.

Regression caused by #879.

This PR fixes the following issue:

find_package(Microsoft.GSL CONFIG REQUIRED)

Result:

CMake Error at cmake/external/gsl/CMakeLists.txt:11 (find_package):
  Could not find a configuration file for package "Microsoft.GSL" that is
  compatible with requested version "".
  The following configuration files were considered but not accepted:
    /usr/share/cmake/Microsoft.GSL/Microsoft.GSLConfig.cmake, version: 3.1.0 (32bit)
-- Configuring incomplete, errors occurred!

If the library was built on a 32-bit host and then used on 64-bit machines (which is absolutely fine for the architecture independent libraries), it cannot be found by Cmake.

N.B. ARCH_INDEPENDENT parameter requires Cmake 3.14+.

@leha-bot
Copy link
Contributor

leha-bot commented Jun 7, 2020

Sorry about breakage of arch_independent.
Seems that the CMake built-in cmake_parse_arguments doesn't support generator expressions. We could try to make a LIST of arguments and conditionally append the ARCH_INDEPENDENT flag and call write_basic_package_version_file() with LIST of args.

@ghost
Copy link

ghost commented Jun 7, 2020

CLA assistant check
All CLA requirements met.

@xvitaly
Copy link
Contributor Author

xvitaly commented Jun 7, 2020

Fixed compatibility with the ancient Cmake versions. Now it should work fine.

@JordanMaples
Copy link
Contributor

Thanks for the fix.

@JordanMaples JordanMaples merged commit 98002ab into microsoft:master Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants