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.

865 lines
30 KiB

5 years ago
18 years ago
18 years ago
8 years ago
8 years ago
8 years ago
8 years ago
18 years ago
8 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
  1. add_compile_definitions( PCBNEW )
  2. add_subdirectory(connectivity)
  3. add_subdirectory(router)
  4. # psnrouter depends on make_lexer outputs in common (bug #1285878 )
  5. add_dependencies( pnsrouter pcbcommon )
  6. file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swig )
  7. # Infrequently needed headers go at end of search paths, append to INC_AFTER
  8. set( INC_AFTER ${INC_AFTER} python/scripting )
  9. set( INC_AFTER ${INC_AFTER} ${CMAKE_SOURCE_DIR}/common/swig )
  10. include_directories( BEFORE ${INC_BEFORE} )
  11. include_directories(
  12. ./dialogs
  13. ./autorouter
  14. ${CMAKE_SOURCE_DIR}/3d-viewer
  15. ${CMAKE_SOURCE_DIR}/3d-viewer/dialogs
  16. ${CMAKE_SOURCE_DIR}/common
  17. ${CMAKE_SOURCE_DIR}/common/dialogs
  18. ./exporters
  19. ./importers
  20. ${CMAKE_SOURCE_DIR}/utils/idftools
  21. ./specctra_import_export
  22. ${INC_AFTER}
  23. )
  24. set( PCBNEW_DIALOGS
  25. dialogs/dialog_filter_selection.cpp
  26. dialogs/dialog_filter_selection_base.cpp
  27. dialogs/dialog_board_setup.cpp
  28. dialogs/dialog_board_statistics.cpp
  29. dialogs/dialog_board_statistics_base.cpp
  30. dialogs/dialog_board_reannotate.cpp
  31. dialogs/dialog_board_reannotate_base.cpp
  32. dialogs/dialog_choose_footprint.cpp
  33. dialogs/dialog_cleanup_graphics.cpp
  34. dialogs/dialog_cleanup_graphics_base.cpp
  35. dialogs/dialog_cleanup_tracks_and_vias.cpp
  36. dialogs/dialog_cleanup_tracks_and_vias_base.cpp
  37. dialogs/dialog_copper_zones.cpp
  38. dialogs/dialog_copper_zones_base.cpp
  39. dialogs/dialog_create_array.cpp
  40. dialogs/dialog_create_array_base.cpp
  41. dialogs/dialog_dimension_properties.cpp
  42. dialogs/dialog_dimension_properties_base.cpp
  43. dialogs/dialog_drc.cpp
  44. dialogs/dialog_drc_base.cpp
  45. dialogs/dialog_footprint_checker.cpp
  46. dialogs/dialog_footprint_checker_base.cpp
  47. dialogs/dialog_footprint_properties.cpp
  48. dialogs/dialog_footprint_properties_base.cpp
  49. dialogs/dialog_footprint_properties_fp_editor.cpp
  50. dialogs/dialog_footprint_properties_fp_editor_base.cpp
  51. dialogs/dialog_enum_pads.cpp
  52. dialogs/dialog_enum_pads_base.cpp
  53. dialogs/dialog_exchange_footprints.cpp
  54. dialogs/dialog_exchange_footprints_base.cpp
  55. dialogs/dialog_export_idf.cpp
  56. dialogs/dialog_export_idf_base.cpp
  57. dialogs/dialog_export_step.cpp
  58. dialogs/dialog_export_step_base.cpp
  59. dialogs/dialog_export_step_process.cpp
  60. dialogs/dialog_export_step_process_base.cpp
  61. dialogs/dialog_export_svg.cpp
  62. dialogs/dialog_export_svg_base.cpp
  63. dialogs/dialog_export_vrml.cpp
  64. dialogs/dialog_export_vrml_base.cpp
  65. dialogs/dialog_find.cpp
  66. dialogs/dialog_find_base.cpp
  67. dialogs/dialog_footprint_wizard_list.cpp
  68. dialogs/dialog_footprint_wizard_list_base.cpp
  69. dialogs/dialog_fp_plugin_options.cpp
  70. dialogs/dialog_fp_plugin_options_base.cpp
  71. dialogs/dialog_gen_footprint_position.cpp
  72. dialogs/dialog_gen_footprint_position_file_base.cpp
  73. dialogs/dialog_gencad_export_options.cpp
  74. dialogs/dialog_gendrill.cpp
  75. dialogs/dialog_gendrill_base.cpp
  76. dialogs/dialog_get_footprint_by_name_base.cpp
  77. dialogs/dialog_global_deletion.cpp
  78. dialogs/dialog_global_deletion_base.cpp
  79. dialogs/dialog_global_edit_tracks_and_vias.cpp
  80. dialogs/dialog_global_edit_tracks_and_vias_base.cpp
  81. dialogs/dialog_global_edit_teardrops.cpp
  82. dialogs/dialog_global_edit_teardrops_base.cpp
  83. dialogs/dialog_global_edit_text_and_graphics.cpp
  84. dialogs/dialog_global_edit_text_and_graphics_base.cpp
  85. dialogs/dialog_global_fp_lib_table_config.cpp
  86. dialogs/dialog_group_properties.cpp
  87. dialogs/dialog_group_properties_base.cpp
  88. dialogs/dialog_push_pad_properties.cpp
  89. dialogs/dialog_push_pad_properties_base.cpp
  90. dialogs/dialog_graphic_item_properties.cpp
  91. dialogs/dialog_graphic_item_properties_base.cpp
  92. dialogs/dialog_image_properties.cpp
  93. dialogs/dialog_image_properties_base.cpp
  94. dialogs/dialog_import_settings.cpp
  95. dialogs/dialog_import_settings_base.cpp
  96. dialogs/dialog_imported_layers_base.cpp
  97. dialogs/dialog_imported_layers.cpp
  98. dialogs/dialog_rule_area_properties.cpp
  99. dialogs/dialog_rule_area_properties_base.cpp
  100. dialogs/dialog_layer_selection_base.cpp
  101. dialogs/dialog_move_exact.cpp
  102. dialogs/dialog_move_exact_base.cpp
  103. dialogs/dialog_net_inspector.cpp
  104. dialogs/dialog_net_inspector_base.cpp
  105. dialogs/dialog_import_netlist.cpp
  106. dialogs/dialog_import_netlist_base.cpp
  107. dialogs/dialog_non_copper_zones_properties.cpp
  108. dialogs/dialog_non_copper_zones_properties_base.cpp
  109. dialogs/dialog_pad_basicshapes_properties.cpp
  110. dialogs/dialog_pad_properties.cpp
  111. dialogs/dialog_pad_properties_base.cpp
  112. dialogs/dialog_pad_primitives_properties_base.cpp
  113. dialogs/dialog_plot.cpp
  114. dialogs/dialog_plot_base.cpp
  115. dialogs/dialog_pns_diff_pair_dimensions.cpp
  116. dialogs/dialog_pns_diff_pair_dimensions_base.cpp
  117. dialogs/dialog_pns_length_tuning_settings.cpp
  118. dialogs/dialog_pns_length_tuning_settings_base.cpp
  119. dialogs/dialog_pns_settings.cpp
  120. dialogs/dialog_pns_settings_base.cpp
  121. dialogs/dialog_position_relative.cpp
  122. dialogs/dialog_position_relative_base.cpp
  123. dialogs/dialog_print_pcbnew.cpp
  124. dialogs/dialog_swap_layers.cpp
  125. dialogs/dialog_swap_layers_base.cpp
  126. dialogs/dialog_target_properties.cpp
  127. dialogs/dialog_target_properties_base.cpp
  128. dialogs/dialog_text_properties.cpp
  129. dialogs/dialog_text_properties_base.cpp
  130. dialogs/dialog_textbox_properties.cpp
  131. dialogs/dialog_textbox_properties_base.cpp
  132. dialogs/dialog_track_via_properties.cpp
  133. dialogs/dialog_track_via_properties_base.cpp
  134. dialogs/dialog_track_via_size.cpp
  135. dialogs/dialog_track_via_size_base.cpp
  136. dialogs/dialog_unused_pad_layers.cpp
  137. dialogs/dialog_unused_pad_layers_base.cpp
  138. dialogs/dialog_update_pcb.cpp
  139. dialogs/dialog_update_pcb_base.cpp
  140. dialogs/panel_display_options.cpp
  141. dialogs/panel_display_options_base.cpp
  142. dialogs/panel_edit_options.cpp
  143. dialogs/panel_edit_options_base.cpp
  144. dialogs/panel_fp_lib_table.cpp
  145. dialogs/panel_fp_lib_table_base.cpp
  146. dialogs/panel_fp_editor_color_settings.cpp
  147. dialogs/panel_fp_editor_defaults.cpp
  148. dialogs/panel_fp_editor_defaults_base.cpp
  149. dialogs/panel_fp_properties_3d_model.cpp
  150. dialogs/panel_fp_properties_3d_model_base.cpp
  151. dialogs/panel_pcbnew_action_plugins.cpp
  152. dialogs/panel_pcbnew_action_plugins_base.cpp
  153. dialogs/panel_pcbnew_color_settings.cpp
  154. dialogs/panel_pcbnew_display_origin.cpp
  155. dialogs/panel_pcbnew_display_origin_base.cpp
  156. dialogs/panel_setup_constraints.cpp
  157. dialogs/panel_setup_constraints_base.cpp
  158. dialogs/panel_setup_formatting.cpp
  159. dialogs/panel_setup_formatting_base.cpp
  160. dialogs/panel_setup_mask_and_paste.cpp
  161. dialogs/panel_setup_mask_and_paste_base.cpp
  162. dialogs/panel_setup_layers.cpp
  163. dialogs/panel_setup_layers_base.cpp
  164. dialogs/panel_setup_rules.cpp
  165. dialogs/panel_setup_rules_base.cpp
  166. dialogs/panel_setup_teardrops.cpp
  167. dialogs/panel_setup_teardrops_base.cpp
  168. dialogs/panel_setup_text_and_graphics.cpp
  169. dialogs/panel_setup_text_and_graphics_base.cpp
  170. dialogs/panel_setup_tracks_and_vias.cpp
  171. dialogs/panel_setup_tracks_and_vias_base.cpp
  172. footprint_wizard.cpp
  173. footprint_wizard_frame.cpp
  174. footprint_wizard_frame_functions.cpp
  175. )
  176. set( PCBNEW_BRDSTACKUP_MGR
  177. board_stackup_manager/dielectric_material.cpp
  178. board_stackup_manager/stackup_predefined_prms.cpp
  179. board_stackup_manager/panel_board_finish.cpp
  180. board_stackup_manager/panel_board_finish_base.cpp
  181. board_stackup_manager/panel_board_stackup.cpp
  182. board_stackup_manager/panel_board_stackup_base.cpp
  183. board_stackup_manager/board_stackup_reporter.cpp
  184. board_stackup_manager/dialog_dielectric_list_manager_base.cpp
  185. board_stackup_manager/dialog_dielectric_list_manager.cpp
  186. )
  187. set( PCBNEW_IMPORT_GFX
  188. import_gfx/dialog_import_gfx_base.cpp
  189. import_gfx/dialog_import_gfx.cpp
  190. import_gfx/graphics_import_mgr.cpp
  191. import_gfx/graphics_importer.cpp
  192. import_gfx/graphics_importer_pcbnew.cpp
  193. import_gfx/graphics_importer_buffer.cpp
  194. import_gfx/dxf_import_plugin.cpp
  195. import_gfx/svg_import_plugin.cpp
  196. )
  197. set( PCBNEW_EXPORTERS
  198. exporters/export_hyperlynx.cpp
  199. exporters/export_d356.cpp
  200. exporters/export_footprint_associations.cpp
  201. exporters/export_gencad.cpp
  202. exporters/export_idf.cpp
  203. exporters/step/exporter_step.cpp
  204. exporters/step/step_pcb_model.cpp
  205. exporters/exporter_vrml.cpp
  206. exporters/place_file_exporter.cpp
  207. exporters/gen_drill_report_files.cpp
  208. exporters/gendrill_Excellon_writer.cpp
  209. exporters/gendrill_file_writer_base.cpp
  210. exporters/gendrill_gerber_writer.cpp
  211. exporters/gerber_jobfile_writer.cpp
  212. exporters/gerber_placefile_writer.cpp
  213. )
  214. set( PCBNEW_MICROWAVE_SRCS
  215. microwave/microwave_footprint.cpp
  216. microwave/microwave_inductor.cpp
  217. microwave/microwave_polygon.cpp
  218. microwave/microwave_tool.cpp
  219. )
  220. set( PCBNEW_DRC_SRCS
  221. drc/drc_interactive_courtyard_clearance.cpp
  222. drc/drc_test_provider.cpp
  223. drc/drc_test_provider_annular_width.cpp
  224. drc/drc_test_provider_disallow.cpp
  225. drc/drc_test_provider_connectivity.cpp
  226. drc/drc_test_provider_connection_width.cpp
  227. drc/drc_test_provider_copper_clearance.cpp
  228. drc/drc_test_provider_physical_clearance.cpp
  229. drc/drc_test_provider_courtyard_clearance.cpp
  230. drc/drc_test_provider_edge_clearance.cpp
  231. drc/drc_test_provider_footprint_checks.cpp
  232. drc/drc_test_provider_hole_to_hole.cpp
  233. drc/drc_test_provider_hole_size.cpp
  234. drc/drc_test_provider_library_parity.cpp
  235. drc/drc_test_provider_schematic_parity.cpp
  236. drc/drc_test_provider_misc.cpp
  237. drc/drc_test_provider_text_dims.cpp
  238. drc/drc_test_provider_track_width.cpp
  239. drc/drc_test_provider_zone_connections.cpp
  240. drc/drc_test_provider_via_diameter.cpp
  241. drc/drc_test_provider_solder_mask.cpp
  242. drc/drc_test_provider_silk_clearance.cpp
  243. drc/drc_test_provider_matched_length.cpp
  244. drc/drc_test_provider_diff_pair_coupling.cpp
  245. drc/drc_test_provider_sliver_checker.cpp
  246. )
  247. set( PCBNEW_NETLIST_SRCS
  248. netlist_reader/board_netlist_updater.cpp
  249. netlist_reader/netlist.cpp
  250. )
  251. set( PCBNEW_CLASS_SRCS
  252. ${PCBNEW_DIALOGS}
  253. ${PCBNEW_EXPORTERS}
  254. ${PCBNEW_DRC_SRCS}
  255. ${PCBNEW_IMPORT_GFX}
  256. ${PCBNEW_NETLIST_SRCS}
  257. ${PCBNEW_BRDSTACKUP_MGR}
  258. autorouter/spread_footprints.cpp
  259. autorouter/ar_autoplacer.cpp
  260. autorouter/ar_matrix.cpp
  261. autorouter/autoplace_tool.cpp
  262. action_plugin.cpp
  263. array_creator.cpp
  264. array_pad_number_provider.cpp
  265. build_BOM_from_board.cpp
  266. cleanup_item.cpp
  267. convert_shape_list_to_polygon.cpp
  268. cross-probing.cpp
  269. edit.cpp
  270. edit_track_width.cpp
  271. files.cpp
  272. footprint_info_impl.cpp
  273. footprint_wizard.cpp
  274. footprint_editor_utils.cpp
  275. footprint_editor_settings.cpp
  276. fp_tree_synchronizing_adapter.cpp
  277. footprint_edit_frame.cpp
  278. footprint_libraries_utils.cpp
  279. footprint_viewer_frame.cpp
  280. fp_tree_model_adapter.cpp
  281. generate_footprint_info.cpp
  282. graphics_cleaner.cpp
  283. grid_layer_box_helpers.cpp
  284. grid_layer_box_helpers.h
  285. initpcb.cpp
  286. load_select_footprint.cpp
  287. menubar_footprint_editor.cpp
  288. menubar_pcb_editor.cpp
  289. pcb_base_edit_frame.cpp
  290. pcb_layer_box_selector.cpp
  291. pcb_edit_frame.cpp
  292. pcbnew_config.cpp
  293. pcbnew_jobs_handler.cpp
  294. pcbnew_printout.cpp
  295. pcbnew_settings.cpp
  296. pcbplot.cpp
  297. plot_board_layers.cpp
  298. plot_brditems_plotter.cpp
  299. specctra_import_export/specctra.cpp
  300. specctra_import_export/specctra_export.cpp
  301. specctra_import_export/specctra_import.cpp
  302. fp_text_grid_table.cpp
  303. toolbars_footprint_editor.cpp
  304. toolbars_footprint_viewer.cpp
  305. toolbars_pcb_editor.cpp
  306. tracks_cleaner.cpp
  307. undo_redo.cpp
  308. zone_filler.cpp
  309. zones_functions_for_undo_redo.cpp
  310. edit_zone_helpers.cpp
  311. ratsnest/ratsnest.cpp
  312. tools/board_editor_control.cpp
  313. tools/board_inspection_tool.cpp
  314. tools/board_reannotate_tool.cpp
  315. tools/convert_tool.cpp
  316. tools/drawing_tool.cpp
  317. tools/drawing_stackup_table_tool.cpp
  318. tools/drc_tool.cpp
  319. tools/edit_tool.cpp
  320. tools/edit_tool_move_fct.cpp
  321. tools/global_edit_tool.cpp
  322. tools/group_tool.cpp
  323. tools/footprint_editor_control.cpp
  324. tools/pad_tool.cpp
  325. tools/pcb_control.cpp
  326. tools/pcb_picker_tool.cpp
  327. tools/pcb_selection.cpp
  328. tools/pcb_selection_conditions.cpp
  329. tools/pcb_selection_tool.cpp
  330. tools/pcb_tool_base.cpp
  331. tools/placement_tool.cpp
  332. tools/pcb_point_editor.cpp
  333. tools/position_relative_tool.cpp
  334. tools/properties_tool.cpp
  335. tools/tool_event_utils.cpp
  336. tools/zone_create_helper.cpp
  337. tools/zone_filler_tool.cpp
  338. footprint_preview_panel.cpp
  339. footprint_tree_pane.cpp
  340. widgets/appearance_controls.cpp
  341. widgets/appearance_controls_base.cpp
  342. widgets/panel_selection_filter.cpp
  343. widgets/panel_selection_filter_base.cpp
  344. widgets/pcb_properties_panel.cpp
  345. widgets/pcb_search_pane.cpp
  346. widgets/search_handlers.cpp
  347. )
  348. set( PCBNEW_SRCS
  349. ${PCBNEW_MICROWAVE_SRCS}
  350. ${PCBNEW_CLASS_SRCS}
  351. ${PCBNEW_DIALOGS}
  352. )
  353. # extra sources from common
  354. set( PCBNEW_COMMON_SRCS
  355. )
  356. set( PCBNEW_SCRIPTING_PYTHON_HELPERS
  357. ${CMAKE_SOURCE_DIR}/common/swig/wx_python_helpers.cpp
  358. python/scripting/pcbnew_action_plugins.cpp
  359. python/scripting/pcbnew_footprint_wizards.cpp
  360. python/scripting/pcbnew_scripting_helpers.cpp
  361. python/scripting/pcbnew_scripting.cpp
  362. python/scripting/pcb_scripting_tool.cpp
  363. )
  364. if( COMPILER_SUPPORTS_WARNINGS )
  365. # Only compile our source files with the warnings, since the SWIG generated
  366. # files contain a lot of warnings, we just ignore it.
  367. set_source_files_properties(
  368. ${PCBNEW_SRCS} ${PCBNEW_COMMON_SRCS} ${PCBNEW_SCRIPTING_PYTHON_HELPERS}
  369. PROPERTIES COMPILE_FLAGS ${WARN_FLAGS_CXX}
  370. )
  371. endif()
  372. # Disable all warnings for the SWIG file
  373. if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
  374. if( MSYS )
  375. # For some reason the .cxx file generated by SWIG cannot be linked if compiled with debug options:
  376. # it creates a *lot* of not found symbols. So compile it with release mode
  377. set_source_files_properties( pcbnew_wrap.cxx PROPERTIES COMPILE_FLAGS "-O2 -w" )
  378. else()
  379. set_source_files_properties( pcbnew_wrap.cxx PROPERTIES COMPILE_FLAGS "-w" )
  380. endif()
  381. endif()
  382. set( PCBNEW_SCRIPTING_SRCS
  383. pcbnew_wrap.cxx
  384. ${PCBNEW_SCRIPTING_PYTHON_HELPERS}
  385. )
  386. set( SWIG_FLAGS
  387. -I${CMAKE_CURRENT_SOURCE_DIR}
  388. -I${CMAKE_SOURCE_DIR}/include
  389. -I${CMAKE_SOURCE_DIR}/scripting
  390. -I${CMAKE_SOURCE_DIR}/pcbnew/python/scripting
  391. -I${CMAKE_SOURCE_DIR}/common/swig
  392. -I${CMAKE_SOURCE_DIR}/libs/kimath/include
  393. -I${CMAKE_BINARY_DIR}
  394. )
  395. if( DEBUG )
  396. set( SWIG_FLAGS ${SWIG_FLAGS} -DDEBUG )
  397. endif()
  398. # collect CFLAGS , and pass them to swig later
  399. get_directory_property( DirDefs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS )
  400. foreach( d ${DirDefs} )
  401. set( SWIG_FLAGS ${SWIG_FLAGS} -D${d} )
  402. endforeach()
  403. # We deliberately do not use the CMake support for swig here,
  404. # i.e. swig_add_footprint()) because we want full control.
  405. # Avoid threading in SWIG (breaks threads in pcbnew)
  406. set( SWIG_OPTS -python -c++ -nothreads -fastdispatch -fvirtual )
  407. set( SWIG_OPTS ${SWIG_OPTS} -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
  408. if( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/doxygen-xml )
  409. set( SWIG_OPTS ${SWIG_OPTS} -DENABLE_DOCSTRINGS_FROM_DOXYGEN )
  410. set( SWIG_OPTS ${SWIG_OPTS} -I${CMAKE_CURRENT_BINARY_DIR}/docstrings )
  411. endif()
  412. add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx
  413. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py
  414. DEPENDS python/swig/pcbnew.i
  415. DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.d
  416. COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/docstrings
  417. # Make docstrings.i available if it doesn't exist
  418. COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/docstrings/docstrings.i
  419. COMMAND ${SWIG_EXECUTABLE}
  420. ${SWIG_OPTS} -MMD -MF ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.d -MT pcbnew/pcbnew_wrap.cxx -o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx ${CMAKE_SOURCE_DIR}/pcbnew/python/swig/pcbnew.i
  421. # was needed only with SWIG version < 4 to disable a python section "def swig_import_helper()"
  422. # found in pcbnew.py but not existing in SWIG version >= 4
  423. # So it is left here for documentation purpose
  424. #COMMAND ${PYTHON_EXECUTABLE}
  425. # ${CMAKE_SOURCE_DIR}/tools/build/fix_swig_imports.py ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py
  426. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  427. )
  428. if( UNIX AND NOT APPLE )
  429. list( APPEND PCBNEW_EXTRA_LIBS rt )
  430. endif()
  431. ###
  432. # Doxygen python documentation
  433. ###
  434. if( DOXYGEN_FOUND )
  435. # create XML files from doxygen parsing
  436. add_custom_target( doxygen-python-xml
  437. ${CMAKE_COMMAND} -E remove_directory doxygen-python-xml
  438. COMMAND SOURCES_DIR=${CMAKE_SOURCE_DIR} ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_xml
  439. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  440. DEPENDS Doxyfile_xml
  441. COMMENT "building doxygen docs into directory doxygen-python/html"
  442. )
  443. add_dependencies( doxygen-python-xml version_header )
  444. # create .i files from XML doxygen parsing, docstrings.i will include all of them
  445. add_custom_target( xml-to-docstrings
  446. COMMAND ${CMAKE_COMMAND} -E remove_directory docstrings
  447. COMMAND ${CMAKE_COMMAND} -E make_directory docstrings
  448. COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/build/extract_docstrings.py pcbnew.py doxygen-xml/xml docstrings
  449. COMMAND ${CMAKE_COMMAND} -E remove pcbnew.py # force removal so it will be recreated later with the new docstrings
  450. COMMENT "building docstring files"
  451. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  452. DEPENDS pcbnew.py
  453. )
  454. add_dependencies( xml-to-docstrings doxygen-python-xml )
  455. # The sources to give to the Python Doxygen target
  456. set( DOXYGEN_PYTHON_SOURCES
  457. ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py
  458. ${CMAKE_CURRENT_SOURCE_DIR}/python/plugins/FootprintWizardBase.py
  459. ${CMAKE_CURRENT_SOURCE_DIR}/python/plugins/PadArray.py )
  460. # The Doxyfile expects a space-separated list in the env var
  461. string(REPLACE ";" " " DOXYGEN_PYTHON_SOURCES_STR "${DOXYGEN_PYTHON_SOURCES}")
  462. # Create doxygen-python html
  463. add_custom_target( doxygen-python
  464. ${CMAKE_COMMAND} -E remove_directory doxygen-python
  465. COMMAND ${CMAKE_COMMAND} -E env
  466. PYTHON_SOURCES_TO_DOC=${DOXYGEN_PYTHON_SOURCES_STR}
  467. CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
  468. ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_python
  469. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  470. DEPENDS Doxyfile_python
  471. DEPENDS ${DOXYGEN_PYTHON_SOURCES}
  472. COMMENT "building doxygen docs into directory doxygen-python/html"
  473. )
  474. add_dependencies( doxygen-python version_header xml-to-docstrings )
  475. endif()
  476. if( WIN32 )
  477. if( MINGW )
  478. # PCBNEW_RESOURCES variable is set by the macro.
  479. mingw_resource_compiler( pcbnew )
  480. else()
  481. set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
  482. endif()
  483. endif()
  484. # Create a C++ compilable string initializer containing markdown text into a *.h file:
  485. add_custom_command(
  486. OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help_md.h
  487. COMMAND ${CMAKE_COMMAND}
  488. -DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md
  489. -DoutputFile=${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help_md.h
  490. -P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake
  491. DEPENDS ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md
  492. COMMENT "creating ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help_md.h
  493. from ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md"
  494. )
  495. set_source_files_properties( dialogs/panel_setup_rules.cpp
  496. PROPERTIES
  497. OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help_md.h
  498. )
  499. if( APPLE )
  500. # setup bundle
  501. set( PCBNEW_RESOURCES pcbnew.icns pcbnew_doc.icns )
  502. set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.icns" PROPERTIES
  503. MACOSX_PACKAGE_LOCATION Resources
  504. )
  505. set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/pcbnew_doc.icns" PROPERTIES
  506. MACOSX_PACKAGE_LOCATION Resources
  507. )
  508. set( MACOSX_BUNDLE_ICON_FILE pcbnew.icns )
  509. set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
  510. set( MACOSX_BUNDLE_NAME pcbnew )
  511. endif()
  512. add_subdirectory( plugins/pcad )
  513. add_subdirectory( plugins/altium )
  514. add_subdirectory( plugins/cadstar )
  515. add_subdirectory( plugins/fabmaster )
  516. set( PCBNEW_IO_LIBRARIES pcad2kicadpcb altium2pcbnew cadstar2pcbnew fabmaster CACHE INTERNAL "")
  517. # a very small program launcher for pcbnew_kiface
  518. add_executable( pcbnew WIN32 MACOSX_BUNDLE
  519. ${CMAKE_SOURCE_DIR}/common/single_top.cpp
  520. ${PCBNEW_RESOURCES}
  521. )
  522. set_source_files_properties( ${CMAKE_SOURCE_DIR}/common/single_top.cpp pcbnew.cpp PROPERTIES
  523. COMPILE_DEFINITIONS "TOP_FRAME=FRAME_PCB_EDITOR;PGM_DATA_FILE_EXT=\"kicad_pcb\";BUILD_KIWAY_DLL"
  524. )
  525. target_link_libraries( pcbnew
  526. #singletop # replaces common, giving us restrictive control and link warnings.
  527. # There's way too much crap coming in from common yet.
  528. common
  529. gal
  530. scripting
  531. core
  532. nlohmann_json
  533. rectpack2d
  534. argparse::argparse
  535. ${wxWidgets_LIBRARIES}
  536. )
  537. target_link_options( pcbnew PRIVATE
  538. $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=pcbnew.map>
  539. )
  540. # the main pcbnew program, in DSO form.
  541. add_library( pcbnew_kiface_objects OBJECT
  542. pcbnew.cpp
  543. ${PCBNEW_SRCS}
  544. ${PCBNEW_COMMON_SRCS}
  545. ${PCBNEW_SCRIPTING_SRCS}
  546. )
  547. # auto-generate specctra_lexer.h and specctra_keywords.cpp
  548. make_lexer(
  549. pcbnew_kiface_objects
  550. specctra_import_export/specctra.keywords
  551. specctra_import_export/specctra_lexer.h
  552. specctra_import_export/specctra_keywords.cpp
  553. DSN
  554. )
  555. target_link_libraries( pcbnew_kiface_objects
  556. PRIVATE
  557. common
  558. core
  559. dxflib_qcad
  560. nanosvg
  561. tinyspline_lib
  562. nlohmann_json
  563. rectpack2d
  564. gzip-hpp
  565. Boost::boost
  566. ZLIB::ZLIB
  567. ${OCC_LIBRARIES}
  568. )
  569. target_include_directories( pcbnew_kiface_objects PRIVATE
  570. $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
  571. )
  572. add_library( pcbnew_kiface MODULE )
  573. set_target_properties( pcbnew_kiface PROPERTIES
  574. # Decorate OUTPUT_NAME with PREFIX and SUFFIX, creating something like
  575. # _pcbnew.so, _pcbnew.dll, or _pcbnew.kiface
  576. OUTPUT_NAME pcbnew
  577. PREFIX ${KIFACE_PREFIX}
  578. SUFFIX ${KIFACE_SUFFIX}
  579. )
  580. if ( KICAD_BUILD_TESTS )
  581. if ( UNIX )
  582. add_custom_command(TARGET pcbnew_kiface POST_BUILD
  583. COMMAND ln -sf _pcbnew.kiface lib_pcbnew_kiface.so )
  584. else()
  585. add_custom_command(TARGET pcbnew_kiface POST_BUILD
  586. COMMAND copy _pcbnew.kiface lib_pcbnew_kiface.dll )
  587. endif()
  588. endif ()
  589. set( PCBNEW_KIFACE_LIBRARIES
  590. pcbnew_kiface_objects
  591. 3d-viewer
  592. connectivity
  593. pcbcommon
  594. pnsrouter
  595. kiplatform
  596. common
  597. gal
  598. scripting
  599. core
  600. dxflib_qcad
  601. tinyspline_lib
  602. idf3
  603. nanosvg
  604. markdown_lib
  605. ${PCBNEW_IO_LIBRARIES}
  606. ${wxWidgets_LIBRARIES}
  607. ${PYTHON_LIBRARIES}
  608. Boost::headers
  609. ${PCBNEW_EXTRA_LIBS} # -lrt must follow Boost
  610. )
  611. target_link_libraries( pcbnew_kiface
  612. PRIVATE
  613. ${PCBNEW_KIFACE_LIBRARIES}
  614. )
  615. set_source_files_properties( pcbnew.cpp PROPERTIES
  616. # The KIFACE is in pcbnew.cpp, export it:
  617. COMPILE_DEFINITIONS "BUILD_KIWAY_DLL;COMPILING_DLL"
  618. )
  619. target_link_options( pcbnew_kiface PRIVATE
  620. $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_pcbnew.kiface.map>
  621. )
  622. # if building pcbnew, then also build pcbnew_kiface if out of date.
  623. add_dependencies( pcbnew pcbnew_kiface )
  624. if( WIN32 )
  625. # Copy dynamic lib dependency to build dir to allow running directly
  626. add_custom_command( TARGET pcbnew POST_BUILD
  627. COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:kicad_3dsg>" "$<TARGET_FILE_DIR:pcbnew>"
  628. )
  629. endif()
  630. # these 2 binaries are a matched set, keep them together:
  631. if( APPLE )
  632. set_target_properties( pcbnew PROPERTIES
  633. MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/pcbnew/Info.plist
  634. )
  635. # puts binaries into the *.app bundle while linking
  636. set_target_properties( pcbnew_kiface PROPERTIES
  637. LIBRARY_OUTPUT_DIRECTORY ${OSX_BUNDLE_BUILD_KIFACE_DIR}
  638. )
  639. # put individual bundle outside of main bundle as a first step
  640. # will be pulled into the main bundle when creating main bundle
  641. install( TARGETS pcbnew
  642. DESTINATION ${KICAD_BIN}
  643. COMPONENT binary
  644. )
  645. install( CODE "
  646. # override default embedded path settings
  647. ${OSX_BUNDLE_OVERRIDE_PATHS}
  648. # do all the work
  649. include( BundleUtilities )
  650. fixup_bundle( ${KICAD_BIN}/pcbnew.app/Contents/MacOS/pcbnew
  651. \"\"
  652. \"${PYTHON_FRAMEWORK}\"
  653. )
  654. " COMPONENT Runtime
  655. )
  656. else()
  657. if( MSVC )
  658. target_sources( pcbnew_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew-dll.rc )
  659. endif()
  660. install( TARGETS pcbnew
  661. DESTINATION ${KICAD_BIN}
  662. COMPONENT binary
  663. )
  664. install( TARGETS pcbnew_kiface
  665. DESTINATION ${KICAD_KIFACE}
  666. COMPONENT binary
  667. )
  668. endif()
  669. if( KICAD_WIN32_INSTALL_PDBS )
  670. # Get the PDBs to copy over for MSVC
  671. install(FILES $<TARGET_PDB_FILE:pcbnew> DESTINATION ${KICAD_BIN})
  672. install(FILES $<TARGET_PDB_FILE:pcbnew_kiface> DESTINATION ${KICAD_KIFACE})
  673. endif()
  674. if( NOT APPLE )
  675. install( FILES ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py DESTINATION ${PYTHON_DEST} )
  676. else()
  677. # put into bundle at build time, it is relocated at install
  678. add_custom_target( ScriptingPcbnewPyCopy ALL
  679. COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}/"
  680. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py
  681. COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
  682. )
  683. add_dependencies( ScriptingPcbnewPyCopy ScriptingPythonDirectoryCreation )
  684. endif()
  685. # python plugins
  686. install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/python/plugins/
  687. DESTINATION ${KICAD_DATA}/scripting/plugins
  688. FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
  689. )
  690. # Here is built the _pcbnew.{so,pyd} which is the native part of the pcbnew Python library
  691. # when Python is used from the command line.
  692. if( WIN32 )
  693. install( FILES ${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.pyd DESTINATION ${PYTHON_DEST} )
  694. set( PYMOD_EXT "pyd" )
  695. elseif( APPLE )
  696. # put everything into bundle at build time, it is relocated at install
  697. add_custom_target( ScriptingModulesPcbnewSoCopy ALL
  698. COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.so" "${PYTHON_DEST}/"
  699. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.so
  700. COMMENT "Copying _pcbnew.so into ${PYTHON_DEST}"
  701. )
  702. add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingPythonDirectoryCreation )
  703. set( PYMOD_EXT "so" )
  704. else()
  705. # Linux is the remaining platform, and all that has to be installed is the created symlink.
  706. set( PYMOD_EXT "so" )
  707. install( FILES ${CMAKE_CURRENT_BINARY_DIR}/python/_pcbnew.${PYMOD_EXT} DESTINATION ${PYTHON_DEST} )
  708. endif()
  709. if( APPLE )
  710. add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
  711. DEPENDS pcbnew_kiface
  712. COMMAND ${CMAKE_COMMAND} -E copy ${OSX_BUNDLE_BUILD_KIFACE_DIR}/_pcbnew.kiface _pcbnew.${PYMOD_EXT}
  713. COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use."
  714. )
  715. set( PYTHON_FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} )
  716. elseif( WIN32 )
  717. # For phase 1, copy _pcbnew.kiface to the python module.
  718. add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
  719. DEPENDS pcbnew_kiface
  720. COMMAND ${CMAKE_COMMAND} -E copy _pcbnew${KIFACE_SUFFIX} _pcbnew.${PYMOD_EXT}
  721. COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use."
  722. )
  723. set( PYTHON_FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} )
  724. else()
  725. # For linux, just create a symlink in the build directory to ensure the unit tests can find the library
  726. # We don't actually do anything with this symlink though, since we create the proper one for the install
  727. # later.
  728. add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
  729. DEPENDS pcbnew_kiface
  730. COMMAND ${CMAKE_COMMAND} -E create_symlink _pcbnew${KIFACE_SUFFIX} _pcbnew.${PYMOD_EXT}
  731. COMMENT "Symlinking _pcbnew.${PYMOD_EXT} to _pcbnew${KIFACE_SUFFIX}."
  732. )
  733. if( IS_ABSOLUTE ${KICAD_KIFACE} )
  734. file( RELATIVE_PATH PCBNEW_PYTHON_SYMLINK ${PYTHON_FULL_DEST} ${KICAD_KIFACE}/_pcbnew${KIFACE_SUFFIX} )
  735. else()
  736. file( RELATIVE_PATH PCBNEW_PYTHON_SYMLINK ${PYTHON_FULL_DEST} ${CMAKE_INSTALL_PREFIX}/${KICAD_KIFACE}/_pcbnew${KIFACE_SUFFIX} )
  737. endif()
  738. file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python )
  739. # This is the symlink we use in the installation directory, so it will not resolve in the build directory.
  740. add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python/_pcbnew.${PYMOD_EXT}
  741. DEPENDS pcbnew_kiface
  742. COMMAND ln -sf "${PCBNEW_PYTHON_SYMLINK}" "${CMAKE_CURRENT_BINARY_DIR}/python/_pcbnew.${PYMOD_EXT}"
  743. COMMENT "Creating install symlink from _pcbnew.${PYMOD_EXT} to _pcbnew${KIFACE_SUFFIX}."
  744. )
  745. set( PYTHON_FILES
  746. ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
  747. ${CMAKE_CURRENT_BINARY_DIR}/python/_pcbnew.${PYMOD_EXT}
  748. )
  749. endif()
  750. add_custom_target(
  751. pcbnew_python_module ALL
  752. DEPENDS ${PYTHON_FILES}
  753. )
  754. if( APPLE )
  755. # If we don't have wxPython, then we must create the site-packages directory
  756. add_custom_target( ScriptingPythonDirectoryCreation ALL
  757. COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_DEST}"
  758. COMMENT "Creating Python library directory ${PYTHON_DEST}"
  759. )
  760. endif()