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

Generated CMake config files do not define CURL_STATIC for static builds #2817

Closed
Adnn opened this issue Jul 31, 2018 · 0 comments
Closed

Generated CMake config files do not define CURL_STATIC for static builds #2817

Adnn opened this issue Jul 31, 2018 · 0 comments
Labels

Comments

@Adnn
Copy link
Contributor

Adnn commented Jul 31, 2018

I am building Curl 7.61.0 using the CMake files, and I see it is now generating config files (CMake/curl-config.cmake) when installed. Big thanks for adding this feature to your CMake code !

Up to now, we where using a custom FindCurl.cmake module, that was detecting when the library was statically compiled, and when it was the case, was defining CURL_STATICLIB as an INTERFACE_COMPILE_DEFINITIONS of the imported curl target, with this code:

set_target_properties(CURL::libcurl PROPERTIES
    INTERFACE_COMPILE_DEFINITIONS
	CURL_STATICLIB
)

Looking through the config files generated during install, this symbol is never defined on the imported static target, thus this target make downstream build fail at link time.

@bagder bagder added the cmake label Jul 31, 2018
Adnn added a commit to Adnn/curl that referenced this issue Aug 1, 2018
This change allows to use the CMake config files generated by Curl's
CMake scripts for static builds of the library.
The symbol CURL_STATIC lib must be defined to compile downstream,
thus the config package is the perfect place to do so.

Fixes curl#2817
Reported-by: adnn
@bagder bagder closed this as completed in ab66a80 Aug 15, 2018
xquery pushed a commit to xquery/curl that referenced this issue Sep 3, 2018
This change allows to use the CMake config files generated by Curl's
CMake scripts for static builds of the library.
The symbol CURL_STATIC lib must be defined to compile downstream,
thus the config package is the perfect place to do so.

Fixes curl#2817
Closes curl#2823
Reported-by: adnn on github
Reviewed-by: Sergei Nikulov
falconindy pushed a commit to falconindy/curl that referenced this issue Sep 10, 2018
This change allows to use the CMake config files generated by Curl's
CMake scripts for static builds of the library.
The symbol CURL_STATIC lib must be defined to compile downstream,
thus the config package is the perfect place to do so.

Fixes curl#2817
Closes curl#2823
Reported-by: adnn on github
Reviewed-by: Sergei Nikulov
@lock lock bot locked as resolved and limited conversation to collaborators Nov 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants