Skip to content

Commit

Permalink
Handle _CROW_ILL or _CROW_ICD being NOTFOUND
Browse files Browse the repository at this point in the history
If the variable is NOTFOUND then set it to "". Then at the end after possible list appends. If the variable is not "" then update the target properties.

This gets rid of a warning
  • Loading branch information
DavidPetkovsek authored and gittiver committed Feb 20, 2024
1 parent 3f632dd commit 1e864a2
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions cmake/CrowConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ check_required_components("@PROJECT_NAME@")
get_target_property(_CROW_ILL Crow::Crow INTERFACE_LINK_LIBRARIES)
get_target_property(_CROW_ICD Crow::Crow INTERFACE_COMPILE_DEFINITIONS)

if(_CROW_ILL STREQUAL "_CROW_ILL-NOTFOUND")
set(_CROW_ILL "")
endif()
if(_CROW_ICD STREQUAL "_CROW_ICD-NOTFOUND")
set(_CROW_ICD "")
endif()

list(REMOVE_ITEM _CROW_ILL "ZLIB::ZLIB" "OpenSSL::SSL")
list(REMOVE_ITEM _CROW_ICD "CROW_ENABLE_SSL" "CROW_ENABLE_COMPRESSION")

Expand All @@ -41,7 +48,13 @@ if("ssl" IN_LIST CROW_FEATURES)
list(APPEND _CROW_ICD "CROW_ENABLE_SSL")
endif()

set_target_properties(Crow::Crow PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${_CROW_ICD}"
INTERFACE_LINK_LIBRARIES "${_CROW_ILL}"
)
if( NOT (_CROW_ICD STREQUAL "" ) )
set_target_properties(Crow::Crow PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${_CROW_ICD}"
)
endif()
if( NOT (_CROW_ILL STREQUAL "" ) )
set_target_properties(Crow::Crow PROPERTIES
INTERFACE_LINK_LIBRARIES "${_CROW_ILL}"
)
endif()

0 comments on commit 1e864a2

Please sign in to comment.