polybar-dwm/cmake/build/targets.cmake
2016-11-19 06:26:07 +01:00

51 lines
1.1 KiB
CMake

#
# 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)
# }}}
# Target: uninstall {{{
configure_file(
${PROJECT_SOURCE_DIR}/cmake/templates/uninstall.cmake.in
${PROJECT_BINARY_DIR}/cmake/uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND}
-P ${PROJECT_BINARY_DIR}/cmake/uninstall.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()
# }}}