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.

724 lines
21 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
* 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
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
* 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
4 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. if( KICAD_SPICE )
  7. set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
  8. endif()
  9. include_directories( BEFORE ${INC_BEFORE} )
  10. include_directories(
  11. ./dialogs
  12. ./widgets
  13. ./dialog_about
  14. ${CMAKE_SOURCE_DIR}/resources/bitmaps_png
  15. ${CMAKE_SOURCE_DIR}/3d-viewer
  16. ${CMAKE_SOURCE_DIR}/pcbnew
  17. ${INC_AFTER}
  18. )
  19. # Get the GAL Target
  20. add_subdirectory( gal )
  21. # Only for win32 cross compilation using MXE
  22. if( WIN32 AND MSYS )
  23. add_definitions( -DGLEW_STATIC )
  24. endif()
  25. # A shared library subsetted from common which restricts what can go into
  26. # a single_top link image. By not linking to common, we control what does
  27. # statically go into single_top link images. My current thinking is that only
  28. # wxWidgets should be a shared link from single top, everything else should be
  29. # statically bound into it. Otherwise you will have DSO loading probs. After it
  30. # sets the LIB PATHS however, we want the *.kiface modules to use shared linking.
  31. add_library( singletop STATIC EXCLUDE_FROM_ALL
  32. confirm.cpp
  33. eda_doc.cpp
  34. kiway.cpp
  35. kiway_holder.cpp
  36. )
  37. # A shared library used by multiple *.kiface files and one or two program
  38. # launchers. Object files can migrate into here over time, but only if they are
  39. # surely needed and certainly used from more than one place without recompilation.
  40. # Functions and data all need to use the #include <import_export.h> and be declared
  41. # as APIEXPORT
  42. set( LIB_KICAD_SRCS
  43. string_utils.cpp
  44. )
  45. if( future )
  46. add_library( lib_kicad SHARED
  47. )
  48. target_link_libraries( lib_kicad
  49. ${wxWidgets_LIBRARIES}
  50. )
  51. set_target_properties( lib_kicad PROPERTIES
  52. OUTPUT_NAME ki
  53. )
  54. install( TARGETS lib_kicad
  55. DESTINATION ${KICAD_BIN}
  56. COMPONENT binary
  57. )
  58. endif()
  59. # Build a single library for the thread pool that we can link around
  60. add_library( threadpool STATIC
  61. thread_pool.cpp
  62. )
  63. target_include_directories( threadpool PRIVATE
  64. $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
  65. )
  66. # The build version string defaults to the value in the KiCadVersion.cmake file.
  67. # If being built inside a git repository, the git tag and commit hash are used to create
  68. # a new version string instead. The user can supply an additional string to be appended
  69. # to the end inside the KICAD_VERSION_EXTRA variable
  70. set( KICAD_VERSION_EXTRA "" CACHE STRING
  71. "User defined configuration string to append to KiCad version." )
  72. # Generate version header file.
  73. add_custom_target(
  74. version_header ALL
  75. COMMAND ${CMAKE_COMMAND}
  76. -DKICAD_VERSION_EXTRA=${KICAD_VERSION_EXTRA}
  77. -DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
  78. -DTEXT_OUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.txt
  79. -DSRC_PATH=${PROJECT_SOURCE_DIR}
  80. -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
  81. -P ${CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
  82. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  83. BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h
  84. DEPENDS ${CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
  85. COMMENT "Generating version string header"
  86. )
  87. set( COMMON_ABOUT_DLG_SRCS
  88. dialog_about/AboutDialog_main.cpp
  89. dialog_about/dialog_about.cpp
  90. dialog_about/dialog_about_base.cpp
  91. )
  92. set( COMMON_DLG_SRCS
  93. dialogs/dialog_assign_netclass.cpp
  94. dialogs/dialog_assign_netclass_base.cpp
  95. dialogs/dialog_color_picker.cpp
  96. dialogs/dialog_color_picker_base.cpp
  97. dialogs/dialog_configure_paths.cpp
  98. dialogs/dialog_configure_paths_base.cpp
  99. dialogs/dialog_display_html_text_base.cpp
  100. dialogs/dialog_edit_library_tables.cpp
  101. dialogs/dialog_global_lib_table_config.cpp
  102. dialogs/dialog_global_lib_table_config_base.cpp
  103. dialogs/dialog_grid_settings.cpp
  104. dialogs/dialog_grid_settings_base.cpp
  105. dialogs/dialog_hotkey_list.cpp
  106. dialogs/dialog_HTML_reporter_base.cpp
  107. dialogs/dialog_locked_items_query.cpp
  108. dialogs/dialog_locked_items_query_base.cpp
  109. dialogs/dialog_migrate_settings.cpp
  110. dialogs/dialog_migrate_settings_base.cpp
  111. dialogs/dialog_page_settings_base.cpp
  112. dialogs/dialog_paste_special.cpp
  113. dialogs/dialog_paste_special_base.cpp
  114. dialogs/dialog_text_entry_base.cpp
  115. dialogs/dialog_page_settings.cpp
  116. dialogs/dialog_print_generic.cpp
  117. dialogs/dialog_print_generic_base.cpp
  118. dialogs/dialog_text_entry.cpp
  119. dialogs/dialog_unit_entry.cpp
  120. dialogs/dialog_unit_entry_base.cpp
  121. dialogs/eda_list_dialog.cpp
  122. dialogs/eda_list_dialog_base.cpp
  123. dialogs/eda_reorderable_list_dialog.cpp
  124. dialogs/eda_reorderable_list_dialog_base.cpp
  125. dialogs/eda_view_switcher.cpp
  126. dialogs/eda_view_switcher_base.cpp
  127. dialogs/html_message_box.cpp
  128. dialogs/panel_color_settings_base.cpp
  129. dialogs/panel_color_settings.cpp
  130. dialogs/panel_common_settings.cpp
  131. dialogs/panel_common_settings_base.cpp
  132. dialogs/panel_gal_display_options.cpp
  133. dialogs/panel_hotkeys_editor.cpp
  134. dialogs/panel_image_editor.cpp
  135. dialogs/panel_image_editor_base.cpp
  136. dialogs/panel_mouse_settings.cpp
  137. dialogs/panel_mouse_settings_base.cpp
  138. dialogs/panel_setup_netclasses.cpp
  139. dialogs/panel_setup_netclasses_base.cpp
  140. dialogs/panel_setup_severities.cpp
  141. dialogs/panel_text_variables.cpp
  142. dialogs/panel_text_variables_base.cpp
  143. )
  144. if( KICAD_USE_SENTRY )
  145. list( APPEND COMMON_DLG_SRCS
  146. dialogs/panel_data_collection.cpp
  147. dialogs/panel_data_collection_base.cpp )
  148. endif()
  149. set( COMMON_WIDGET_SRCS
  150. widgets/app_progress_dialog.cpp
  151. widgets/bitmap_button.cpp
  152. widgets/bitmap_toggle.cpp
  153. widgets/button_row_panel.cpp
  154. widgets/collapsible_pane.cpp
  155. widgets/color_swatch.cpp
  156. widgets/font_choice.cpp
  157. widgets/footprint_choice.cpp
  158. widgets/footprint_preview_widget.cpp
  159. widgets/footprint_select_widget.cpp
  160. widgets/gal_options_panel.cpp
  161. widgets/grid_bitmap_toggle.cpp
  162. widgets/grid_color_swatch_helpers.cpp
  163. widgets/grid_combobox.cpp
  164. widgets/grid_icon_text_helpers.cpp
  165. widgets/grid_text_button_helpers.cpp
  166. widgets/grid_text_helpers.cpp
  167. widgets/indicator_icon.cpp
  168. widgets/infobar.cpp
  169. widgets/layer_box_selector.cpp
  170. widgets/lib_tree.cpp
  171. widgets/mathplot.cpp
  172. widgets/msgpanel.cpp
  173. widgets/number_badge.cpp
  174. widgets/paged_dialog.cpp
  175. widgets/progress_reporter_base.cpp
  176. widgets/properties_panel.cpp
  177. widgets/search_pane.cpp
  178. widgets/search_pane_base.cpp
  179. widgets/search_pane_tab.cpp
  180. widgets/split_button.cpp
  181. widgets/stepped_slider.cpp
  182. widgets/text_ctrl_eval.cpp
  183. widgets/ui_common.cpp
  184. widgets/unit_binder.cpp
  185. widgets/widget_save_restore.cpp
  186. widgets/widget_hotkey_list.cpp
  187. widgets/wx_aui_art_providers.cpp
  188. widgets/wx_aui_utils.cpp
  189. widgets/wx_busy_indicator.cpp
  190. widgets/wx_combobox.cpp
  191. widgets/wx_ellipsized_static_text.cpp
  192. widgets/wx_grid.cpp
  193. widgets/wx_html_report_box.cpp
  194. widgets/wx_html_report_panel.cpp
  195. widgets/wx_html_report_panel_base.cpp
  196. widgets/wx_listbox.cpp
  197. widgets/wx_panel.cpp
  198. widgets/wx_progress_reporters.cpp
  199. widgets/wx_splitter_window.cpp
  200. )
  201. set( COMMON_DRAWING_SHEET_SRCS
  202. drawing_sheet/ds_data_item.cpp
  203. drawing_sheet/ds_data_model.cpp
  204. drawing_sheet/ds_data_model_io.cpp
  205. drawing_sheet/drawing_sheet_default_description.cpp
  206. drawing_sheet/ds_draw_item.cpp
  207. drawing_sheet/ds_proxy_undo_item.cpp
  208. drawing_sheet/ds_proxy_view_item.cpp
  209. drawing_sheet/drawing_sheet_parser.cpp
  210. )
  211. set( COMMON_PREVIEW_ITEMS_SRCS
  212. preview_items/arc_assistant.cpp
  213. preview_items/arc_geom_manager.cpp
  214. preview_items/centreline_rect_item.cpp
  215. preview_items/draw_context.cpp
  216. preview_items/polygon_geom_manager.cpp
  217. preview_items/polygon_item.cpp
  218. preview_items/preview_utils.cpp
  219. preview_items/ruler_item.cpp
  220. preview_items/selection_area.cpp
  221. preview_items/simple_overlay_item.cpp
  222. preview_items/two_point_assistant.cpp
  223. )
  224. set( PLOTTERS_CONTROL_SRCS
  225. plotters/plotter.cpp
  226. plotters/DXF_plotter.cpp
  227. plotters/GERBER_plotter.cpp
  228. plotters/HPGL_plotter.cpp
  229. plotters/PDF_plotter.cpp
  230. plotters/PS_plotter.cpp
  231. plotters/SVG_plotter.cpp
  232. plotters/common_plot_functions.cpp
  233. )
  234. set( PLUGINS_ALTIUM_SRCS
  235. plugins/altium/altium_parser.cpp
  236. plugins/altium/altium_parser_utils.cpp
  237. )
  238. set( PLUGINS_CADSTAR_SRCS
  239. plugins/cadstar/cadstar_archive_parser.cpp
  240. )
  241. set( PLUGINS_EAGLE_SRCS
  242. plugins/eagle/eagle_parser.cpp
  243. )
  244. set( FONT_SRCS
  245. font/font.cpp
  246. font/glyph.cpp
  247. font/stroke_font.cpp
  248. font/outline_font.cpp
  249. font/outline_decomposer.cpp
  250. font/fontconfig.cpp
  251. )
  252. set( COMMON_SRCS
  253. ${LIB_KICAD_SRCS}
  254. ${COMMON_ABOUT_DLG_SRCS}
  255. ${COMMON_DLG_SRCS}
  256. ${COMMON_WIDGET_SRCS}
  257. ${COMMON_DRAWING_SHEET_SRCS}
  258. ${COMMON_PREVIEW_ITEMS_SRCS}
  259. ${PLOTTERS_CONTROL_SRCS}
  260. ${PLUGINS_ALTIUM_SRCS}
  261. ${PLUGINS_CADSTAR_SRCS}
  262. ${PLUGINS_EAGLE_SRCS}
  263. ${FONT_SRCS}
  264. jobs/job_dispatcher.cpp
  265. advanced_config.cpp
  266. array_axis.cpp
  267. array_options.cpp
  268. asset_archive.cpp
  269. base_screen.cpp
  270. base64.cpp
  271. bin_mod.cpp
  272. bitmap.cpp
  273. bitmap_base.cpp
  274. bitmap_info.cpp
  275. bitmap_store.cpp
  276. board_printout.cpp
  277. build_version.cpp
  278. commit.cpp
  279. common.cpp
  280. config_params.cpp
  281. confirm.cpp
  282. dialog_shim.cpp
  283. gr_text.cpp
  284. dsnlexer.cpp
  285. eda_base_frame.cpp
  286. eda_dde.cpp
  287. eda_doc.cpp
  288. eda_draw_frame.cpp
  289. eda_item.cpp
  290. eda_pattern_match.cpp
  291. eda_shape.cpp
  292. eda_text.cpp
  293. eda_tools.cpp
  294. eda_units.cpp
  295. env_paths.cpp
  296. env_vars.cpp
  297. exceptions.cpp
  298. executable_names.cpp
  299. filename_resolver.cpp
  300. filehistory.cpp
  301. filter_reader.cpp
  302. footprint_filter.cpp
  303. footprint_info.cpp
  304. gbr_metadata.cpp
  305. gestfich.cpp
  306. getrunningmicrosecs.cpp
  307. gr_basic.cpp
  308. grid_tricks.cpp
  309. hotkey_store.cpp
  310. hotkeys_basic.cpp
  311. html_window.cpp
  312. kiface_base.cpp
  313. kiid.cpp
  314. kiway.cpp
  315. kiway_express.cpp
  316. kiway_holder.cpp
  317. kiway_player.cpp
  318. languages_menu.cpp
  319. launch_ext.cpp
  320. layer_id.cpp
  321. lib_id.cpp
  322. lib_table_base.cpp
  323. lib_table_grid_tricks.cpp
  324. lib_tree_model.cpp
  325. lib_tree_model_adapter.cpp
  326. locale_io.cpp
  327. lockfile.cpp
  328. lset.cpp
  329. marker_base.cpp
  330. markup_parser.cpp
  331. netclass.cpp
  332. observable.cpp
  333. origin_transforms.cpp
  334. page_info.cpp
  335. paths.cpp
  336. printout.cpp
  337. project.cpp
  338. properties.cpp
  339. ptree.cpp
  340. rc_item.cpp
  341. refdes_utils.cpp
  342. render_settings.cpp
  343. reporter.cpp
  344. richio.cpp
  345. scintilla_tricks.cpp
  346. search_stack.cpp
  347. searchhelpfilefullpath.cpp
  348. status_popup.cpp
  349. stroke_params.cpp
  350. systemdirsappend.cpp
  351. template_fieldnames.cpp
  352. textentry_tricks.cpp
  353. title_block.cpp
  354. trace_helpers.cpp
  355. transform.cpp
  356. undo_redo_container.cpp
  357. utf8.cpp
  358. validators.cpp
  359. wildcards_and_files_ext.cpp
  360. drawing_sheet/ds_painter.cpp
  361. wxdataviewctrl_helpers.cpp
  362. wx_stl_compat.cpp
  363. wx_filename.cpp
  364. xnode.cpp
  365. )
  366. if( TRUE OR NOT USE_KIWAY_DLLS )
  367. #if( NOT USE_KIWAY_DLLS )
  368. # We DO NOT want pgm_base.cpp linked into the KIFACE, only into the KIWAY.
  369. # Check the map files to verify eda_pgm.o not being linked in.
  370. list( APPEND COMMON_SRCS pgm_base.cpp )
  371. endif()
  372. if( NOT HAVE_STRTOKR )
  373. list( APPEND COMMON_SRCS strtok_r.c )
  374. endif()
  375. list( APPEND COMMON_SRCS
  376. kicad_curl/kicad_curl.cpp
  377. kicad_curl/kicad_curl_easy.cpp
  378. )
  379. set( COMMON_SRCS
  380. ${COMMON_SRCS}
  381. origin_viewitem.cpp
  382. view/view.cpp
  383. view/view_item.cpp
  384. view/view_group.cpp
  385. tool/action_manager.cpp
  386. tool/action_menu.cpp
  387. tool/action_toolbar.cpp
  388. tool/actions.cpp
  389. tool/common_control.cpp
  390. tool/common_tools.cpp
  391. tool/conditional_menu.cpp
  392. tool/edit_constraints.cpp
  393. tool/edit_points.cpp
  394. tool/editor_conditions.cpp
  395. tool/grid_helper.cpp
  396. tool/grid_menu.cpp
  397. tool/picker_tool.cpp
  398. tool/selection.cpp
  399. tool/selection_tool.cpp
  400. tool/selection_conditions.cpp
  401. tool/tool_action.cpp
  402. tool/tool_base.cpp
  403. tool/tool_dispatcher.cpp
  404. tool/tool_event.cpp
  405. tool/tools_holder.cpp
  406. tool/tool_interactive.cpp
  407. tool/tool_manager.cpp
  408. tool/tool_menu.cpp
  409. tool/zoom_menu.cpp
  410. tool/zoom_tool.cpp
  411. settings/app_settings.cpp
  412. settings/color_settings.cpp
  413. settings/cvpcb_settings.cpp
  414. settings/common_settings.cpp
  415. settings/json_settings.cpp
  416. settings/nested_settings.cpp
  417. settings/parameters.cpp
  418. settings/settings_manager.cpp
  419. settings/kicad_settings.cpp
  420. project/board_project_settings.cpp
  421. project/net_settings.cpp
  422. project/project_archiver.cpp
  423. project/project_file.cpp
  424. project/project_local_settings.cpp
  425. properties/eda_angle_variant.cpp
  426. properties/pg_editors.cpp
  427. properties/pg_properties.cpp
  428. properties/property_mgr.cpp
  429. database/database_connection.cpp
  430. database/database_lib_settings.cpp
  431. )
  432. add_library( common STATIC
  433. ${COMMON_SRCS}
  434. )
  435. add_dependencies( common version_header )
  436. add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
  437. target_link_libraries( common
  438. libcontext
  439. kimath
  440. kiplatform
  441. fmt::fmt
  442. gal
  443. scripting
  444. threadpool
  445. pybind11::embed
  446. compoundfilereader
  447. pcm_settings
  448. nanodbc # for now; maybe hoist out of common
  449. ${Boost_LIBRARIES}
  450. ${CURL_LIBRARIES}
  451. ${wxWidgets_LIBRARIES}
  452. ${EXTRA_LIBS}
  453. # outline font support
  454. ${FREETYPE_LIBRARIES}
  455. ${HarfBuzz_LIBRARIES}
  456. ${Fontconfig_LIBRARIES}
  457. )
  458. if( KICAD_USE_SENTRY )
  459. target_link_libraries( common
  460. sentry )
  461. endif()
  462. target_include_directories( common
  463. PUBLIC
  464. .
  465. ${CMAKE_BINARY_DIR}
  466. $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
  467. $<TARGET_PROPERTY:argparse::argparse,INTERFACE_INCLUDE_DIRECTORIES>
  468. )
  469. # text markup support
  470. add_dependencies( common pegtl )
  471. target_include_directories( common PUBLIC
  472. $<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
  473. )
  474. target_include_directories( common SYSTEM PUBLIC
  475. $<TARGET_PROPERTY:nanodbc,INTERFACE_INCLUDE_DIRECTORIES>
  476. )
  477. set( PCB_COMMON_SRCS
  478. fp_lib_table.cpp
  479. hash_eda.cpp
  480. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_base_frame.cpp
  481. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_expr_evaluator.cpp
  482. ${CMAKE_SOURCE_DIR}/pcbnew/board_commit.cpp
  483. ${CMAKE_SOURCE_DIR}/pcbnew/board_connected_item.cpp
  484. ${CMAKE_SOURCE_DIR}/pcbnew/board_design_settings.cpp
  485. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp #needed by board_design_settings.cpp
  486. ${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
  487. ${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
  488. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
  489. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
  490. ${CMAKE_SOURCE_DIR}/pcbnew/fp_shape.cpp
  491. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_group.cpp
  492. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_marker.cpp
  493. ${CMAKE_SOURCE_DIR}/pcbnew/footprint.cpp
  494. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
  495. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
  496. ${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
  497. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
  498. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_bitmap.cpp
  499. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
  500. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_textbox.cpp
  501. ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/board_stackup.cpp
  502. ${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp
  503. ${CMAKE_SOURCE_DIR}/pcbnew/fp_textbox.cpp
  504. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_track.cpp
  505. ${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp
  506. ${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp
  507. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_algo.cpp
  508. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_items.cpp
  509. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_data.cpp
  510. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/from_to_cache.cpp
  511. ${CMAKE_SOURCE_DIR}/pcbnew/convert_shape_list_to_polygon.cpp
  512. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_engine.cpp
  513. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_cache_generator.cpp
  514. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_item.cpp
  515. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule.cpp
  516. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_condition.cpp
  517. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_parser.cpp
  518. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_test_provider.cpp
  519. ${CMAKE_SOURCE_DIR}/pcbnew/plugins/eagle/eagle_plugin.cpp
  520. ${CMAKE_SOURCE_DIR}/pcbnew/footprint_editor_settings.cpp
  521. ${CMAKE_SOURCE_DIR}/pcbnew/plugins/geda/gpcb_plugin.cpp
  522. ${CMAKE_SOURCE_DIR}/pcbnew/io_mgr.cpp
  523. ${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp
  524. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
  525. ${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_plugin.cpp
  526. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
  527. ${CMAKE_SOURCE_DIR}/pcbnew/plugins/legacy/legacy_plugin.cpp
  528. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
  529. ${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
  530. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
  531. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
  532. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
  533. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp
  534. ${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_parser.cpp
  535. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp
  536. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_svg.cpp
  537. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp
  538. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp
  539. ${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp
  540. ${CMAKE_SOURCE_DIR}/pcbnew/plugin.cpp
  541. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_data.cpp
  542. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_view_item.cpp
  543. ${CMAKE_SOURCE_DIR}/pcbnew/sel_layer.cpp
  544. ${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
  545. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_grid_helper.cpp
  546. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_actions.cpp
  547. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
  548. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_viewer_tools.cpp
  549. widgets/net_selector.cpp
  550. )
  551. # add -DPCBNEW to compilation of these PCBNEW sources
  552. set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
  553. COMPILE_DEFINITIONS "PCBNEW"
  554. )
  555. add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
  556. target_include_directories( pcbcommon PRIVATE
  557. $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
  558. )
  559. target_link_libraries( pcbcommon PUBLIC
  560. common
  561. delaunator
  562. kimath
  563. kiplatform
  564. threadpool
  565. )
  566. if( KICAD_USE_3DCONNEXION )
  567. message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" )
  568. add_subdirectory( ../pcbnew/navlib ./navlib)
  569. target_link_libraries( pcbcommon PUBLIC pcbnew_navlib)
  570. endif()
  571. add_dependencies( pcbcommon delaunator )
  572. # The lemon grammar for the numeric evaluator
  573. generate_lemon_grammar(
  574. common
  575. libeval
  576. libeval/numeric_evaluator.cpp
  577. libeval/grammar.lemon
  578. )
  579. # The lemon grammar for the expression compiler
  580. generate_lemon_grammar(
  581. common
  582. libeval_compiler
  583. libeval_compiler/libeval_compiler.cpp
  584. libeval_compiler/grammar.lemon
  585. )
  586. # auto-generate stroke_params_lexer.h and stroke_params_keywords.cpp
  587. # Called twice one for common and one for gal, to ensure the files are created
  588. # on all devel tools ( Linux and msys2 )
  589. # works on Linux:
  590. make_lexer(
  591. common
  592. stroke_params.keywords
  593. stroke_params_lexer.h
  594. stroke_params_keywords.cpp
  595. STROKEPARAMS_T
  596. )
  597. # auto-generate netlist_lexer.h and netlist_keywords.cpp
  598. make_lexer(
  599. common
  600. netlist.keywords
  601. netlist_lexer.h
  602. netlist_keywords.cpp
  603. NL_T
  604. )
  605. # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
  606. make_lexer(
  607. pcbcommon
  608. pcb_plot_params.keywords
  609. pcb_plot_params_lexer.h
  610. pcb_plot_params_keywords.cpp
  611. PCBPLOTPARAMS_T
  612. )
  613. # auto-generate drc_rules_lexer.h and drc_rules_keywords.cpp
  614. make_lexer(
  615. common
  616. drc_rules.keywords
  617. drc_rules_lexer.h
  618. drc_rules_keywords.cpp
  619. DRCRULE_T
  620. )
  621. # auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
  622. make_lexer(
  623. pcbcommon
  624. pcb.keywords
  625. pcb_lexer.h
  626. pcb_keywords.cpp
  627. PCB_KEYS_T
  628. )
  629. # auto-generate s-expression library table code.
  630. make_lexer(
  631. common
  632. lib_table.keywords
  633. lib_table_lexer.h
  634. lib_table_keywords.cpp
  635. LIB_TABLE_T
  636. )
  637. # auto-generate s-expression template fieldnames lexer and keywords.
  638. make_lexer(
  639. common
  640. template_fieldnames.keywords
  641. template_fieldnames_lexer.h
  642. template_fieldnames_keywords.cpp
  643. TFIELD_T
  644. )
  645. # auto-generate page layout reader s-expression page_layout_reader_lexer.h
  646. # and title_block_reader_keywords.cpp.
  647. make_lexer(
  648. common
  649. drawing_sheet/drawing_sheet.keywords
  650. drawing_sheet/drawing_sheet_lexer.h
  651. drawing_sheet/drawing_sheet_keywords.cpp
  652. DRAWINGSHEET_T
  653. )
  654. # This one gets made only when testing.
  655. # to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
  656. add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
  657. target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )