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.

110 lines
3.3 KiB

  1. # This program source code file is part of KiCad, a free EDA CAD application.
  2. #
  3. # Copyright (C) 2018, 2023 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. find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc REQUIRED )
  22. set( QA_COMMON_SRCS
  23. # This is needed for the global mock objects
  24. ${CMAKE_SOURCE_DIR}/qa/mocks/kicad/common_mocks.cpp
  25. # The main test entry points
  26. test_module.cpp
  27. wximage_test_utils.cpp
  28. test_array_axis.cpp
  29. test_bitmap_base.cpp
  30. test_color4d.cpp
  31. test_coroutine.cpp
  32. test_eda_shape.cpp
  33. test_eda_text.cpp
  34. test_lib_table.cpp
  35. test_markup_parser.cpp
  36. test_kicad_string.cpp
  37. test_kicad_stroke_font.cpp
  38. test_kiid.cpp
  39. test_property.cpp
  40. test_refdes_utils.cpp
  41. test_text_attributes.cpp
  42. test_title_block.cpp
  43. test_types.cpp
  44. test_utf8.cpp
  45. test_wildcards_and_files_ext.cpp
  46. test_wx_filename.cpp
  47. libeval/test_numeric_evaluator.cpp
  48. plugins/altium/test_altium_parser.cpp
  49. plugins/altium/test_altium_parser_utils.cpp
  50. plugins/cadstar/test_cadstar_parts_parser.cpp
  51. plugins/cadstar/test_cadstar_archive_parser.cpp
  52. view/test_zoom_controller.cpp
  53. )
  54. if( KICAD_TEST_DATABASE_LIBRARIES )
  55. set( QA_COMMON_SRCS ${QA_COMMON_SRCS} test_database.cpp )
  56. endif()
  57. if( WIN32 )
  58. # We want to declare a resource manifest on Windows to enable UTF8 mode
  59. # Without UTF8 mode, some random IO tests may fail, we set the active code page on
  60. # normal kicad to UTF8 as well
  61. if( MINGW )
  62. # QA_COMMON_RESOURCES variable is set by the macro.
  63. mingw_resource_compiler( qa_common )
  64. else()
  65. set( QA_COMMON_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_common.rc )
  66. endif()
  67. endif()
  68. # Test executable for non-program-specific code
  69. add_executable( qa_common
  70. ${QA_COMMON_SRCS}
  71. ${QA_COMMON_RESOURCES} )
  72. target_link_libraries( qa_common
  73. common
  74. libcontext
  75. gal
  76. qa_utils
  77. Boost::headers
  78. Boost::unit_test_framework
  79. ${wxWidgets_LIBRARIES}
  80. )
  81. include_directories(
  82. ${CMAKE_SOURCE_DIR}
  83. ${CMAKE_SOURCE_DIR}/pcbnew
  84. ${CMAKE_SOURCE_DIR}/include
  85. ${CMAKE_SOURCE_DIR}/qa/mocks/include
  86. ${INC_AFTER}
  87. )
  88. if( KICAD_TEST_DATABASE_LIBRARIES )
  89. set_source_files_properties( test_database.cpp PROPERTIES
  90. COMPILE_DEFINITIONS "QA_DATABASE_FILE_LOCATION=(\"${CMAKE_SOURCE_DIR}/qa/data/dblib\")"
  91. )
  92. endif()
  93. kicad_add_boost_test( qa_common qa_common )