CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(drm-trusted CXX) #Verbose #SET(CMAKE_VERBOSE_MAKEFILE ON) # Message #MESSAGE("FLAGS: ${CMAKE_C_FLAGS}") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(LIBDIR ${PREFIX}/lib) SET(INCLUDEDIR ${PREFIX}/include) SET(VERSION 0.0.1) SET(SRCS service/drm_trusted_client.cpp service/drm_trusted_client_ipc.cpp ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) SET(extapi "-fvisibility=hidden") SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${extapi}") #SET(DEBUG "-Wall -Werror -ggdb3 -fno-omit-frame-pointer -rdynamic -fno-optimize-sibling-calls -fstack-protector-all") #SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${DEBUG}") INCLUDE(FindPkgConfig) pkg_check_modules(exppkgs REQUIRED dlog capi-base-common) FOREACH(flag ${exppkgs_CFLAGS}) SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} "-ldl" ) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${exppkgs_LDFLAGS}) SET_TARGET_PROPERTIES( drm-trusted PROPERTIES SOVERSION 0 VERSION 0.0.1 ) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") IF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DTARGET") MESSAGE("add -DTARGET") ENDIF("${ARCH}" STREQUAL "arm") CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc) INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION /usr/include/drm-trusted/)