Merge pull request #287 from christophgysin/cmake
cmake: extract config from toplevel CMakeLists.txtmaster
commit
fc01f04c93
@ -0,0 +1,31 @@
|
||||
find_package(A2X REQUIRED)
|
||||
|
||||
add_custom_target(man ALL)
|
||||
|
||||
function(add_manpage name section)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
|
||||
COMMAND ${A2X_COMMAND}
|
||||
--no-xmllint
|
||||
--doctype manpage
|
||||
--format manpage
|
||||
-D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
|
||||
COMMENT Generating manpage for ${name}.${section}
|
||||
)
|
||||
|
||||
add_custom_target(man-${name}.${section}
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
|
||||
)
|
||||
add_dependencies(man
|
||||
man-${name}.${section}
|
||||
)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
|
||||
DESTINATION share/man/man${section}
|
||||
COMPONENT documentation
|
||||
)
|
||||
endfunction()
|
@ -0,0 +1,48 @@
|
||||
find_package(XKBCommon REQUIRED)
|
||||
find_package(WLC REQUIRED)
|
||||
find_package(PCRE REQUIRED)
|
||||
find_package(Wayland REQUIRED)
|
||||
find_package(JsonC REQUIRED)
|
||||
|
||||
include(Wayland)
|
||||
WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell
|
||||
${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml
|
||||
desktop-shell
|
||||
)
|
||||
|
||||
file(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
|
||||
file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
|
||||
|
||||
include_directories(
|
||||
${WLC_INCLUDE_DIRS}
|
||||
${PCRE_INCLUDE_DIRS}
|
||||
${JSONC_INCLUDE_DIRS}
|
||||
${XKBCOMMON_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_executable(sway
|
||||
${sources}
|
||||
${common}
|
||||
${proto-desktop-shell}
|
||||
)
|
||||
|
||||
target_link_libraries(sway
|
||||
${WLC_LIBRARIES}
|
||||
${XKBCOMMON_LIBRARIES}
|
||||
${PCRE_LIBRARIES}
|
||||
${JSONC_LIBRARIES}
|
||||
${WAYLAND_SERVER_LIBRARIES}
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS sway
|
||||
RUNTIME
|
||||
DESTINATION bin
|
||||
COMPONENT runtime
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/config
|
||||
DESTINATION ${FALLBACK_CONFIG_DIR}
|
||||
COMPONENT configuration
|
||||
)
|
Loading…
Reference in new issue