1 CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
2 PROJECT(privilege-info VERSION 0.0.7 LANGUAGES C)
4 INCLUDE(GNUInstallDirs)
7 IF(NOT CMAKE_BUILD_TYPE)
8 SET(CMAKE_BUILD_TYPE "RELEASE")
9 ENDIF(NOT CMAKE_BUILD_TYPE)
11 SET(CMAKE_C_FLAGS_DEBUG "-std=c11 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
12 SET(CMAKE_C_FLAGS_RELEASE "-std=c11 -O2 -DNDEBUG")
14 ADD_DEFINITIONS("-Werror")
15 ADD_DEFINITIONS("-Wall")
16 ADD_DEFINITIONS("-Wextra")
18 SET(CMAKE_POSITION_INDEPENDENT_CODE "True")
19 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
21 PKG_CHECK_MODULES(PRIVILEGE_INFO_DEPS REQUIRED
24 security-privilege-manager
28 INCLUDE_DIRECTORIES(SYSTEM ${PRIVILEGE_INFO_DEPS_INCLUDE_DIRS})
29 LINK_DIRECTORIES(${PRIVILEGE_INFO_DEPS_LIBRARY_DIRS})
30 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include)
33 ADD_SUBDIRECTORY(test)