add_library(rsa-interface INTERFACE) target_include_directories(rsa-interface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) target_sources(rsa-interface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/rsa.h ) target_link_libraries(rsa-interface INTERFACE cmix-crypto-interface ) foreach(impl ${rsa_implementations}) add_subdirectory(${impl}) endforeach() add_library(rsa-implementation rsa.h rsa.c ) target_include_directories(rsa-implementation PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) target_link_libraries(rsa-implementation PUBLIC rsa-${rsa_implementation} )