Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: fix curl linking if CURL_LIBRARIES is not available
- Loading branch information
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -693,7 +693,11 @@ if(LibArchive_FOUND) | |
target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES}) | ||
endif(LibArchive_FOUND) | ||
if(CURL_FOUND) | ||
target_link_libraries(libtesseract PUBLIC ${CURL_LIBRARIES}) | ||
if(NOT "${CURL_LIBRARIES}") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zdenop
Author
Contributor
|
||
target_link_libraries(libtesseract PUBLIC CURL::libcurl) | ||
else() | ||
target_link_libraries(libtesseract PUBLIC ${CURL_LIBRARIES}) | ||
endif() | ||
endif(CURL_FOUND) | ||
set_target_properties (libtesseract PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) | ||
set_target_properties (libtesseract PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) | ||
|
@zdenop, I get lots of errors with this code:
It looks like in my case the
if
block is executed instead of theelse
block.Could it be that the statement should be
if (NOT CURL_LIBRARIES)
? That fixes the issue for me.