You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB

10 years ago
cmake_minimum_required(VERSION 2.8.5)
project(sway C)
set(CMAKE_C_FLAGS "-g")
set(CMAKE_C_STANDARD 99)
10 years ago
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/")
add_definitions("-Wall -Wextra -Wno-unused-parameter")
10 years ago
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake)
find_package(XKBCommon REQUIRED)
find_package(WLC REQUIRED)
find_package(A2X REQUIRED)
find_package(PCRE REQUIRED)
10 years ago
FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
include_directories(
${WLC_INCLUDE_DIRS}
${PCRE_INCLUDE_DIRS}
include/
10 years ago
)
add_executable(sway
${sources}
)
target_link_libraries(sway
${WLC_LIBRARIES}
${XKBCOMMON_LIBRARIES}
${PCRE_LIBRARIES}
10 years ago
)
INSTALL(
TARGETS sway
RUNTIME DESTINATION bin
)
INSTALL(
FILES ${PROJECT_SOURCE_DIR}/config
DESTINATION /etc/sway/
)
9 years ago
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.1
COMMAND ${A2X_COMMAND} --no-xmllint --doctype manpage --format manpage
9 years ago
-D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}/sway.1.txt
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sway.1.txt
)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.5
COMMAND ${A2X_COMMAND} --no-xmllint --doctype manpage --format manpage
9 years ago
-D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}/sway.5.txt
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sway.5.txt
)
ADD_CUSTOM_TARGET(man ALL
DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.1
DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.5)
INSTALL(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.1
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
9 years ago
)
INSTALL(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sway.5
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man5
9 years ago
)
INSTALL(
FILES ${PROJECT_SOURCE_DIR}/sway.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/wayland-sessions/)
INSTALL(
FILES ${PROJECT_SOURCE_DIR}/sway-xorg.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/xsessions/)