CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET (this_target osp-content) SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) SET(pc_requires "osp-appfw osp-uifw osp-image osp-media osp-net chromium glib-2.0 aul capi-content-media-content capi-media-metadata-extractor capi-content-mime-type") INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED ${pc_requires}) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) INCLUDE_DIRECTORIES( inc src src/inc /usr/include/curl /usr/include/osp/base /usr/include/osp/io /usr/include/osp/media /usr/include/osp/graphics /usr/include/osp/net /usr/include/osp/system /usr/include/osp/app /usr/include/osp/security /usr/include/web ) SET (${this_target}_SOURCE_FILES src/FCnt_AudioMetadataImpl.cpp src/FCnt_ContentManagerImpl.cpp src/FCnt_ContentManagerUtilImpl.cpp src/FCnt_ContentUtility.cpp src/FCnt_ContentSearchImpl.cpp src/FCnt_ContentDirectoryImpl.cpp src/FCnt_PlayListImpl.cpp src/FCnt_PlayListManagerImpl.cpp src/FCnt_ContentTransferImpl.cpp src/FCnt_ImageMetadataImpl.cpp src/FCnt_VideoMetadataImpl.cpp src/FCnt_ContentTransferEvent.cpp src/FCnt_ContentDownloadHandler.cpp src/FCnt_ContentDownloadListener.cpp src/FCnt_ContentDownloadUserData.cpp src/FCnt_DownloadManagerImpl.cpp src/FCnt_DownloadRequestImpl.cpp src/FCnt_ContentInfoImpl.cpp src/FCnt_ImageContentInfoImpl.cpp src/FCnt_AudioContentInfoImpl.cpp src/FCnt_VideoContentInfoImpl.cpp src/FCnt_OtherContentInfoImpl.cpp src/FCnt_ContentInfoHelper.cpp src/FCntAudioContentInfo.cpp src/FCntAudioMetadata.cpp src/FCntContentInfo.cpp src/FCntContentManager.cpp src/FCntContentManagerUtil.cpp src/FCntContentSearch.cpp src/FCntContentDirectory.cpp src/FCntPlayList.cpp src/FCntPlayListManager.cpp src/FCntContentSearchResult.cpp src/FCntContentTransfer.cpp src/FCntContentTransferInfo.cpp src/FCntImageContentInfo.cpp src/FCntImageMetadata.cpp src/FCntOtherContentInfo.cpp src/FCntVideoContentInfo.cpp src/FCntVideoMetadata.cpp src/FCntDownloadManager.cpp src/FCntDownloadRequest.cpp ) 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} ${pkgs_LDFLAGS}) TARGET_LINK_LIBRARIES(${this_target} "-losp-locations") TARGET_LINK_LIBRARIES(${this_target} "-lexif") TARGET_LINK_LIBRARIES(${this_target} "-lcapi-web-url-download") TARGET_LINK_LIBRARIES(${this_target} "-lpthread") SET_TARGET_PROPERTIES(${this_target} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1 ) 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 ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/content FILES_MATCHING PATTERN "*.h") # pkgconfig file SET(PC_NAME ${this_target}) SET(VERSION ${FULLVER}) SET(PC_REQUIRED ${pc_requires}) SET(PC_LDFLAGS "-l${this_target} -pthread") CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)