Fix whitespaces in cmake config

This commit is contained in:
Mikkel Oscar Lyderik 2016-01-05 23:53:37 +01:00
parent 9186455a3c
commit 18f8185011

View file

@ -8,28 +8,28 @@ set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
add_definitions( add_definitions(
-D_GNU_SOURCE -D_GNU_SOURCE
) )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
list(INSERT CMAKE_MODULE_PATH 0 list(INSERT CMAKE_MODULE_PATH 0
${CMAKE_CURRENT_SOURCE_DIR}/CMake ${CMAKE_CURRENT_SOURCE_DIR}/CMake
) )
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
execute_process( execute_process(
COMMAND git describe --always COMMAND git describe --always
OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
execute_process( execute_process(
COMMAND git rev-parse --abbrev-ref HEAD COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
endif() endif()
add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\") add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\")
@ -57,10 +57,10 @@ find_package(PAM)
find_package(Backtrace) find_package(Backtrace)
if(Backtrace_FOUND) if(Backtrace_FOUND)
include_directories("${Backtrace_INCLUDE_DIRS}") include_directories("${Backtrace_INCLUDE_DIRS}")
add_definitions(-DSWAY_Backtrace_FOUND=1) add_definitions(-DSWAY_Backtrace_FOUND=1)
set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}") set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}")
set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}") set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}")
endif() endif()
include(FeatureSummary) include(FeatureSummary)
@ -68,14 +68,14 @@ include(Manpage)
include(GNUInstallDirs) include(GNUInstallDirs)
if (enable-gdk-pixbuf) if (enable-gdk-pixbuf)
if (GDK_PIXBUF_FOUND) if (GDK_PIXBUF_FOUND)
set(WITH_GDK_PIXBUF YES) set(WITH_GDK_PIXBUF YES)
add_definitions(-DWITH_GDK_PIXBUF) add_definitions(-DWITH_GDK_PIXBUF)
else() else()
message(WARNING "gdk-pixbuf required but not found, only png images supported.") message(WARNING "gdk-pixbuf required but not found, only png images supported.")
endif() endif()
else() else()
message(STATUS "Building without gdk-pixbuf, only png images supported.") message(STATUS "Building without gdk-pixbuf, only png images supported.")
endif() endif()
include_directories(include) include_directories(include)
@ -86,43 +86,43 @@ add_subdirectory(wayland)
add_subdirectory(sway) add_subdirectory(sway)
if(enable-swaybg) if(enable-swaybg)
if(CAIRO_FOUND AND PANGO_FOUND) if(CAIRO_FOUND AND PANGO_FOUND)
add_subdirectory(swaybg) add_subdirectory(swaybg)
else() else()
message(WARNING "Not building swaybg - cairo, and pango are required.") message(WARNING "Not building swaybg - cairo, and pango are required.")
endif() endif()
endif() endif()
if(enable-swaymsg) if(enable-swaymsg)
add_subdirectory(swaymsg) add_subdirectory(swaymsg)
endif() endif()
if(enable-swaygrab) if(enable-swaygrab)
add_subdirectory(swaygrab) add_subdirectory(swaygrab)
endif() endif()
if(enable-swaybar) if(enable-swaybar)
if(CAIRO_FOUND AND PANGO_FOUND) if(CAIRO_FOUND AND PANGO_FOUND)
add_subdirectory(swaybar) add_subdirectory(swaybar)
else() else()
message(WARNING "Not building swaybar - cairo, and pango are required.") message(WARNING "Not building swaybar - cairo, and pango are required.")
endif() endif()
endif() endif()
if(enable-swaylock) if(enable-swaylock)
if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND) if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
add_subdirectory(swaylock) add_subdirectory(swaylock)
else() else()
message(WARNING "Not building swaylock - cairo, pango, and PAM are required.") message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
endif() endif()
endif() endif()
install( install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
DESTINATION share/wayland-sessions DESTINATION share/wayland-sessions
COMPONENT data COMPONENT data
) )
install( install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg
DESTINATION share/sway DESTINATION share/sway
COMPONENT data COMPONENT data
) )
feature_summary(WHAT ALL) feature_summary(WHAT ALL)