diff --git a/cmake/FindBluelib.cmake b/cmake/FindBluelib.cmake index 9994092..27c75ee 100644 --- a/cmake/FindBluelib.cmake +++ b/cmake/FindBluelib.cmake @@ -49,7 +49,7 @@ if (Bluelib_STATIC) set(_lib_suffix "-s") endif () -set(supported_components Core Object Term Cmd) +set(supported_components Core Object Term Cmd Io Serial Compress) set(components ${Bluelib_FIND_COMPONENTS}) string(REPLACE ";" ", " supported_components_string_list "${supported_components}") @@ -123,7 +123,7 @@ if (Bluelib_FOUND) message(FATAL_ERROR "Bluelib: Module 'Object' depends on 'Core', which was not specified in find_package()") endif () - #target_link_libraries(Bluelib::Object INTERFACE Bluelib::Core) + target_link_libraries(Bluelib::Object INTERFACE Bluelib::Core) endif () if ("${component}" STREQUAL "Term") @@ -135,7 +135,19 @@ if (Bluelib_FOUND) message(FATAL_ERROR "Bluelib: Module 'Term' depends on 'Object', which was not specified in find_package()") endif () - #target_link_libraries(Bluelib::Term INTERFACE Bluelib::Core Bluelib::Object) + target_link_libraries(Bluelib::Term INTERFACE Bluelib::Core Bluelib::Object) + endif () + + if ("${component}" STREQUAL "Serial") + if (NOT TARGET Bluelib::Core) + message(FATAL_ERROR "Bluelib: Module 'Serial' depends on 'Core', which was not specified in find_package()") + endif () + + if (NOT TARGET Bluelib::Object) + message(FATAL_ERROR "Bluelib: Module 'Serial' depends on 'Object', which was not specified in find_package()") + endif () + + target_link_libraries(Bluelib::Serial INTERFACE Bluelib::Core Bluelib::Object) endif () if ("${component}" STREQUAL "Cmd") @@ -151,7 +163,27 @@ if (Bluelib_FOUND) message(FATAL_ERROR "Bluelib: Module 'Cmd' depends on 'Term', which was not specified in find_package()") endif () - #target_link_libraries(Bluelib::Cmd INTERFACE Bluelib::Core Bluelib::Object Bluelib::Term) + target_link_libraries(Bluelib::Cmd INTERFACE Bluelib::Core Bluelib::Object Bluelib::Term) + endif () + + if ("${component}" STREQUAL "Io") + if (NOT TARGET Bluelib::Core) + message(FATAL_ERROR "Bluelib: Module 'Io' depends on 'Core', which was not specified in find_package()") + endif () + + if (NOT TARGET Bluelib::Object) + message(FATAL_ERROR "Bluelib: Module 'Io' depends on 'Object', which was not specified in find_package()") + endif () + + target_link_libraries(Bluelib::Io INTERFACE Bluelib::Core Bluelib::Object) + endif () + + if ("${component}" STREQUAL "Compress") + if (NOT TARGET Bluelib::Core) + message(FATAL_ERROR "Bluelib: Module 'Compress' depends on 'Core', which was not specified in find_package()") + endif () + + target_link_libraries(Bluelib::Compress INTERFACE Bluelib::Core Bluelib::Object) endif () endforeach (component) endif()