1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(gtest-stc-manager C CXX)
4 SET(GTEST_TEST "gtest-stc-manager")
5 ADD_DEFINITIONS("-DUSE_DLOG")
7 SET(REQUIRES_LIST ${REQUIRES_LIST}
13 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
14 INCLUDE(FindPkgConfig)
15 PKG_CHECK_MODULES(GTEST_TEST_PKG REQUIRED ${REQUIRES_LIST})
17 FOREACH(flag ${GTEST_TEST_PKG_CFLAGS})
18 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
21 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -fPIE")
22 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
23 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
24 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
26 FILE(GLOB GTEST_TEST_SRCS *.cpp)
27 SET(GTEST_TEST_SRCS ${GTEST_TEST_SRCS})
29 ADD_EXECUTABLE(${GTEST_TEST} ${GTEST_TEST_SRCS})
30 TARGET_LINK_LIBRARIES(${GTEST_TEST} ${GTEST_TEST_LDFLAGS} ${GTEST_TEST_PKG_LDFLAGS} -ldl -lgcov)
32 INSTALL(TARGETS ${GTEST_TEST} RUNTIME DESTINATION ${BIN_DIR})