CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET(CMAKE_INSTALL_PREFIX /usr) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET (this_target osp-media) SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) INCLUDE_DIRECTORIES( inc src src/inc /usr/include /usr/include/curl /usr/include/glib-2.0 /usr/lib/glib-2.0/include /usr/include/libxml2 /usr/include/media /usr/include/osp /usr/include/osp/app /usr/include/osp/base /usr/include/osp/io /usr/include/osp/graphics /usr/include/osp/media /usr/include/osp/net /usr/include/osp/security /usr/include/osp/system /usr/include/osp/ui /usr/include/opencore-amrnb /usr/include/ogg /usr/include/system /usr/lib/dbus-1.0/include /usr/include/e_dbus-1 /usr/include/elementary-1 /usr/include/efreet-1 /usr/include/ecore-1 /usr/include/edje-1 /usr/include/evas-1 /usr/include/eet-1 /usr/include/eina-1 /usr/include/eina-1/eina /usr/include/ethumb-1 ) SET (${this_target}_SOURCE_FILES src/FMediaAudioIn.cpp src/FMedia_AudioInEvent.cpp src/FMedia_AudioInEventArg.cpp src/FMedia_AudioInImpl.cpp src/FMediaAudioOut.cpp src/FMedia_AudioOutImpl.cpp src/FMedia_AudioOutEvent.cpp src/FMedia_AudioOutEventArg.cpp src/FMediaTonePlayer.cpp src/FMediaTone.cpp src/FMedia_TonePlayerImpl.cpp src/FMedia_ToneGenerator.cpp src/FMedia_TonePlayerEvent.cpp src/FMedia_TonePlayerEventArg.cpp src/FMedia_CodecFactory.cpp src/FMedia_H264Decoder.cpp src/FMedia_H263Decoder.cpp src/FMedia_Mpeg4Decoder.cpp src/FMedia_VideoDecoderImpl.cpp src/FMedia_H263Encoder.cpp src/FMedia_Mpeg4Encoder.cpp src/FMedia_VideoEncoderImpl.cpp src/FMedia_BitWriter.cpp src/FMedia_AacDecoder.cpp src/FMedia_AacEncoder.cpp src/FMedia_Mp3Decoder.cpp src/FMedia_AmrDecoder.cpp src/FMedia_VorbisDecoder.cpp src/FMedia_G711Decoder.cpp src/FMedia_AmrEncoder.cpp src/FMedia_AudioDecoderImpl.cpp src/FMedia_AudioEncoderImpl.cpp src/FMediaAudioDecoder.cpp src/FMediaAudioEncoder.cpp src/FMediaVideoDecoder.cpp src/FMediaVideoEncoder.cpp src/FMediaCapability.cpp src/FMedia_CapabilityImpl.cpp src/FMedia_CapabilityCommon.cpp src/FMedia_CameraRefHelper.cpp src/FMedia_CameraCapability.cpp src/FMedia_CameraCoordinator.cpp src/FMediaCamera.cpp src/FMedia_CameraImpl.cpp src/FMedia_CameraEvent.cpp src/FMedia_CameraEventArg.cpp src/FMedia_CameraUtil.cpp src/FMedia_CameraManager.cpp src/FMedia_CameraCapabilitySession.cpp src/FMedia_CameraBuffer.cpp src/FMediaAudioRecorder.cpp src/FMedia_AudioRecorderImpl.cpp src/FMedia_AudioRecorderEvent.cpp src/FMedia_FfmpegUtil.cpp src/FMedia_RecorderEventArg.cpp src/FMedia_RecorderCapability.cpp src/FMedia_RecorderUtil.cpp src/FMediaVideoRecorder.cpp src/FMedia_VideoRecorderImpl.cpp src/FMedia_VideoRecorderEvent.cpp src/FMedia_VideoSourceAdapter.cpp src/FMedia_RecorderManager.cpp src/FMedia_RecorderSession.cpp src/FMediaPlayer.cpp src/FMedia_PlayerImpl.cpp src/FMedia_PlayerEvent.cpp src/FMedia_PlayerEventArg.cpp src/FMedia_PlayerVideoEvent.cpp src/FMedia_PlayerVideoEventArg.cpp src/FMedia_PlayerProgressiveDownloadEvent.cpp src/FMedia_PlayerProgressiveDownloadEventArg.cpp src/FMediaAudioStreamInfo.cpp src/FMediaVideoStreamInfo.cpp src/FMediaMediaStreamInfo.cpp src/FMedia_AudioStreamInfoImpl.cpp src/FMedia_VideoStreamInfoImpl.cpp src/FMedia_MediaStreamInfoImpl.cpp src/FMediaAudioRouteInfo.cpp src/FMedia_AudioRouteInfoImpl.cpp src/FMediaAudioRouteManager.cpp src/FMedia_AudioRouteManagerImpl.cpp src/FMedia_AudioRouteEvent.cpp src/FMedia_AudioRouteEventArg.cpp src/FMedia_AudioManagerConvert.cpp src/FMediaAudioEqualizer.cpp src/FMedia_AudioEqualizerImpl.cpp src/FMediaVideoFrameExtractor.cpp src/FMedia_VideoFrameExtractorImpl.cpp src/FMediaAudioFrame.cpp src/FMedia_AudioFrameImpl.cpp src/FMedia_AudioStreamCoordinator.cpp src/FMediaVideoFrame.cpp src/FMedia_VideoFrameImpl.cpp src/FMedia_VideoStreamCoordinator.cpp ) ## Definitions SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" ) ## SET C COMPILER FLAGS SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") ## SET CPP COMPILER FLAGS SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") ## Create Library ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) ## SET LINKER FLAGS SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed") TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" ) TARGET_LINK_LIBRARIES(${this_target} "-losp-image-core" ) TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" ) TARGET_LINK_LIBRARIES(${this_target} "-losp-image" ) TARGET_LINK_LIBRARIES(${this_target} "-losp-net" ) TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-audio-io") TARGET_LINK_LIBRARIES(${this_target} "-lxml2" ) TARGET_LINK_LIBRARIES(${this_target} "-lexif" ) TARGET_LINK_LIBRARIES(${this_target} "-lswscale" ) TARGET_LINK_LIBRARIES(${this_target} "-lavcodec" ) TARGET_LINK_LIBRARIES(${this_target} "-lavutil" ) TARGET_LINK_LIBRARIES(${this_target} "-lvorbis" ) TARGET_LINK_LIBRARIES(${this_target} "-logg" ) TARGET_LINK_LIBRARIES(${this_target} "-lpthread" ) TARGET_LINK_LIBRARIES(${this_target} "-lopencore-amrnb" ) TARGET_LINK_LIBRARIES(${this_target} "-lmmffile" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-player") TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-sound-manager") TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-camera" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-recorder" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-media-metadata-extractor") TARGET_LINK_LIBRARIES(${this_target} "-levas") SET_TARGET_PROPERTIES(${this_target} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1 ) ADD_CUSTOM_COMMAND(TARGET ${this_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} COMMENT "strip ${this_target}" ) INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp FILES_MATCHING PATTERN "*.so*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug FILES_MATCHING PATTERN "*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/media FILES_MATCHING PATTERN "*.h") SET(PC_NAME ${this_target}) SET(PC_REQUIRED ${pc_requires}) SET(PC_LDFLAGS -l${this_target}) # pkgconfig file CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)