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
Provide cmake config files to be used by users via find_package(CoolProp) #2144
Comments
Pull request welcome adding this
|
Awesome, I'll try to create a PR in the next days. I've noticed though, that you use a user-defined target name for the library. Do you really need this or does a fixed target name with a user defined library file name is sufficient? This will make the use from the users point of view much easier since the user knows, which target to link against (even though the resulting library file name might be different). |
I'm not sure about the target name. I would recommend you implement your
proposed solution and we can iterate.
Also, I would welcome more general discussion about how best to name the
targets.
|
The user can still specify the output / file name of the library as I used set_target_properties(CoolProp PROPERTIES OUTPUT_NAME ${LIB_NAME}) to rename the library. Addresses CoolProp#2144
This notifies cmake that only coolprop requires dl for building the library but dl is not part of the public interface is hence is not a direct dependency for the user. Addresses CoolProp#2144
This should avoid conflicting the library target name when creating snippet executables. Addresses CoolProp#2144
This allows to use the CoolProp library from cmake by simply linking against it, without to specify any additional include paths for the coolprop public header file. Addresses CoolProp#2144
This is the entry point for cmake to make find_package(CoolProp) work. Closes CoolProp#2144
This makes sure, that we dont get any linker error if we are linking against coolprop without any additional compiler switches. Fixes CoolProp#2144
@ibell It took me a while to find some free time for CoolProp, but today I managed to open a PR that adds cmake config file support. I am happy to discuss the details with you. |
Description
CoolProp creates and installs its C++ library via CMake "make install" target. However, the installed library does not provide a CMake package configuration file, which contains include paths, compiler defines and the link libraries.
It is considered best practice to provide such a configuration file. It allow users of the CoolProp library to use it as
Steps to Reproduce
Expected behavior: CoolProp installs the following files in the install step
Actual behavior: No cmake config files are installed, just the library and the header file.
Versions
CoolProp Version: master
Operating System and Version: all
Access Method: using the C++ library
Additional Information
To find out more about cmake target exports and config files, see: https://cliutils.gitlab.io/modern-cmake/chapters/install/installing.html
The text was updated successfully, but these errors were encountered: