MonteverdiApplicationMacros.cmake 906 Bytes
Newer Older
1
macro(create_monteverdi_application)
2
  cmake_parse_arguments(APPLICATION  "" "NAME;OUTPUT_NAME;COMPONENT_NAME" "SOURCES;LINK_LIBRARIES" ${ARGN} )
3 4 5 6 7

  if(WIN32)
    add_executable(${APPLICATION_NAME}
      WIN32
      ${APPLICATION_SOURCES})
8
  else() #Unix
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
    add_executable(${APPLICATION_NAME}
      ${APPLICATION_SOURCES})
  endif()

  if (APPLICATION_OUTPUT_NAME)
    set_target_properties(${APPLICATION_NAME} PROPERTIES OUTPUT_NAME ${APPLICATION_OUTPUT_NAME})
  endif()

  target_link_libraries(${APPLICATION_NAME} ${APPLICATION_LINK_LIBRARIES})

install(TARGETS ${APPLICATION_NAME}
  RUNTIME DESTINATION ${Monteverdi_INSTALL_BIN_DIR} COMPONENT ${APPLICATION_COMPONENT_NAME}
  LIBRARY DESTINATION ${Monteverdi_INSTALL_LIB_DIR} COMPONENT ${APPLICATION_COMPONENT_NAME}
  ARCHIVE DESTINATION ${Monteverdi_INSTALL_LIB_DIR} COMPONENT ${APPLICATION_COMPONENT_NAME}
  )

endmacro(create_monteverdi_application)