cmake: make d-bus and imlib optional again

This commit is contained in:
Michael Gehring 2008-06-20 12:15:43 +02:00
parent 7ed1ee43ca
commit 1a94a4b36e
1 changed files with 30 additions and 7 deletions

View File

@ -9,6 +9,9 @@ PROJECT(${PROJECT_AWE_NAME})
SET(CMAKE_BUILD_TYPE RELEASE)
OPTION(WITH_DBUS "build with D-BUS" ON)
OPTION(WITH_IMLIB "build with Imlib" ON)
ADD_DEFINITIONS(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra
-Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings
-Wsign-compare -Wunused -Wno-unused-parameter -Wuninitialized -Winit-self
@ -53,15 +56,38 @@ pkg_check_modules(AWE_MOD REQUIRED
xcb-keysyms
xcb-render
xcb-icccm
cairo-xcb
dbus-1
imlib2)
cairo-xcb)
# Check for readline and ncurse
# Check for readline, ncurse and libev
FIND_LIBRARY(LIB_READLINE readline)
FIND_LIBRARY(LIB_NCURSES ncurses)
FIND_LIBRARY(LIB_EV ev)
# Check for optional libs
IF(WITH_DBUS)
pkg_check_modules(DBUS dbus-1)
IF(DBUS_FOUND)
ADD_DEFINITIONS(-DWITH_DBUS)
SET(AWE_MOD_LIBRARIES ${AWE_MOD_LIBRARIES} ${DBUS_LIBRARIES})
SET(AWE_MOD_INCLUDE_DIRS ${AWE_MOD_INCLUDE_DIRS} ${DBUS_INCLUDE_DIRS})
ELSE()
SET(WITH_DBUS OFF)
MESSAGE(STATUS "DBUS not found. Disabled.")
ENDIF()
ENDIF()
IF(WITH_IMLIB)
pkg_check_modules(IMLIB imlib2)
IF(IMLIB_FOUND)
ADD_DEFINITIONS(-DWITH_IMLIB)
SET(AWE_MOD_LIBRARIES ${AWE_MOD_LIBRARIES} ${IMLIB_LIBRARIES})
SET(AWE_MOD_INCLUDE_DIRS ${AWE_MOD_INCLUDE_DIRS} ${IMLIB_INCLUDE_DIRS})
ELSE()
SET(WITH_IMLIB OFF)
MESSAGE(STATUS "Imlib not found. Disabled.")
ENDIF()
ENDIF()
# Check for lua5.1
FIND_PATH(LUA_INC_DIR lua.h
/usr/include
@ -92,9 +118,6 @@ IF(NOT LUA_LIB)
MESSAGE(FATAL_ERROR "lua library not found")
ENDIF()
# Add awesome defines
ADD_DEFINITIONS(-DWITH_DBUS -DWITH_IMLIB)
IF(DOXYGEN_EXECUTABLE)
ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/awesome.doxygen)
ENDIF()