# define plugin-files set ( UFOPLUGINS AlignmentBehaviour AverageBehaviour CachingBehaviour CohesionBehaviour DeltaMinBehaviour FixedVelocityBehaviour FollowPilotBehaviour FollowWaypointsBehaviour InverseBehaviour RandomBehaviour SampleBehaviour SampleSteerable ScaleBehaviour SeparationBehaviour StrongestBehaviour FaceForwardBehaviour ) ################################################################################ # Create plugin rules: ################################################################################ foreach (plugin ${UFOPLUGINS}) # add plugins as MODULE (shared library meant to be included using dlopen or similiar) add_library ( ${plugin} MODULE ${plugin}.cpp ) # make plugin dependant on libufo target target_link_libraries ( ${plugin} ufo ) # determine type from "MAKEPLUGIN" macro: execute_process ( COMMAND sed "-n" "/MAKEPLUGIN/ s/MAKEPLUGIN\\ *([^,][^,]*,\\ *\\([A-Z][a-z]*\\)\\ *,.*/\\1/p" "${plugin}.cpp" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE type OUTPUT_STRIP_TRAILING_WHITESPACE) # rename for ufo's plugin system: # (i.e. not libSampleBehaviour.so, but ufoplugin_Behaviour_SampleBehaviour.so) set_target_properties ( ${plugin} PROPERTIES OUTPUT_NAME "ufoplugin_${type}_${plugin}" ) # set install directive: install (TARGETS ${plugin} DESTINATION ${UFO_TARGET_LIB_DIR}) endforeach() # group sources for IDEs: source_group(ufoplugins\\core FILES ${UFOPLUGINS})