1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-18 13:55:11 -05:00
polybar/cmake/build/targets.cmake

51 lines
1.1 KiB
CMake
Raw Normal View History

2016-11-03 08:06:33 -04:00
#
# Custom targets
#
# Target: userconfig {{{
configure_file(
${PROJECT_SOURCE_DIR}/cmake/templates/userconfig.cmake.in
${PROJECT_BINARY_DIR}/userconfig.cmake
IMMEDIATE @ONLY)
add_custom_target(userconfig COMMAND ${CMAKE_COMMAND}
-P ${PROJECT_BINARY_DIR}/userconfig.cmake)
# }}}
2016-11-03 08:06:33 -04:00
# Target: uninstall {{{
configure_file(
${PROJECT_SOURCE_DIR}/cmake/templates/uninstall.cmake.in
${PROJECT_BINARY_DIR}/uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND}
-P ${PROJECT_BINARY_DIR}/cuninstall.cmake)
# }}}
# Target: clang-format {{{
find_program(CLANG_FORMAT "clang-format")
if(CLANG_FORMAT)
file(GLOB_RECURSE HEADERS ${PROJECT_SOURCE_DIR}/include/*.hpp)
file(GLOB_RECURSE SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)
add_custom_target(clang-format COMMAND ${CLANG_FORMAT}
-i -style=file ${HEADERS} ${SOURCES})
endif()
find_program(CLANG_TIDY "clang-tidy")
# }}}
# Target: clang-tidy {{{
if(CLANG_TIDY)
add_custom_target(clang-tidy
COMMAND ${CLANG_TIDY} -p
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/src/main.cpp)
endif()
# }}}