-
Notifications
You must be signed in to change notification settings - Fork 1.1k
cmake: don't set PACKAGE_VERSION in Config.cmake #1080
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
Conversation
don't include the ConfigVersion.cmake in Config.cmake as this sets e.g. PACKAGE_VERSION in other projects find_package-ing AWSSDK. Use AWSDK_VERSION for printing the found version instead it is supposed to be.
friendly ping... |
ping... |
Hi @flixr |
Unless you explicitly include the version file in the config file... which you should you not do and is not needed. A minimal sample showing this should look something like this:
Now PROJECT_VERSION is not the version of |
To be precise, Meanwhile, It does make sense to rename it to CMakeLists.txt: cmake_minimum_required(VERSION 3.5)
project(my_project VERSION 1.1)
message(STATUS "PACKAGE_VERSION: ${PACKAGE_VERSION}")
message(STATUS "PROJECT_VERSION: ${PROJECT_VERSION}")
find_package(AWSSDK REQUIRED s3)
message(STATUS "PACKAGE_VERSION: ${PACKAGE_VERSION}")
message(STATUS "PROJECT_VERSION: ${PROJECT_VERSION}")
find_package(PkgConfig)
message(STATUS "PACKAGE_VERSION: ${PACKAGE_VERSION}")
message(STATUS "PROJECT_VERSION: ${PROJECT_VERSION}") Output:
|
Actually, cmake_minimum_required(VERSION 3.5)
project(my_project)
find_package(AWSSDK)
message(STATUS "AWSSDK_VERSION: ${AWSSDK_VERSION}") |
yes, and to not set PACKAGE_VERSION globally (which was only used to print the AWSSDK_VERSION), the config version file should not be included in the config file. |
aws-sdk-cpp/cmake/AWSSDKConfig.cmake Line 27 in e4b4b31
I can't seem to figure out where this |
IIRC this is automatically created by cmake and this should not be include in the XConfig.cmake file |
@specious can this be merged? With the current CMake config file it messes up any project where we find_packge awssdk! |
I'm not a maintainer of this project and I'm not sure what the correct decision would be. |
@sdavtaker , could you pleas take a look at this PR? |
don't include the ConfigVersion.cmake in Config.cmake
as this sets e.g. PACKAGE_VERSION in other projects find_package-ing
AWSSDK.
Use AWSDK_VERSION for printing the found version instead it is supposed
to be.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.