set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) file(GLOB sources "*.cpp") set(libs common ${BOOST_LIBRARIES} ${JCLWrapper_LIBRARIES} ${JNSAppWrapper_LIBRARIES} ${ImageStreams_LIBRARIES} moggle_xxx) message(STATUS "Linking against the following libraries: ${libs}") foreach(source ${sources}) get_filename_component(exec ${source} NAME_WE) add_executable(${exec} ${source}) target_link_libraries(${exec} ${libs}) endforeach()