1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04: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
2016-11-19 00:22:44 -05:00
${PROJECT_BINARY_DIR}/cmake/uninstall.cmake
2016-11-03 08:06:33 -04:00
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND}
2016-11-19 00:22:44 -05:00
-P ${PROJECT_BINARY_DIR}/cmake/uninstall.cmake)
2016-11-03 08:06:33 -04:00
# }}}
# 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()
# }}}