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.

119 lines
3.5 KiB

4 years ago
  1. # This program source code file is part of KiCad, a free EDA CAD application.
  2. #
  3. # Copyright (C) 2018-2022 KiCad Developers, see CHANGELOG.TXT for contributors.
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License
  7. # as published by the Free Software Foundation; either version 2
  8. # of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, you may find one here:
  17. # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  18. # or you may search the http://www.gnu.org website for the version 2 license,
  19. # or you may write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  21. set( QA_PCBNEW_SRCS
  22. # The main test entry points
  23. test_module.cpp
  24. # Shared between programs, but dependent on the BIU
  25. ${CMAKE_SOURCE_DIR}/qa/common/test_format_units.cpp
  26. ${CMAKE_SOURCE_DIR}/qa/common/test_array_options.cpp
  27. # testing utility routines
  28. board_test_utils.cpp
  29. drc/drc_test_utils.cpp
  30. # test compilation units (start test_)
  31. test_array_pad_name_provider.cpp
  32. test_board_item.cpp
  33. test_graphics_import_mgr.cpp
  34. test_lset.cpp
  35. test_pad_numbering.cpp
  36. test_libeval_compiler.cpp
  37. test_save_load.cpp
  38. test_tracks_cleaner.cpp
  39. test_zone_filler.cpp
  40. drc/test_custom_rule_severities.cpp
  41. drc/test_drc_courtyard_invalid.cpp
  42. drc/test_drc_courtyard_overlap.cpp
  43. drc/test_drc_regressions.cpp
  44. drc/test_solder_mask_bridging.cpp
  45. plugins/altium/test_altium_rule_transformer.cpp
  46. group_saveload.cpp
  47. )
  48. add_executable( qa_pcbnew
  49. ${QA_PCBNEW_SRCS}
  50. )
  51. # Pcbnew tests, so pretend to be pcbnew (for units, etc)
  52. target_compile_definitions( qa_pcbnew
  53. PRIVATE PCBNEW
  54. )
  55. # Anytime we link to the kiface_objects, we have to add a dependency on the last object
  56. # to ensure that the generated lexer files are finished being used before the qa runs in a
  57. # multi-threaded build
  58. add_dependencies( qa_pcbnew pcbnew )
  59. include_directories( BEFORE ${INC_BEFORE} )
  60. include_directories(
  61. ${CMAKE_SOURCE_DIR}
  62. ${CMAKE_SOURCE_DIR}/include
  63. ${CMAKE_SOURCE_DIR}/3d-viewer
  64. ${CMAKE_SOURCE_DIR}/common
  65. ${CMAKE_SOURCE_DIR}/pcbnew
  66. ${CMAKE_SOURCE_DIR}/pcbnew/router
  67. ${CMAKE_SOURCE_DIR}/pcbnew/tools
  68. ${CMAKE_SOURCE_DIR}/pcbnew/dialogs
  69. ${CMAKE_SOURCE_DIR}/polygon
  70. ${CMAKE_SOURCE_DIR}/common/geometry
  71. ${CMAKE_SOURCE_DIR}/qa/qa_utils
  72. ${Boost_INCLUDE_DIR}
  73. ${INC_AFTER}
  74. )
  75. target_link_libraries( qa_pcbnew
  76. qa_pcbnew_utils
  77. pcbnew_kiface_objects
  78. 3d-viewer
  79. connectivity
  80. pcbcommon
  81. pnsrouter
  82. gal
  83. common
  84. gal
  85. scripting
  86. qa_utils
  87. dxflib_qcad
  88. tinyspline_lib
  89. nanosvg
  90. idf3
  91. markdown_lib
  92. ${PCBNEW_IO_LIBRARIES}
  93. ${wxWidgets_LIBRARIES}
  94. ${GDI_PLUS_LIBRARIES}
  95. ${PYTHON_LIBRARIES}
  96. ${Boost_LIBRARIES}
  97. ${PCBNEW_EXTRA_LIBS} # -lrt must follow Boost
  98. )
  99. if( WIN32 )
  100. # Copy dynamic lib dependency to build dir to allow running directly
  101. add_custom_command( TARGET qa_pcbnew POST_BUILD
  102. COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:kicad_3dsg>" "$<TARGET_FILE_DIR:qa_pcbnew>"
  103. )
  104. endif()
  105. kicad_add_boost_test( qa_pcbnew qa_pcbnew )