add_library(libowlps-resultreader.a STATIC libowlps-resultreader.c) add_library(libowlps-resultreader.so SHARED libowlps-resultreader.c) set_target_properties( libowlps-resultreader.a libowlps-resultreader.so PROPERTIES OUTPUT_NAME owlps-resultreader SOVERSION 1 VERSION 1.0 ) target_link_libraries(libowlps-resultreader.so libowlps.so) target_link_libraries(libowlps-resultreader.a libowlps.a) add_executable(owlps-resultreader-udp owlps-resultreader-udp.c) target_link_libraries(owlps-resultreader-udp libowlps.so libowlps-resultreader.so) add_executable(owlps-resultreader-udp.semistatic EXCLUDE_FROM_ALL owlps-resultreader-udp.c) target_link_libraries(owlps-resultreader-udp.semistatic libowlps.a libowlps-resultreader.a) # Add the semistatic target to the global list of semistatic targets list(APPEND OWLPS_SEMISTATIC_TARGETS owlps-resultreader-udp.semistatic) set(OWLPS_SEMISTATIC_TARGETS ${OWLPS_SEMISTATIC_TARGETS} PARENT_SCOPE) add_executable(owlps-resultreader-udp.static EXCLUDE_FROM_ALL owlps-resultreader-udp.c) set_target_properties(owlps-resultreader-udp.static PROPERTIES LINK_FLAGS -static) target_link_libraries(owlps-resultreader-udp.static libowlps.a libowlps-resultreader.a) # Add the static target to the global list of static targets list(APPEND OWLPS_STATIC_TARGETS owlps-resultreader-udp.static) set(OWLPS_STATIC_TARGETS ${OWLPS_STATIC_TARGETS} PARENT_SCOPE)