-
Notifications
You must be signed in to change notification settings - Fork 18
Support clients using CMake #34
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
I like this even better. Thanks! |
So, linking against Thanks a bunch for working on this. |
It looks like my idea of "core" lib is actually |
|
So if I understand correctly (target -> how it appears in the install interface):
And do away with |
No, sorry keep |
4944c1c to
2a2e978
Compare
Supporting clients using CMake requires that a project provides a CMake package that can be found via find_package(). The package name was first suggested to be MicrosoftIFC in microsoft#29, but to follow the pattern of GSL I changed it to Microsoft.IFC, which is still very similar. The package exports 3 targets: - Microsoft.IFC::Core - Microsoft.IFC::DOM - Microsoft.IFC::SDK Microsoft.IFC::SDK is just an interface target, which links to the other targets as a convenient all-in-one target. This enables usage like so: find_package(Microsoft.IFC REQUIRED) target_link_libraries(project_target PRIVATE Microsoft.IFC::SDK) The ifc-printer executable was made an opt-in target. The project now also has an opt-in developer mode option for its developers via the DEVELOPER_MODE cache variable, which will enable the printer target and make testing available. For people who wish not to use vcpkg to fetch GSL, an opt-in find module is provided to download and setup GSL for the project by providing the cmake/find directory via the CMAKE_MODULE_PATH command line option. This can be done depending on your shell like so: # cmd -D "CMAKE_MODULE_PATH:PATH=%cd%\cmake\find" # pwsh & POSIX shell -D "CMAKE_MODULE_PATH:PATH=$PWD/cmake/find" Fixes: microsoft#29
2a2e978 to
de05762
Compare
Word smith MSVC compiler usage
Remove `-Woverloaded-virtual` from GCC and Clang flags. Guarding against overriding accidentally being overloading is better enforced though C++ Core Guidelines Rule [C.128](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override)
Word smith the notes in **Presets** section.
| include(GNUInstallDirs) | ||
|
|
||
| if(BUILD_PRINTER) | ||
| install(TARGETS ifc-printer DESTINATION . COMPONENT Printer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you choose . for any particular reason? I am changing it to bin in my env so I don't need to change my PATH if, for example, I install it with prefix /usr/local
ie: I think it's better to have it in /usr/local/bin/ifc-printer than just /usr/local/ifc-printer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have it in
/usr/local/bin/ifc-printerthan just/usr/local/ifc-printer
Agreed. I should have spotted that during review.
Supporting clients using CMake requires that a project provides a CMake
package that can be found via find_package().
The package name was first suggested to be MicrosoftIFC in #29, but to
follow the pattern of GSL I changed it to Microsoft.IFC, which is still
very similar.
The package exports 3 targets:
Microsoft.IFC::SDK is just an interface target, which links to the other
targets as a convenient all-in-one target. This enables usage like so:
The ifc-printer executable was made an opt-in target.
The project now also has an opt-in developer mode option for its
developers via the DEVELOPER_MODE cache variable, which will enable the
printer target and make testing available.
For people who wish not to use vcpkg to fetch GSL, an opt-in find module
is provided to download and setup GSL for the project by providing the
cmake/find directory via the CMAKE_MODULE_PATH command line option. This
can be done depending on your shell like so:
Fixes: #29