1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(this_target appinfo)
6 SET(VERSION "${VERSION_MAJOR}.1.2")
8 #INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)
10 INCLUDE(FindPkgConfig)
11 pkg_check_modules(pkgs REQUIRED
15 FOREACH(flag ${pkgs_CFLAGS})
16 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
20 SET (${this_target}_SOURCE_FILES
21 ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.c
24 ADD_LIBRARY(${this_target} SHARED ${${this_target}_SOURCE_FILES})
26 SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
27 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
28 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
29 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed")
31 SET_TARGET_PROPERTIES(${this_target}
38 TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS})
41 SET(PC_NAME ${this_target})
42 SET(PC_REQUIRED ${pc_requires})
43 SET(PC_LDFLAGS -l${this_target})
45 CONFIGURE_FILE(appinfo.pc.in appinfo.pc @ONLY)
47 INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp
48 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
49 GROUP_EXECUTE GROUP_READ
50 WORLD_EXECUTE WORLD_READ)
52 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.h DESTINATION include/osp)
53 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)