Skip to content

Commit

Permalink
cmake: enable selinux support
Browse files Browse the repository at this point in the history
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 16, 2016
1 parent e93c7b0 commit af902ec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,16 @@ include_directories(${Boost_INCLUDE_DIRS})

find_package(Threads REQUIRED)

option(WITH_SELINUX "build SELinux policy" OFF)
if(WITH_SELINUX)
find_file(SELINUX_MAKEFILE selinux/devel/include/Makefile
PATH /usr/share)
if(NOT SELINUX_MAKEFILE)
message(FATAL_ERROR "Can't find selinux's Makefile")
endif()
add_subdirectory(selinux)
endif(WITH_SELINUX)

# find out which platform we are building on
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON)
Expand Down
11 changes: 11 additions & 0 deletions selinux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_custom_target(
ceph.pp ALL
COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/ceph.* .
COMMAND make -f ${SELINUX_MAKEFILE} ceph.pp
DEPENDS ceph.te ceph.fc ceph.if)

set(datadir ${CMAKE_INSTALL_PREFIX}/share/selinux)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ceph.pp
DESTINATION ${datadir}/packages)
install(FILES ceph.if
DESTINATION ${datadir}/devel/include/contrib)

0 comments on commit af902ec

Please sign in to comment.