add_library(pluginloader STATIC pluginloader.cpp pluginloader.h) target_link_libraries(pluginloader PUBLIC Qt6::Core Qt6::Widgets) if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") add_executable(load_plugin test/pluginloader.cpp) target_link_libraries(load_plugin GTest::gtest GTest::gtest_main Qt6::Core) endif()