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.

976 lines
28 KiB

Introduction of Graphics Abstraction Layer based rendering for pcbnew. New classes: - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.) - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes). - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL). - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries. - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc. - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods. - STROKE_FONT - Implements stroke font drawing using GAL methods. Most important changes to Kicad original code: * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects. * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime. * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew) * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom. * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime. * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods. * Removed tools/class_painter.h, as now it is extended and included in source code. Build changes: * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL. * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required. * GAL-related code is compiled into a static library (common/libgal). * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS). More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
13 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
2 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
2 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
2 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
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
5 years ago
14 years ago
  1. # Add all the warnings to the files
  2. if( COMPILER_SUPPORTS_WARNINGS )
  3. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARN_FLAGS_CXX}")
  4. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_FLAGS_C}")
  5. endif()
  6. set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
  7. include_directories( BEFORE ${INC_BEFORE} )
  8. include_directories(
  9. ./dialogs
  10. ./widgets
  11. ./dialog_about
  12. ${CMAKE_SOURCE_DIR}/resources/bitmaps_png
  13. ${CMAKE_SOURCE_DIR}/3d-viewer
  14. ${CMAKE_SOURCE_DIR}/pcbnew
  15. ${CMAKE_SOURCE_DIR}/kicad
  16. ${INC_AFTER}
  17. )
  18. # Get the GAL Target
  19. add_subdirectory( gal )
  20. # Only for win32 cross compilation using MXE
  21. add_compile_definitions( $<$<AND:$<BOOL:${WIN32}>,$<BOOL:${MSYS}>>:GLEW_STATIC> )
  22. # The build version string defaults to the value in the KiCadVersion.cmake file.
  23. # If being built inside a git repository, the git tag and commit hash are used to create
  24. # a new version string instead. The user can supply an additional string to be appended
  25. # to the end inside the KICAD_VERSION_EXTRA variable
  26. set( KICAD_VERSION_EXTRA "" CACHE STRING
  27. "User defined configuration string to append to KiCad version." )
  28. # Generate version header file.
  29. add_custom_target(
  30. version_header ALL
  31. COMMAND ${CMAKE_COMMAND}
  32. -DKICAD_VERSION_EXTRA=${KICAD_VERSION_EXTRA}
  33. -DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
  34. -DTEXT_OUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.txt
  35. -DSRC_PATH=${PROJECT_SOURCE_DIR}
  36. -DKICAD_CMAKE_MODULE_PATH=${KICAD_CMAKE_MODULE_PATH}
  37. -P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
  38. WORKING_DIRECTORY ${CMAKE_BINARY_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h
  39. DEPENDS ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
  40. COMMENT "Generating version string header"
  41. )
  42. # A shared library used by multiple *.kiface files and one or two program
  43. # launchers. Object files can migrate into here over time, but only if they are
  44. # surely needed and certainly used from more than one place without recompilation.
  45. # Functions and data all need to use the #include <import_export.h> and be declared
  46. # as APIEXPORT
  47. set( KICOMMON_SRCS
  48. # Fonts
  49. newstroke_font.cpp
  50. font/fontconfig.cpp
  51. font/version_info.cpp
  52. # Gal
  53. gal/color4d.cpp
  54. # Jobs
  55. jobs/job.cpp
  56. jobs/job_registry.cpp
  57. jobs/jobs_output_archive.cpp
  58. jobs/jobs_output_folder.cpp
  59. jobs/job_export_pcb_drill.cpp
  60. jobs/job_export_pcb_dxf.cpp
  61. jobs/job_export_pcb_gerber.cpp
  62. jobs/job_export_pcb_gerbers.cpp
  63. jobs/job_export_pcb_ipc2581.cpp
  64. jobs/job_export_pcb_pdf.cpp
  65. jobs/job_export_pcb_plot.cpp
  66. jobs/job_export_pcb_pos.cpp
  67. jobs/job_export_pcb_svg.cpp
  68. jobs/job_export_pcb_gencad.cpp
  69. jobs/job_export_pcb_3d.cpp
  70. jobs/job_export_sch_bom.cpp
  71. jobs/job_export_sch_netlist.cpp
  72. jobs/job_export_sch_plot.cpp
  73. jobs/job_export_sch_pythonbom.cpp
  74. jobs/jobset.cpp
  75. jobs/job_fp_export_svg.cpp
  76. jobs/job_fp_upgrade.cpp
  77. jobs/job_pcb_render.cpp
  78. jobs/job_pcb_drc.cpp
  79. jobs/job_sch_erc.cpp
  80. jobs/job_sym_export_svg.cpp
  81. jobs/job_sym_upgrade.cpp
  82. kicad_curl/kicad_curl.cpp
  83. kicad_curl/kicad_curl_easy.cpp
  84. settings/app_settings.cpp
  85. settings/aui_settings.cpp
  86. settings/bom_settings.cpp
  87. settings/color_settings.cpp
  88. settings/common_settings.cpp
  89. settings/grid_settings.cpp
  90. settings/json_settings.cpp
  91. settings/kicad_settings.cpp
  92. settings/nested_settings.cpp
  93. settings/parameters.cpp
  94. settings/settings_manager.cpp
  95. project/board_project_settings.cpp
  96. project/net_settings.cpp
  97. project/project_archiver.cpp
  98. project/project_file.cpp
  99. project/project_local_settings.cpp
  100. dialogs/dialog_migrate_settings.cpp
  101. dialogs/dialog_migrate_settings_base.cpp
  102. widgets/bitmap_button.cpp
  103. widgets/html_window.cpp
  104. widgets/kistatusbar.cpp
  105. widgets/number_badge.cpp
  106. widgets/progress_reporter_base.cpp
  107. widgets/std_bitmap_button.cpp
  108. widgets/ui_common.cpp
  109. widgets/wx_html_report_panel.cpp
  110. widgets/wx_html_report_panel_base.cpp
  111. database/database_lib_settings.cpp
  112. design_block_lib_table.cpp
  113. design_block_io.cpp
  114. design_block_info.cpp
  115. design_block_info_impl.cpp
  116. advanced_config.cpp
  117. asset_archive.cpp
  118. array_axis.cpp
  119. array_options.cpp
  120. background_jobs_monitor.cpp
  121. bitmap.cpp
  122. bitmap_info.cpp
  123. bitmap_store.cpp
  124. build_version.cpp
  125. common.cpp
  126. config_params.cpp
  127. confirm.cpp
  128. dialog_shim.cpp
  129. dpi_scaling.cpp
  130. dpi_scaling_common.cpp
  131. dsnlexer.cpp
  132. eda_pattern_match.cpp
  133. eda_units.cpp
  134. env_vars.cpp
  135. exceptions.cpp
  136. gestfich.cpp
  137. json_conversions.cpp
  138. kidialog.cpp
  139. kiid.cpp
  140. kiway.cpp
  141. kiway_express.cpp
  142. kiway_holder.cpp
  143. launch_ext.cpp
  144. lib_table_base.cpp
  145. layer_id.cpp
  146. lib_id.cpp
  147. locale_io.cpp
  148. lseq.cpp
  149. lset.cpp
  150. markup_parser.cpp
  151. netclass.cpp
  152. notifications_manager.cpp
  153. page_info.cpp
  154. paths.cpp
  155. project.cpp
  156. reporter.cpp
  157. richio.cpp
  158. search_stack.cpp
  159. searchhelpfilefullpath.cpp
  160. string_utils.cpp
  161. systemdirsappend.cpp
  162. ui_events.cpp
  163. trace_helpers.cpp
  164. wildcards_and_files_ext.cpp
  165. wx_filename.cpp
  166. pgm_base.cpp
  167. ../scripting/python_scripting.cpp
  168. io/kicad/kicad_io_utils.cpp # needed by richio
  169. io/io_base.cpp
  170. io/io_utils.cpp
  171. )
  172. if( KICAD_IPC_API )
  173. set( KICOMMON_SRCS
  174. ${KICOMMON_SRCS}
  175. api/api_handler.cpp
  176. api/api_handler_common.cpp
  177. api/api_plugin.cpp
  178. api/api_plugin_manager.cpp
  179. api/api_server.cpp
  180. ../scripting/python_manager.cpp
  181. )
  182. endif()
  183. add_library( kicommon SHARED
  184. ${KICOMMON_SRCS}
  185. )
  186. set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
  187. target_link_libraries( kicommon
  188. core
  189. kiapi
  190. kimath
  191. kiplatform
  192. nlohmann_json
  193. fmt::fmt
  194. CURL::libcurl
  195. picosha2
  196. ${ZSTD_LIBRARY}
  197. ${wxWidgets_LIBRARIES}
  198. ${LIBGIT2_LIBRARIES}
  199. # needed by kiid to allow linking for Boost for the UUID against bcrypt (msys2 only)
  200. ${EXTRA_LIBS}
  201. # outline font support
  202. ${FREETYPE_LIBRARIES}
  203. ${HarfBuzz_LIBRARIES}
  204. ${Fontconfig_LIBRARIES}
  205. # needed because of python_scripting.cpp
  206. ${PYTHON_LIBRARIES}
  207. )
  208. if( KICAD_USE_SENTRY )
  209. target_link_libraries( kicommon
  210. sentry )
  211. set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
  212. endif()
  213. if( KICAD_IPC_API )
  214. target_link_libraries( kicommon
  215. kinng
  216. )
  217. endif()
  218. include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake )
  219. include( ${KICAD_CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
  220. create_git_version_header(${CMAKE_SOURCE_DIR})
  221. # Extract the major and minor build version as a string
  222. string( REGEX MATCH
  223. "([0-9]+)\\.([0-9]+)\\.([0-9]+)"
  224. KICAD_MAJOR_MINOR_PATCH_VERSION
  225. "${KICAD_VERSION}"
  226. )
  227. set_target_properties( kicommon PROPERTIES
  228. OUTPUT_NAME kicommon
  229. SOVERSION ${KICAD_MAJOR_MINOR_PATCH_VERSION}
  230. )
  231. install( TARGETS kicommon
  232. RUNTIME DESTINATION ${KICAD_LIB}
  233. LIBRARY DESTINATION ${KICAD_LIB}
  234. COMPONENT binary
  235. )
  236. if( APPLE )
  237. # puts library into the main kicad.app bundle in build tree
  238. set_target_properties( kicommon PROPERTIES
  239. LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}"
  240. INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}"
  241. )
  242. set_target_properties( kicommon PROPERTIES INSTALL_RPATH
  243. "@executable_path/../Frameworks" )
  244. set_target_properties( kicommon PROPERTIES BUILD_WITH_INSTALL_RPATH 1 )
  245. endif()
  246. target_compile_definitions( kicommon PRIVATE KICOMMON_DLL=1 )
  247. target_include_directories( kicommon
  248. PUBLIC
  249. .
  250. ${CMAKE_BINARY_DIR}
  251. $<TARGET_PROPERTY:dynamic_bitset,INTERFACE_INCLUDE_DIRECTORIES>
  252. $<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
  253. $<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
  254. $<TARGET_PROPERTY:expected,INTERFACE_INCLUDE_DIRECTORIES>
  255. $<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
  256. $<TARGET_PROPERTY:picosha2,INTERFACE_INCLUDE_DIRECTORIES>
  257. )
  258. add_dependencies( kicommon pegtl version_header )
  259. if( MSVC )
  260. target_sources( kicommon PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/kicommon-dll.rc )
  261. endif()
  262. set( COMMON_ABOUT_DLG_SRCS
  263. dialog_about/AboutDialog_main.cpp
  264. dialog_about/dialog_about.cpp
  265. dialog_about/dialog_about_base.cpp
  266. )
  267. set( COMMON_GIT_DLG_SRCS
  268. dialogs/git/dialog_git_commit.cpp
  269. dialogs/git/dialog_git_switch.cpp
  270. dialogs/git/dialog_git_auth.cpp
  271. dialogs/git/dialog_git_repository.cpp
  272. dialogs/git/dialog_git_repository_base.cpp
  273. dialogs/git/panel_git_repos.cpp
  274. dialogs/git/panel_git_repos_base.cpp
  275. )
  276. set( COMMON_DLG_SRCS
  277. ${COMMON_GIT_DLG_SRCS}
  278. dialogs/dialog_assign_netclass.cpp
  279. dialogs/dialog_assign_netclass_base.cpp
  280. dialogs/dialog_book_reporter.cpp
  281. dialogs/dialog_book_reporter_base.cpp
  282. dialogs/dialog_color_picker.cpp
  283. dialogs/dialog_color_picker_base.cpp
  284. dialogs/dialog_configure_paths.cpp
  285. dialogs/dialog_configure_paths_base.cpp
  286. dialogs/dialog_display_html_text_base.cpp
  287. dialogs/dialog_edit_library_tables.cpp
  288. dialogs/dialog_embed_files.cpp
  289. dialogs/dialog_global_lib_table_config.cpp
  290. dialogs/dialog_global_lib_table_config_base.cpp
  291. dialogs/dialog_global_design_block_lib_table_config.cpp
  292. dialogs/dialog_grid_settings.cpp
  293. dialogs/dialog_grid_settings_base.cpp
  294. dialogs/dialog_hotkey_list.cpp
  295. dialogs/dialog_HTML_reporter_base.cpp
  296. dialogs/dialog_import_choose_project.cpp
  297. dialogs/dialog_import_choose_project_base.cpp
  298. dialogs/dialog_locked_items_query.cpp
  299. dialogs/dialog_locked_items_query_base.cpp
  300. dialogs/dialog_multi_unit_entry.cpp
  301. dialogs/dialog_page_settings_base.cpp
  302. dialogs/dialog_paste_special.cpp
  303. dialogs/dialog_paste_special_base.cpp
  304. dialogs/dialog_plugin_options.cpp
  305. dialogs/dialog_plugin_options_base.cpp
  306. dialogs/dialog_text_entry_base.cpp
  307. dialogs/dialog_page_settings.cpp
  308. dialogs/dialog_print_generic.cpp
  309. dialogs/dialog_print_generic_base.cpp
  310. dialogs/dialog_text_entry.cpp
  311. dialogs/dialog_unit_entry.cpp
  312. dialogs/dialog_unit_entry_base.cpp
  313. dialogs/eda_list_dialog.cpp
  314. dialogs/eda_list_dialog_base.cpp
  315. dialogs/eda_reorderable_list_dialog.cpp
  316. dialogs/eda_reorderable_list_dialog_base.cpp
  317. dialogs/eda_view_switcher.cpp
  318. dialogs/eda_view_switcher_base.cpp
  319. dialogs/hotkey_cycle_popup.cpp
  320. dialogs/html_message_box.cpp
  321. dialogs/panel_color_settings_base.cpp
  322. dialogs/panel_color_settings.cpp
  323. dialogs/panel_common_settings.cpp
  324. dialogs/panel_common_settings_base.cpp
  325. dialogs/panel_design_block_lib_table_base.cpp
  326. dialogs/panel_design_block_lib_table.cpp
  327. dialogs/panel_embedded_files.cpp
  328. dialogs/panel_embedded_files_base.cpp
  329. dialogs/panel_gal_display_options.cpp
  330. dialogs/panel_hotkeys_editor.cpp
  331. dialogs/panel_image_editor.cpp
  332. dialogs/panel_image_editor_base.cpp
  333. dialogs/panel_grid_settings.cpp
  334. dialogs/panel_grid_settings_base.cpp
  335. dialogs/panel_mouse_settings.cpp
  336. dialogs/panel_mouse_settings_base.cpp
  337. dialogs/panel_packages_and_updates.cpp
  338. dialogs/panel_packages_and_updates_base.cpp
  339. dialogs/panel_plugin_settings.cpp
  340. dialogs/panel_plugin_settings_base.cpp
  341. dialogs/panel_setup_netclasses.cpp
  342. dialogs/panel_setup_netclasses_base.cpp
  343. dialogs/panel_setup_severities.cpp
  344. dialogs/panel_text_variables.cpp
  345. dialogs/panel_text_variables_base.cpp
  346. )
  347. if( KICAD_USE_SENTRY )
  348. list( APPEND COMMON_DLG_SRCS
  349. dialogs/panel_data_collection.cpp
  350. dialogs/panel_data_collection_base.cpp )
  351. endif()
  352. set( COMMON_WIDGET_SRCS
  353. widgets/app_progress_dialog.cpp
  354. widgets/bitmap_toggle.cpp
  355. widgets/button_row_panel.cpp
  356. widgets/color_swatch.cpp
  357. widgets/font_choice.cpp
  358. widgets/footprint_choice.cpp
  359. widgets/footprint_diff_widget.cpp
  360. widgets/footprint_preview_widget.cpp
  361. widgets/footprint_select_widget.cpp
  362. widgets/gal_options_panel.cpp
  363. widgets/gal_options_panel_base.cpp
  364. widgets/grid_bitmap_toggle.cpp
  365. widgets/grid_button.cpp
  366. widgets/grid_color_swatch_helpers.cpp
  367. widgets/grid_combobox.cpp
  368. widgets/grid_icon_text_helpers.cpp
  369. widgets/grid_text_button_helpers.cpp
  370. widgets/grid_text_helpers.cpp
  371. widgets/indicator_icon.cpp
  372. widgets/wx_infobar.cpp
  373. widgets/layer_box_selector.cpp
  374. widgets/layer_presentation.cpp
  375. widgets/lib_tree.cpp
  376. widgets/listbox_tricks.cpp
  377. widgets/mathplot.cpp
  378. widgets/msgpanel.cpp
  379. widgets/paged_dialog.cpp
  380. widgets/properties_panel.cpp
  381. widgets/search_pane.cpp
  382. widgets/search_pane_base.cpp
  383. widgets/search_pane_tab.cpp
  384. widgets/split_button.cpp
  385. widgets/stepped_slider.cpp
  386. widgets/text_ctrl_eval.cpp
  387. widgets/unit_binder.cpp
  388. widgets/widget_save_restore.cpp
  389. widgets/widget_hotkey_list.cpp
  390. widgets/wx_aui_art_providers.cpp
  391. widgets/wx_aui_utils.cpp
  392. widgets/wx_busy_indicator.cpp
  393. widgets/wx_collapsible_pane.cpp
  394. widgets/wx_combobox.cpp
  395. widgets/wx_dataviewctrl.cpp
  396. widgets/wx_ellipsized_static_text.cpp
  397. widgets/wx_grid.cpp
  398. widgets/wx_grid_autosizer.cpp
  399. widgets/wx_html_report_box.cpp
  400. widgets/wx_listbox.cpp
  401. widgets/wx_panel.cpp
  402. widgets/wx_progress_reporters.cpp
  403. widgets/wx_splitter_window.cpp
  404. widgets/wx_treebook.cpp
  405. )
  406. set( COMMON_DRAWING_SHEET_SRCS
  407. drawing_sheet/ds_data_item.cpp
  408. drawing_sheet/ds_data_model.cpp
  409. drawing_sheet/ds_data_model_io.cpp
  410. drawing_sheet/drawing_sheet_default_description.cpp
  411. drawing_sheet/ds_draw_item.cpp
  412. drawing_sheet/ds_proxy_undo_item.cpp
  413. drawing_sheet/ds_proxy_view_item.cpp
  414. drawing_sheet/drawing_sheet_parser.cpp
  415. )
  416. set( COMMON_PREVIEW_ITEMS_SRCS
  417. preview_items/anchor_debug.cpp
  418. preview_items/arc_assistant.cpp
  419. preview_items/arc_geom_manager.cpp
  420. preview_items/bezier_assistant.cpp
  421. preview_items/bezier_geom_manager.cpp
  422. preview_items/centreline_rect_item.cpp
  423. preview_items/construction_geom.cpp
  424. preview_items/draw_context.cpp
  425. preview_items/item_drawing_utils.cpp
  426. preview_items/polygon_geom_manager.cpp
  427. preview_items/polygon_item.cpp
  428. preview_items/preview_utils.cpp
  429. preview_items/ruler_item.cpp
  430. preview_items/selection_area.cpp
  431. preview_items/simple_overlay_item.cpp
  432. preview_items/snap_indicator.cpp
  433. preview_items/two_point_assistant.cpp
  434. )
  435. set( PLOTTERS_CONTROL_SRCS
  436. plotters/plotter.cpp
  437. plotters/DXF_plotter.cpp
  438. plotters/GERBER_plotter.cpp
  439. plotters/HPGL_plotter.cpp
  440. plotters/PDF_plotter.cpp
  441. plotters/PS_plotter.cpp
  442. plotters/SVG_plotter.cpp
  443. plotters/common_plot_functions.cpp
  444. )
  445. set( COMMON_IO_SRCS
  446. # Altium
  447. io/altium/altium_binary_parser.cpp
  448. io/altium/altium_ascii_parser.cpp
  449. io/altium/altium_parser_utils.cpp
  450. io/altium/altium_props_utils.cpp
  451. # Cadstar
  452. io/cadstar/cadstar_archive_parser.cpp
  453. io/cadstar/cadstar_parts_lib_parser.cpp
  454. # Eagle
  455. io/eagle/eagle_parser.cpp
  456. # EasyEDA
  457. io/easyeda/easyeda_parser_base.cpp
  458. io/easyeda/easyeda_parser_structs.cpp
  459. # EasyEDA pro
  460. io/easyedapro/easyedapro_parser.cpp
  461. io/easyedapro/easyedapro_import_utils.cpp
  462. )
  463. set( COMMON_IMPORT_GFX_SRCS
  464. import_gfx/graphics_import_mgr.cpp
  465. import_gfx/graphics_importer.cpp
  466. import_gfx/graphics_importer_buffer.cpp
  467. import_gfx/dxf_import_plugin.cpp
  468. import_gfx/svg_import_plugin.cpp
  469. )
  470. set( COMMON_GIT_SRCS
  471. git/git_add_to_index_handler.cpp
  472. git/git_clone_handler.cpp
  473. git/git_commit_handler.cpp
  474. git/git_pull_handler.cpp
  475. git/git_push_handler.cpp
  476. git/git_remove_from_index_handler.cpp
  477. git/git_resolve_conflict_handler.cpp
  478. git/git_revert_handler.cpp
  479. git/git_sync_handler.cpp
  480. git/kicad_git_common.cpp
  481. git/kicad_git_errors.cpp
  482. )
  483. set( COMMON_SRCS
  484. ${LIB_KICAD_SRCS}
  485. ${COMMON_ABOUT_DLG_SRCS}
  486. ${COMMON_DLG_SRCS}
  487. ${COMMON_WIDGET_SRCS}
  488. ${COMMON_DRAWING_SHEET_SRCS}
  489. ${COMMON_PREVIEW_ITEMS_SRCS}
  490. ${PLOTTERS_CONTROL_SRCS}
  491. ${COMMON_IO_SRCS}
  492. ${FONT_SRCS}
  493. ${COMMON_IMPORT_GFX_SRCS}
  494. ${COMMON_GIT_SRCS}
  495. jobs/job_dispatcher.cpp
  496. base_screen.cpp
  497. bin_mod.cpp
  498. bitmap_base.cpp
  499. board_printout.cpp
  500. clipboard.cpp
  501. cli_progress_reporter.cpp
  502. commit.cpp
  503. draw_panel_gal.cpp
  504. gal_display_options_common.cpp
  505. gr_text.cpp
  506. eda_base_frame.cpp
  507. eda_dde.cpp
  508. eda_doc.cpp
  509. eda_draw_frame.cpp
  510. eda_item.cpp
  511. eda_shape.cpp
  512. eda_text.cpp
  513. eda_tools.cpp
  514. embedded_files.cpp
  515. env_paths.cpp
  516. executable_names.cpp
  517. filename_resolver.cpp
  518. file_history.cpp
  519. filter_reader.cpp
  520. footprint_filter.cpp
  521. footprint_info.cpp
  522. gbr_metadata.cpp
  523. gr_basic.cpp
  524. grid_tricks.cpp
  525. hotkey_store.cpp
  526. hotkeys_basic.cpp
  527. kiface_base.cpp
  528. kiway_player.cpp
  529. lib_table_grid_tricks.cpp
  530. lib_tree_model.cpp
  531. lib_tree_model_adapter.cpp
  532. marker_base.cpp
  533. origin_transforms.cpp
  534. printout.cpp
  535. ptree.cpp
  536. rc_item.cpp
  537. refdes_utils.cpp
  538. reference_image.cpp
  539. render_settings.cpp
  540. scintilla_tricks.cpp
  541. status_popup.cpp
  542. stroke_params.cpp
  543. template_fieldnames.cpp
  544. textentry_tricks.cpp
  545. title_block.cpp
  546. undo_redo_container.cpp
  547. validators.cpp
  548. drawing_sheet/ds_painter.cpp
  549. xnode.cpp
  550. view/wx_view_controls.cpp
  551. )
  552. set( COMMON_SRCS
  553. ${COMMON_SRCS}
  554. origin_viewitem.cpp
  555. tool/action_manager.cpp
  556. tool/action_menu.cpp
  557. tool/action_toolbar.cpp
  558. tool/actions.cpp
  559. tool/common_control.cpp
  560. tool/construction_manager.cpp
  561. tool/common_tools.cpp
  562. tool/conditional_menu.cpp
  563. tool/edit_constraints.cpp
  564. tool/edit_points.cpp
  565. tool/editor_conditions.cpp
  566. tool/embed_tool.cpp
  567. tool/grid_helper.cpp
  568. tool/grid_menu.cpp
  569. tool/library_editor_control.cpp
  570. tool/picker_tool.cpp
  571. tool/properties_tool.cpp
  572. tool/selection.cpp
  573. tool/selection_tool.cpp
  574. tool/selection_conditions.cpp
  575. tool/tool_action.cpp
  576. tool/tool_base.cpp
  577. tool/tool_dispatcher.cpp
  578. tool/tool_event.cpp
  579. tool/tools_holder.cpp
  580. tool/tool_interactive.cpp
  581. tool/tool_manager.cpp
  582. tool/tool_menu.cpp
  583. tool/zoom_menu.cpp
  584. tool/zoom_tool.cpp
  585. settings/cvpcb_settings.cpp
  586. properties/color4d_variant.cpp
  587. properties/eda_angle_variant.cpp
  588. properties/pg_cell_renderer.cpp
  589. properties/pg_editors.cpp
  590. properties/pg_properties.cpp
  591. properties/property_mgr.cpp
  592. properties/std_optional_variants.cpp
  593. database/database_connection.cpp
  594. http_lib/http_lib_connection.cpp
  595. http_lib/http_lib_settings.cpp
  596. api/api_enums.cpp
  597. api/api_utils.cpp
  598. )
  599. if( KICAD_IPC_API )
  600. set( COMMON_SRCS
  601. ${COMMON_SRCS}
  602. api/api_handler_editor.cpp
  603. )
  604. endif()
  605. add_library( common STATIC
  606. ${COMMON_SRCS}
  607. )
  608. add_dependencies( common version_header )
  609. add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
  610. target_link_libraries( common
  611. libcontext
  612. kimath
  613. kiplatform
  614. kicommon
  615. core
  616. fmt::fmt
  617. gal
  618. nanosvg
  619. dxflib_qcad
  620. tinyspline_lib
  621. scripting
  622. nlohmann_json
  623. pybind11::embed
  624. compoundfilereader
  625. Boost::headers
  626. # Database support needs these two
  627. nanodbc # for now; maybe hoist out of common
  628. Boost::locale
  629. ${wxWidgets_LIBRARIES}
  630. ${EXTRA_LIBS}
  631. # outline font support
  632. ${FREETYPE_LIBRARIES}
  633. ${HarfBuzz_LIBRARIES}
  634. ${Fontconfig_LIBRARIES}
  635. )
  636. if( KICAD_USE_SENTRY )
  637. target_link_libraries( common
  638. sentry )
  639. endif()
  640. if( KICAD_IPC_API )
  641. target_link_libraries( common
  642. kinng
  643. )
  644. endif()
  645. target_include_directories( common
  646. PUBLIC
  647. .
  648. ${CMAKE_BINARY_DIR}
  649. $<TARGET_PROPERTY:argparse::argparse,INTERFACE_INCLUDE_DIRECTORIES>
  650. $<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
  651. )
  652. # text markup support
  653. add_dependencies( common pegtl )
  654. target_include_directories( common PUBLIC
  655. $<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
  656. $<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
  657. )
  658. target_include_directories( common SYSTEM PUBLIC
  659. $<TARGET_PROPERTY:nanodbc,INTERFACE_INCLUDE_DIRECTORIES>
  660. )
  661. set( PCB_COMMON_SRCS
  662. fp_lib_table.cpp
  663. hash_eda.cpp
  664. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_base_frame.cpp
  665. ${CMAKE_SOURCE_DIR}/pcbnew/pcbexpr_evaluator.cpp
  666. ${CMAKE_SOURCE_DIR}/pcbnew/pcbexpr_functions.cpp
  667. ${CMAKE_SOURCE_DIR}/pcbnew/board_commit.cpp
  668. ${CMAKE_SOURCE_DIR}/pcbnew/board_connected_item.cpp
  669. ${CMAKE_SOURCE_DIR}/pcbnew/board_design_settings.cpp
  670. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp #needed by board_design_settings.cpp
  671. ${CMAKE_SOURCE_DIR}/pcbnew/router/pns_meander.cpp #needed by board_design_settings.cpp
  672. ${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
  673. ${CMAKE_SOURCE_DIR}/pcbnew/component_class_manager.cpp #needed by board.cpp
  674. ${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
  675. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
  676. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
  677. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_group.cpp
  678. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_marker.cpp
  679. ${CMAKE_SOURCE_DIR}/pcbnew/footprint.cpp
  680. ${CMAKE_SOURCE_DIR}/pcbnew/fix_board_shape.cpp
  681. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
  682. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
  683. ${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
  684. ${CMAKE_SOURCE_DIR}/pcbnew/padstack.cpp
  685. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
  686. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_reference_image.cpp
  687. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_field.cpp
  688. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_table.cpp
  689. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_tablecell.cpp
  690. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
  691. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_textbox.cpp
  692. ${CMAKE_SOURCE_DIR}/pcbnew/project_pcb.cpp
  693. ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/board_stackup.cpp
  694. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_track.cpp
  695. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_generator.cpp
  696. ${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp
  697. ${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp
  698. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_algo.cpp
  699. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_items.cpp
  700. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_data.cpp
  701. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/from_to_cache.cpp
  702. ${CMAKE_SOURCE_DIR}/pcbnew/convert_shape_list_to_polygon.cpp
  703. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_engine.cpp
  704. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_cache_generator.cpp
  705. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_item.cpp
  706. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule.cpp
  707. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_condition.cpp
  708. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_parser.cpp
  709. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_test_provider.cpp
  710. ${CMAKE_SOURCE_DIR}/pcbnew/footprint_editor_settings.cpp
  711. ${CMAKE_SOURCE_DIR}/pcbnew/generators_mgr.cpp
  712. ${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp
  713. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
  714. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
  715. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
  716. ${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
  717. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
  718. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
  719. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
  720. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp
  721. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp
  722. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp
  723. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp
  724. ${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp
  725. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_data.cpp
  726. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_view_item.cpp
  727. ${CMAKE_SOURCE_DIR}/pcbnew/sel_layer.cpp
  728. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop.cpp
  729. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp
  730. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
  731. ${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
  732. # IO files
  733. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
  734. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io_mgr.cpp
  735. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp
  736. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp
  737. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp
  738. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp
  739. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/geda/pcb_io_geda.cpp
  740. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_grid_helper.cpp
  741. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_actions.cpp
  742. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
  743. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_viewer_tools.cpp
  744. widgets/net_selector.cpp
  745. )
  746. set( PCB_COMMON_SRCS
  747. ${PCB_COMMON_SRCS}
  748. ${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_enums.cpp
  749. ${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_utils.cpp
  750. )
  751. # add -DPCBNEW to compilation of these PCBNEW sources
  752. set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
  753. COMPILE_DEFINITIONS "PCBNEW"
  754. )
  755. add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
  756. target_include_directories( pcbcommon PRIVATE
  757. )
  758. target_link_libraries( pcbcommon PUBLIC
  759. core
  760. common
  761. delaunator
  762. kimath
  763. kiplatform
  764. )
  765. message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" )
  766. add_subdirectory( ../pcbnew/navlib ./navlib)
  767. target_link_libraries( pcbcommon PUBLIC pcbnew_navlib)
  768. add_dependencies( pcbcommon delaunator )
  769. # The lemon grammar for the numeric evaluator
  770. generate_lemon_grammar(
  771. kicommon
  772. libeval
  773. libeval/numeric_evaluator.cpp
  774. libeval/grammar.lemon
  775. )
  776. # The lemon grammar for the expression compiler
  777. generate_lemon_grammar(
  778. kicommon
  779. libeval_compiler
  780. libeval_compiler/libeval_compiler.cpp
  781. libeval_compiler/grammar.lemon
  782. )
  783. # auto-generate stroke_params_lexer.h and stroke_params_keywords.cpp
  784. # Called twice one for common and one for gal, to ensure the files are created
  785. # on all devel tools ( Linux and msys2 )
  786. # works on Linux:
  787. make_lexer_export(
  788. kicommon
  789. stroke_params.keywords
  790. stroke_params_lexer.h
  791. stroke_params_keywords.cpp
  792. STROKEPARAMS_T
  793. KICOMMON_API
  794. kicommon.h
  795. )
  796. # auto-generate netlist_lexer.h and netlist_keywords.cpp
  797. make_lexer_export(
  798. kicommon
  799. netlist.keywords
  800. netlist_lexer.h
  801. netlist_keywords.cpp
  802. NL_T
  803. KICOMMON_API
  804. kicommon.h
  805. )
  806. # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
  807. make_lexer(
  808. pcbcommon
  809. pcb_plot_params.keywords
  810. pcb_plot_params_lexer.h
  811. pcb_plot_params_keywords.cpp
  812. PCBPLOTPARAMS_T
  813. )
  814. # auto-generate drc_rules_lexer.h and drc_rules_keywords.cpp
  815. make_lexer_export(
  816. kicommon
  817. drc_rules.keywords
  818. drc_rules_lexer.h
  819. drc_rules_keywords.cpp
  820. DRCRULE_T
  821. KICOMMON_API
  822. kicommon.h
  823. )
  824. # auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
  825. make_lexer(
  826. pcbcommon
  827. pcb.keywords
  828. pcb_lexer.h
  829. pcb_keywords.cpp
  830. PCB_KEYS_T
  831. )
  832. # auto-generate s-expression library table code.
  833. make_lexer_export(
  834. kicommon
  835. lib_table.keywords
  836. lib_table_lexer.h
  837. lib_table_keywords.cpp
  838. LIB_TABLE_T
  839. KICOMMON_API
  840. kicommon.h
  841. )
  842. # auto-generate s-expression template fieldnames lexer and keywords.
  843. make_lexer_export(
  844. kicommon
  845. template_fieldnames.keywords
  846. template_fieldnames_lexer.h
  847. template_fieldnames_keywords.cpp
  848. TFIELD_T
  849. KICOMMON_API
  850. kicommon.h
  851. )
  852. # auto-generate page layout reader s-expression page_layout_reader_lexer.h
  853. # and title_block_reader_keywords.cpp.
  854. make_lexer_export(
  855. kicommon
  856. drawing_sheet/drawing_sheet.keywords
  857. drawing_sheet/drawing_sheet_lexer.h
  858. drawing_sheet/drawing_sheet_keywords.cpp
  859. DRAWINGSHEET_T
  860. KICOMMON_API
  861. kicommon.h
  862. )
  863. # auto-generate embedded files lexer and keywords
  864. make_lexer_export(
  865. kicommon
  866. embedded_files.keywords
  867. embedded_files_lexer.h
  868. embedded_files_keywords.cpp
  869. EMBEDDED_FILES_T
  870. KICOMMON_API
  871. kicommon.h
  872. )
  873. # This one gets made only when testing.
  874. # to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
  875. add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
  876. target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )