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.

107 lines
3.2 KiB

  1. # This program source code file is part of KiCad, a free EDA CAD application.
  2. #
  3. # Copyright (C) 2018 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_lib_table.cpp
  34. test_markup_parser.cpp
  35. test_kicad_string.cpp
  36. test_kicad_stroke_font.cpp
  37. test_kiid.cpp
  38. test_property.cpp
  39. test_refdes_utils.cpp
  40. test_title_block.cpp
  41. test_types.cpp
  42. test_utf8.cpp
  43. test_wildcards_and_files_ext.cpp
  44. test_wx_filename.cpp
  45. libeval/test_numeric_evaluator.cpp
  46. plugins/altium/test_altium_parser.cpp
  47. plugins/altium/test_altium_parser_utils.cpp
  48. plugins/cadstar/test_cadstar_parts_parser.cpp
  49. plugins/cadstar/test_cadstar_archive_parser.cpp
  50. view/test_zoom_controller.cpp
  51. )
  52. if( KICAD_TEST_DATABASE_LIBRARIES )
  53. set( QA_COMMON_SRCS ${QA_COMMON_SRCS} test_database.cpp )
  54. endif()
  55. if( WIN32 )
  56. # We want to declare a resource manifest on Windows to enable UTF8 mode
  57. # Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
  58. if( MINGW )
  59. # QA_COMMON_RESOURCES variable is set by the macro.
  60. mingw_resource_compiler( qa_common )
  61. else()
  62. set( QA_COMMON_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_common.rc )
  63. endif()
  64. endif()
  65. # Test executable for non-program-specific code
  66. add_executable( qa_common
  67. ${QA_COMMON_SRCS}
  68. ${QA_COMMON_RESOURCES} )
  69. target_link_libraries( qa_common
  70. common
  71. libcontext
  72. gal
  73. qa_utils
  74. Boost::headers
  75. Boost::unit_test_framework
  76. ${wxWidgets_LIBRARIES}
  77. )
  78. include_directories(
  79. ${CMAKE_SOURCE_DIR}
  80. ${CMAKE_SOURCE_DIR}/pcbnew
  81. ${CMAKE_SOURCE_DIR}/include
  82. ${CMAKE_SOURCE_DIR}/qa/mocks/include
  83. ${INC_AFTER}
  84. )
  85. if( KICAD_TEST_DATABASE_LIBRARIES )
  86. set_source_files_properties( test_database.cpp PROPERTIES
  87. COMPILE_DEFINITIONS "QA_DATABASE_FILE_LOCATION=(\"${CMAKE_SOURCE_DIR}/qa/data/dblib\")"
  88. )
  89. endif()
  90. kicad_add_boost_test( qa_common qa_common )