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

Make CMake subdirectory usage easier #982

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Conversation

samh
Copy link
Contributor

@samh samh commented Aug 5, 2022

These tweaks will allow users to use SOCI as a subdirectory with CMake the same way as if they had called find_package (targets in the SOCI:: namespace, and no additional call to target_include_directories).

Everything should be backwards-compatible - the internal non-namespace targets continue to work as they did before, and if someone used target_include_directories as before it wouldn't break anything.

I also updated the documentation and examples to reflect the simplified usage.

Please let me know if you have any comments or want me to change anything. Thanks!

This allows targets to be used the same way when included as a subdirectory
as when using find_package (when using as a subdirectory, the existing
non-namespace usage still works too).
This removes the need to use target_include_directories when including SOCI
as a subdirectory, making subdir usage the same as find_package usage.
@vadz vadz added the CMake label Aug 5, 2022
@vadz
Copy link
Member

vadz commented Aug 5, 2022

The new way to use SOCI in a subdirectory is definitely much nicer to me than the old one, thanks for improving this!

If there are no objections, I'm going to merge this in a couple of days.

Thanks again!

@Tectu
Copy link
Contributor

Tectu commented Sep 14, 2022

Any news/update on this? :)

@vadz vadz merged commit a639ba8 into SOCI:master Sep 14, 2022
@vadz
Copy link
Member

vadz commented Sep 14, 2022

You're right, this should have been merged already -- done now.

@vadz vadz mentioned this pull request Sep 14, 2022
vadz added a commit to vadz/soci that referenced this pull request Sep 14, 2022
Use "Soci::" rather than "SOCI::" as the prefix, for consistency with
the other CMake variables defined by FindSoci.cmake.

Do not use "soci_" prefix for the library names which is completely
redundant with the other prefix, writing "Soci::soci_" is clearly
redundant.

See SOCI#982.
Krzmbrzl pushed a commit to Krzmbrzl/soci that referenced this pull request Sep 15, 2022
Use "Soci::" rather than "SOCI::" as the prefix, for consistency with
the other CMake variables defined by FindSoci.cmake.

Do not use "soci_" prefix for the library names which is completely
redundant with the other prefix, writing "Soci::soci_" is clearly
redundant.

See SOCI#982.
@zann1x zann1x mentioned this pull request Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants