C++ binding for the SQLite library https://code.ireas.org/sqlitepp/
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.

StyleCheck.cmake 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright (C) 2013 Daniel Scharrer
  2. #
  3. # This software is provided 'as-is', without any express or implied
  4. # warranty. In no event will the author(s) be held liable for any damages
  5. # arising from the use of this software.
  6. #
  7. # Permission is granted to anyone to use this software for any purpose,
  8. # including commercial applications, and to alter it and redistribute it
  9. # freely, subject to the following restrictions:
  10. #
  11. # 1. The origin of this software must not be misrepresented; you must not
  12. # claim that you wrote the original software. If you use this software
  13. # in a product, an acknowledgment in the product documentation would be
  14. # appreciated but is not required.
  15. # 2. Altered source versions must be plainly marked as such, and must not be
  16. # misrepresented as being the original software.
  17. # 3. This notice may not be removed or altered from any source distribution.
  18. #
  19. #
  20. # Modified 2015 by Robin Krahl -- removed "--filter" and "--project", added
  21. # "--root"
  22. # Original source: https://github.com/dscharrer/innoextract/blob/master/cmake/StyleCheck.cmake
  23. find_package(PythonInterp)
  24. # Add a target that runs cpplint.py
  25. #
  26. # Parameters:
  27. # - TARGET_NAME the name of the target to add
  28. # - SOURCES_LIST a complete list of source and include files to check
  29. function(add_style_check_target TARGET_NAME SOURCES_LIST)
  30. if(NOT PYTHONINTERP_FOUND)
  31. return()
  32. endif()
  33. list(SORT SOURCES_LIST)
  34. list(REMOVE_DUPLICATES SOURCES_LIST)
  35. add_custom_target(${TARGET_NAME}
  36. COMMAND "${CMAKE_COMMAND}" -E chdir
  37. "${CMAKE_SOURCE_DIR}"
  38. "${PYTHON_EXECUTABLE}"
  39. "${CMAKE_MODULE_PATH}/cpplint.py"
  40. "--root=include"
  41. ${SOURCES_LIST}
  42. DEPENDS ${SOURCES_LIST}
  43. COMMENT "Checking code style."
  44. VERBATIM
  45. )
  46. endfunction(add_style_check_target)