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.

1018 lines
29 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
10 months 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
3 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. gal/opengl/gl_context_mgr.cpp
  55. # Jobs
  56. jobs/job.cpp
  57. jobs/job_dispatcher.cpp
  58. jobs/job_registry.cpp
  59. jobs/jobs_output_archive.cpp
  60. jobs/jobs_output_folder.cpp
  61. jobs/job_export_pcb_drill.cpp
  62. jobs/job_export_pcb_dxf.cpp
  63. jobs/job_export_pcb_gerber.cpp
  64. jobs/job_export_pcb_gerbers.cpp
  65. jobs/job_export_pcb_ipc2581.cpp
  66. jobs/job_export_pcb_ipcd356.cpp
  67. jobs/job_export_pcb_odb.cpp
  68. jobs/job_export_pcb_pdf.cpp
  69. jobs/job_export_pcb_plot.cpp
  70. jobs/job_export_pcb_pos.cpp
  71. jobs/job_export_pcb_svg.cpp
  72. jobs/job_export_pcb_gencad.cpp
  73. jobs/job_export_pcb_3d.cpp
  74. jobs/job_export_sch_bom.cpp
  75. jobs/job_export_sch_netlist.cpp
  76. jobs/job_export_sch_plot.cpp
  77. jobs/job_export_sch_pythonbom.cpp
  78. jobs/job_special_copyfiles.cpp
  79. jobs/job_special_execute.cpp
  80. jobs/jobset.cpp
  81. jobs/job_fp_export_svg.cpp
  82. jobs/job_fp_upgrade.cpp
  83. jobs/job_pcb_render.cpp
  84. jobs/job_pcb_drc.cpp
  85. jobs/job_rc.cpp
  86. jobs/job_sch_erc.cpp
  87. jobs/job_sym_export_svg.cpp
  88. jobs/job_sym_upgrade.cpp
  89. kicad_curl/kicad_curl.cpp
  90. kicad_curl/kicad_curl_easy.cpp
  91. settings/app_settings.cpp
  92. settings/aui_settings.cpp
  93. settings/bom_settings.cpp
  94. settings/color_settings.cpp
  95. settings/common_settings.cpp
  96. settings/grid_settings.cpp
  97. settings/json_settings.cpp
  98. settings/kicad_settings.cpp
  99. settings/layer_settings_utils.cpp
  100. settings/nested_settings.cpp
  101. settings/parameters.cpp
  102. settings/settings_manager.cpp
  103. project/board_project_settings.cpp
  104. project/component_class_settings.cpp
  105. project/net_settings.cpp
  106. project/project_archiver.cpp
  107. project/project_file.cpp
  108. project/project_local_settings.cpp
  109. # This is basically a settings object, but for the toolbar
  110. tool/ui/toolbar_configuration.cpp
  111. dialogs/dialog_migrate_settings.cpp
  112. dialogs/dialog_migrate_settings_base.cpp
  113. dialogs/dialog_rc_job.cpp
  114. dialogs/dialog_rc_job_base.cpp
  115. widgets/bitmap_button.cpp
  116. widgets/html_window.cpp
  117. widgets/kistatusbar.cpp
  118. widgets/number_badge.cpp
  119. widgets/progress_reporter_base.cpp
  120. widgets/std_bitmap_button.cpp
  121. widgets/ui_common.cpp
  122. widgets/wx_html_report_panel.cpp
  123. widgets/wx_html_report_panel_base.cpp
  124. database/database_lib_settings.cpp
  125. design_block_lib_table.cpp
  126. design_block_io.cpp
  127. design_block_info.cpp
  128. design_block_info_impl.cpp
  129. advanced_config.cpp
  130. asset_archive.cpp
  131. array_axis.cpp
  132. array_options.cpp
  133. background_jobs_monitor.cpp
  134. bitmap.cpp
  135. bitmap_info.cpp
  136. bitmap_store.cpp
  137. build_version.cpp
  138. cli_progress_reporter.cpp
  139. common.cpp
  140. config_params.cpp
  141. confirm.cpp
  142. dialog_shim.cpp
  143. dpi_scaling.cpp
  144. dpi_scaling_common.cpp
  145. dsnlexer.cpp
  146. eda_pattern_match.cpp
  147. eda_units.cpp
  148. env_vars.cpp
  149. exceptions.cpp
  150. gestfich.cpp
  151. increment.cpp
  152. json_conversions.cpp
  153. json_schema_validator.cpp
  154. kidialog.cpp
  155. kiid.cpp
  156. kiway.cpp
  157. kiway_express.cpp
  158. kiway_holder.cpp
  159. launch_ext.cpp
  160. lib_table_base.cpp
  161. layer_id.cpp
  162. lib_id.cpp
  163. locale_io.cpp
  164. lseq.cpp
  165. lset.cpp
  166. markup_parser.cpp
  167. netclass.cpp
  168. notifications_manager.cpp
  169. page_info.cpp
  170. paths.cpp
  171. project.cpp
  172. reporter.cpp
  173. richio.cpp
  174. search_stack.cpp
  175. searchhelpfilefullpath.cpp
  176. string_utils.cpp
  177. systemdirsappend.cpp
  178. thread_pool.cpp
  179. ui_events.cpp
  180. title_block.cpp
  181. trace_helpers.cpp
  182. wildcards_and_files_ext.cpp
  183. wx_filename.cpp
  184. singleton.cpp
  185. pgm_base.cpp
  186. ../scripting/python_scripting.cpp
  187. io/kicad/kicad_io_utils.cpp # needed by richio
  188. io/io_base.cpp
  189. io/io_utils.cpp
  190. api/serializable.cpp
  191. api/api_utils.cpp
  192. )
  193. if( KICAD_IPC_API )
  194. set( KICOMMON_SRCS
  195. ${KICOMMON_SRCS}
  196. api/api_handler.cpp
  197. api/api_plugin.cpp
  198. api/api_plugin_manager.cpp
  199. api/api_server.cpp
  200. ../scripting/python_manager.cpp
  201. )
  202. endif()
  203. add_library( kicommon SHARED
  204. ${KICOMMON_SRCS}
  205. )
  206. set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
  207. target_link_libraries( kicommon
  208. core
  209. kiapi
  210. kimath
  211. kiplatform
  212. nlohmann_json
  213. nlohmann_json_schema_validator
  214. fmt::fmt
  215. CURL::libcurl
  216. picosha2
  217. ${ZSTD_LIBRARY}
  218. ${wxWidgets_LIBRARIES}
  219. ${LIBGIT2_LIBRARIES}
  220. # needed by kiid to allow linking for Boost for the UUID against bcrypt (msys2 only)
  221. ${EXTRA_LIBS}
  222. # outline font support
  223. ${FREETYPE_LIBRARIES}
  224. ${HarfBuzz_LIBRARIES}
  225. ${Fontconfig_LIBRARIES}
  226. # needed because of python_scripting.cpp
  227. ${PYTHON_LIBRARIES}
  228. )
  229. if( KICAD_USE_SENTRY )
  230. target_link_libraries( kicommon
  231. sentry )
  232. set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
  233. endif()
  234. if( KICAD_IPC_API )
  235. target_link_libraries( kicommon
  236. kinng
  237. )
  238. endif()
  239. include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake )
  240. include( ${KICAD_CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
  241. create_git_version_header(${CMAKE_SOURCE_DIR})
  242. # Extract the major and minor build version as a string
  243. string( REGEX MATCH
  244. "([0-9]+)\\.([0-9]+)\\.([0-9]+)"
  245. KICAD_MAJOR_MINOR_PATCH_VERSION
  246. "${KICAD_VERSION}"
  247. )
  248. set_target_properties( kicommon PROPERTIES
  249. OUTPUT_NAME kicommon
  250. SOVERSION ${KICAD_MAJOR_MINOR_PATCH_VERSION}
  251. )
  252. install( TARGETS kicommon
  253. RUNTIME DESTINATION ${KICAD_LIB}
  254. LIBRARY DESTINATION ${KICAD_LIB}
  255. COMPONENT binary
  256. )
  257. if( APPLE )
  258. # puts library into the main kicad.app bundle in build tree
  259. set_target_properties( kicommon PROPERTIES
  260. LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}"
  261. INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}"
  262. )
  263. set_target_properties( kicommon PROPERTIES INSTALL_RPATH
  264. "@executable_path/../Frameworks" )
  265. set_target_properties( kicommon PROPERTIES BUILD_WITH_INSTALL_RPATH 1 )
  266. endif()
  267. target_compile_definitions( kicommon PRIVATE KICOMMON_DLL=1 )
  268. target_include_directories( kicommon
  269. PUBLIC
  270. .
  271. ${CMAKE_BINARY_DIR}
  272. $<TARGET_PROPERTY:dynamic_bitset,INTERFACE_INCLUDE_DIRECTORIES>
  273. $<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
  274. $<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
  275. $<TARGET_PROPERTY:expected,INTERFACE_INCLUDE_DIRECTORIES>
  276. $<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
  277. $<TARGET_PROPERTY:picosha2,INTERFACE_INCLUDE_DIRECTORIES>
  278. $<TARGET_PROPERTY:nlohmann_json_schema_validator,INTERFACE_INCLUDE_DIRECTORIES>
  279. $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
  280. )
  281. add_dependencies( kicommon pegtl version_header )
  282. if( MSVC )
  283. target_sources( kicommon PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/kicommon-dll.rc )
  284. endif()
  285. set( COMMON_ABOUT_DLG_SRCS
  286. dialog_about/AboutDialog_main.cpp
  287. dialog_about/dialog_about.cpp
  288. dialog_about/dialog_about_base.cpp
  289. )
  290. set( COMMON_GIT_DLG_SRCS
  291. dialogs/git/dialog_git_commit.cpp
  292. dialogs/git/dialog_git_switch.cpp
  293. dialogs/git/dialog_git_auth.cpp
  294. dialogs/git/dialog_git_repository.cpp
  295. dialogs/git/dialog_git_repository_base.cpp
  296. dialogs/git/panel_git_repos.cpp
  297. dialogs/git/panel_git_repos_base.cpp
  298. )
  299. set( COMMON_DLG_SRCS
  300. ${COMMON_GIT_DLG_SRCS}
  301. dialogs/dialog_assign_netclass.cpp
  302. dialogs/dialog_assign_netclass_base.cpp
  303. dialogs/dialog_book_reporter.cpp
  304. dialogs/dialog_book_reporter_base.cpp
  305. dialogs/dialog_color_picker.cpp
  306. dialogs/dialog_color_picker_base.cpp
  307. dialogs/dialog_configure_paths.cpp
  308. dialogs/dialog_configure_paths_base.cpp
  309. dialogs/dialog_design_block_properties.cpp
  310. dialogs/dialog_design_block_properties_base.cpp
  311. dialogs/dialog_display_html_text_base.cpp
  312. dialogs/dialog_edit_library_tables.cpp
  313. dialogs/dialog_embed_files.cpp
  314. dialogs/dialog_global_lib_table_config.cpp
  315. dialogs/dialog_global_lib_table_config_base.cpp
  316. dialogs/dialog_global_design_block_lib_table_config.cpp
  317. dialogs/dialog_grid_settings.cpp
  318. dialogs/dialog_grid_settings_base.cpp
  319. dialogs/dialog_hotkey_list.cpp
  320. dialogs/dialog_HTML_reporter_base.cpp
  321. dialogs/dialog_import_choose_project.cpp
  322. dialogs/dialog_import_choose_project_base.cpp
  323. dialogs/dialog_locked_items_query.cpp
  324. dialogs/dialog_locked_items_query_base.cpp
  325. dialogs/dialog_multi_unit_entry.cpp
  326. dialogs/dialog_page_settings_base.cpp
  327. dialogs/dialog_paste_special.cpp
  328. dialogs/dialog_paste_special_base.cpp
  329. dialogs/dialog_plugin_options.cpp
  330. dialogs/dialog_plugin_options_base.cpp
  331. dialogs/dialog_text_entry_base.cpp
  332. dialogs/dialog_page_settings.cpp
  333. dialogs/dialog_print_generic.cpp
  334. dialogs/dialog_print_generic_base.cpp
  335. dialogs/dialog_text_entry.cpp
  336. dialogs/dialog_unit_entry.cpp
  337. dialogs/dialog_unit_entry_base.cpp
  338. dialogs/eda_list_dialog.cpp
  339. dialogs/eda_list_dialog_base.cpp
  340. dialogs/eda_reorderable_list_dialog.cpp
  341. dialogs/eda_reorderable_list_dialog_base.cpp
  342. dialogs/eda_view_switcher.cpp
  343. dialogs/eda_view_switcher_base.cpp
  344. dialogs/hotkey_cycle_popup.cpp
  345. dialogs/html_message_box.cpp
  346. dialogs/panel_color_settings_base.cpp
  347. dialogs/panel_color_settings.cpp
  348. dialogs/panel_common_settings.cpp
  349. dialogs/panel_common_settings_base.cpp
  350. dialogs/panel_design_block_lib_table_base.cpp
  351. dialogs/panel_design_block_lib_table.cpp
  352. dialogs/panel_embedded_files.cpp
  353. dialogs/panel_embedded_files_base.cpp
  354. dialogs/panel_gal_display_options.cpp
  355. dialogs/panel_hotkeys_editor.cpp
  356. dialogs/panel_image_editor.cpp
  357. dialogs/panel_image_editor_base.cpp
  358. dialogs/panel_grid_settings.cpp
  359. dialogs/panel_grid_settings_base.cpp
  360. dialogs/panel_mouse_settings.cpp
  361. dialogs/panel_mouse_settings_base.cpp
  362. dialogs/panel_packages_and_updates.cpp
  363. dialogs/panel_packages_and_updates_base.cpp
  364. dialogs/panel_plugin_settings.cpp
  365. dialogs/panel_plugin_settings_base.cpp
  366. dialogs/panel_setup_netclasses.cpp
  367. dialogs/panel_printer_list.cpp
  368. dialogs/panel_printer_list_base.cpp
  369. dialogs/panel_setup_netclasses_base.cpp
  370. dialogs/panel_setup_severities.cpp
  371. dialogs/panel_text_variables.cpp
  372. dialogs/panel_text_variables_base.cpp
  373. dialogs/panel_toolbar_customization.cpp
  374. dialogs/panel_toolbar_customization_base.cpp
  375. )
  376. if( KICAD_USE_SENTRY )
  377. list( APPEND COMMON_DLG_SRCS
  378. dialogs/panel_data_collection.cpp
  379. dialogs/panel_data_collection_base.cpp )
  380. endif()
  381. set( COMMON_WIDGET_SRCS
  382. widgets/app_progress_dialog.cpp
  383. widgets/bitmap_toggle.cpp
  384. widgets/button_row_panel.cpp
  385. widgets/color_swatch.cpp
  386. widgets/design_block_pane.cpp
  387. widgets/filter_combobox.cpp
  388. widgets/font_choice.cpp
  389. widgets/footprint_choice.cpp
  390. widgets/footprint_diff_widget.cpp
  391. widgets/footprint_preview_widget.cpp
  392. widgets/footprint_select_widget.cpp
  393. widgets/gal_options_panel.cpp
  394. widgets/gal_options_panel_base.cpp
  395. widgets/grid_bitmap_toggle.cpp
  396. widgets/grid_button.cpp
  397. widgets/grid_checkbox.cpp
  398. widgets/grid_color_swatch_helpers.cpp
  399. widgets/grid_combobox.cpp
  400. widgets/grid_icon_text_helpers.cpp
  401. widgets/grid_text_button_helpers.cpp
  402. widgets/grid_text_helpers.cpp
  403. widgets/indicator_icon.cpp
  404. widgets/wx_infobar.cpp
  405. widgets/layer_box_selector.cpp
  406. widgets/layer_presentation.cpp
  407. widgets/lib_tree.cpp
  408. widgets/listbox_tricks.cpp
  409. widgets/mathplot.cpp
  410. widgets/msgpanel.cpp
  411. widgets/paged_dialog.cpp
  412. widgets/panel_design_block_chooser.cpp
  413. widgets/properties_panel.cpp
  414. widgets/search_pane.cpp
  415. widgets/search_pane_base.cpp
  416. widgets/search_pane_tab.cpp
  417. widgets/split_button.cpp
  418. widgets/stepped_slider.cpp
  419. widgets/text_ctrl_eval.cpp
  420. widgets/unit_binder.cpp
  421. widgets/widget_save_restore.cpp
  422. widgets/widget_hotkey_list.cpp
  423. widgets/wx_aui_art_providers.cpp
  424. widgets/wx_aui_utils.cpp
  425. widgets/wx_busy_indicator.cpp
  426. widgets/wx_collapsible_pane.cpp
  427. widgets/wx_combobox.cpp
  428. widgets/wx_dataviewctrl.cpp
  429. widgets/wx_ellipsized_static_text.cpp
  430. widgets/wx_grid.cpp
  431. widgets/wx_grid_autosizer.cpp
  432. widgets/wx_html_report_box.cpp
  433. widgets/wx_listbox.cpp
  434. widgets/wx_panel.cpp
  435. widgets/wx_progress_reporters.cpp
  436. widgets/wx_splitter_window.cpp
  437. widgets/wx_treebook.cpp
  438. )
  439. set( COMMON_DRAWING_SHEET_SRCS
  440. drawing_sheet/ds_data_item.cpp
  441. drawing_sheet/ds_data_model.cpp
  442. drawing_sheet/ds_data_model_io.cpp
  443. drawing_sheet/drawing_sheet_default_description.cpp
  444. drawing_sheet/ds_draw_item.cpp
  445. drawing_sheet/ds_proxy_undo_item.cpp
  446. drawing_sheet/ds_proxy_view_item.cpp
  447. drawing_sheet/drawing_sheet_parser.cpp
  448. )
  449. set( COMMON_PREVIEW_ITEMS_SRCS
  450. preview_items/anchor_debug.cpp
  451. preview_items/arc_assistant.cpp
  452. preview_items/arc_geom_manager.cpp
  453. preview_items/bezier_assistant.cpp
  454. preview_items/bezier_geom_manager.cpp
  455. preview_items/centreline_rect_item.cpp
  456. preview_items/construction_geom.cpp
  457. preview_items/draw_context.cpp
  458. preview_items/item_drawing_utils.cpp
  459. preview_items/polygon_geom_manager.cpp
  460. preview_items/polygon_item.cpp
  461. preview_items/preview_utils.cpp
  462. preview_items/ruler_item.cpp
  463. preview_items/selection_area.cpp
  464. preview_items/simple_overlay_item.cpp
  465. preview_items/snap_indicator.cpp
  466. preview_items/two_point_assistant.cpp
  467. )
  468. set( PLOTTERS_CONTROL_SRCS
  469. plotters/plotter.cpp
  470. plotters/DXF_plotter.cpp
  471. plotters/GERBER_plotter.cpp
  472. plotters/HPGL_plotter.cpp
  473. plotters/PDF_plotter.cpp
  474. plotters/PS_plotter.cpp
  475. plotters/SVG_plotter.cpp
  476. plotters/common_plot_functions.cpp
  477. )
  478. set( COMMON_IO_SRCS
  479. # Altium
  480. io/altium/altium_binary_parser.cpp
  481. io/altium/altium_ascii_parser.cpp
  482. io/altium/altium_parser_utils.cpp
  483. io/altium/altium_props_utils.cpp
  484. # Cadstar
  485. io/cadstar/cadstar_archive_parser.cpp
  486. io/cadstar/cadstar_parts_lib_parser.cpp
  487. # Eagle
  488. io/eagle/eagle_parser.cpp
  489. # EasyEDA
  490. io/easyeda/easyeda_parser_base.cpp
  491. io/easyeda/easyeda_parser_structs.cpp
  492. # EasyEDA pro
  493. io/easyedapro/easyedapro_parser.cpp
  494. io/easyedapro/easyedapro_import_utils.cpp
  495. )
  496. set( COMMON_IMPORT_GFX_SRCS
  497. import_gfx/graphics_import_mgr.cpp
  498. import_gfx/graphics_importer.cpp
  499. import_gfx/graphics_importer_buffer.cpp
  500. import_gfx/dxf_import_plugin.cpp
  501. import_gfx/svg_import_plugin.cpp
  502. )
  503. set( COMMON_GIT_SRCS
  504. git/git_add_to_index_handler.cpp
  505. git/git_clone_handler.cpp
  506. git/git_commit_handler.cpp
  507. git/git_pull_handler.cpp
  508. git/git_push_handler.cpp
  509. git/git_remove_from_index_handler.cpp
  510. git/git_resolve_conflict_handler.cpp
  511. git/git_revert_handler.cpp
  512. git/git_sync_handler.cpp
  513. git/kicad_git_common.cpp
  514. git/kicad_git_errors.cpp
  515. )
  516. set( COMMON_SRCS
  517. ${LIB_KICAD_SRCS}
  518. ${COMMON_ABOUT_DLG_SRCS}
  519. ${COMMON_DLG_SRCS}
  520. ${COMMON_WIDGET_SRCS}
  521. ${COMMON_DRAWING_SHEET_SRCS}
  522. ${COMMON_PREVIEW_ITEMS_SRCS}
  523. ${PLOTTERS_CONTROL_SRCS}
  524. ${COMMON_IO_SRCS}
  525. ${FONT_SRCS}
  526. ${COMMON_IMPORT_GFX_SRCS}
  527. ${COMMON_GIT_SRCS}
  528. base_screen.cpp
  529. bin_mod.cpp
  530. bitmap_base.cpp
  531. board_printout.cpp
  532. clipboard.cpp
  533. commit.cpp
  534. draw_panel_gal.cpp
  535. gal_display_options_common.cpp
  536. gr_text.cpp
  537. eda_base_frame.cpp
  538. eda_dde.cpp
  539. eda_doc.cpp
  540. eda_draw_frame.cpp
  541. eda_item.cpp
  542. eda_shape.cpp
  543. eda_text.cpp
  544. embedded_files.cpp
  545. env_paths.cpp
  546. executable_names.cpp
  547. filename_resolver.cpp
  548. file_history.cpp
  549. filter_reader.cpp
  550. footprint_filter.cpp
  551. footprint_info.cpp
  552. gbr_metadata.cpp
  553. gr_basic.cpp
  554. grid_tricks.cpp
  555. hotkey_store.cpp
  556. hotkeys_basic.cpp
  557. kiface_base.cpp
  558. kiway_player.cpp
  559. lib_table_grid_tricks.cpp
  560. lib_tree_model.cpp
  561. lib_tree_model_adapter.cpp
  562. design_block_tree_model_adapter.cpp
  563. marker_base.cpp
  564. origin_transforms.cpp
  565. printout.cpp
  566. ptree.cpp
  567. rc_item.cpp
  568. refdes_utils.cpp
  569. reference_image.cpp
  570. render_settings.cpp
  571. scintilla_tricks.cpp
  572. status_popup.cpp
  573. stroke_params.cpp
  574. template_fieldnames.cpp
  575. textentry_tricks.cpp
  576. undo_redo_container.cpp
  577. validators.cpp
  578. drawing_sheet/ds_painter.cpp
  579. xnode.cpp
  580. view/wx_view_controls.cpp
  581. )
  582. set( COMMON_SRCS
  583. ${COMMON_SRCS}
  584. origin_viewitem.cpp
  585. tool/action_manager.cpp
  586. tool/action_menu.cpp
  587. tool/action_toolbar.cpp
  588. tool/actions.cpp
  589. tool/common_control.cpp
  590. tool/construction_manager.cpp
  591. tool/common_tools.cpp
  592. tool/conditional_menu.cpp
  593. tool/design_block_control.cpp
  594. tool/edit_constraints.cpp
  595. tool/edit_points.cpp
  596. tool/editor_conditions.cpp
  597. tool/embed_tool.cpp
  598. tool/grid_helper.cpp
  599. tool/grid_menu.cpp
  600. tool/library_editor_control.cpp
  601. tool/picker_tool.cpp
  602. tool/point_editor_behavior.cpp
  603. tool/properties_tool.cpp
  604. tool/selection.cpp
  605. tool/selection_tool.cpp
  606. tool/selection_conditions.cpp
  607. tool/tool_action.cpp
  608. tool/tool_base.cpp
  609. tool/tool_dispatcher.cpp
  610. tool/tool_event.cpp
  611. tool/tools_holder.cpp
  612. tool/tool_interactive.cpp
  613. tool/tool_manager.cpp
  614. tool/tool_menu.cpp
  615. tool/zoom_menu.cpp
  616. tool/zoom_tool.cpp
  617. settings/cvpcb_settings.cpp
  618. properties/color4d_variant.cpp
  619. properties/eda_angle_variant.cpp
  620. properties/pg_cell_renderer.cpp
  621. properties/pg_editors.cpp
  622. properties/pg_properties.cpp
  623. properties/property_mgr.cpp
  624. properties/std_optional_variants.cpp
  625. database/database_connection.cpp
  626. http_lib/http_lib_connection.cpp
  627. http_lib/http_lib_settings.cpp
  628. api/api_enums.cpp
  629. )
  630. if( KICAD_IPC_API )
  631. set( COMMON_SRCS
  632. ${COMMON_SRCS}
  633. api/api_handler_common.cpp
  634. api/api_handler_editor.cpp
  635. )
  636. endif()
  637. add_library( common STATIC
  638. ${COMMON_SRCS}
  639. )
  640. add_dependencies( common version_header )
  641. add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
  642. target_link_libraries( common
  643. libcontext
  644. kimath
  645. kiplatform
  646. kicommon
  647. core
  648. fmt::fmt
  649. gal
  650. nanosvg
  651. dxflib_qcad
  652. tinyspline_lib
  653. scripting
  654. nlohmann_json
  655. pybind11::embed
  656. compoundfilereader
  657. Boost::headers
  658. # Database support needs these two
  659. nanodbc # for now; maybe hoist out of common
  660. Boost::locale
  661. ${wxWidgets_LIBRARIES}
  662. ${EXTRA_LIBS}
  663. # outline font support
  664. ${FREETYPE_LIBRARIES}
  665. ${HarfBuzz_LIBRARIES}
  666. ${Fontconfig_LIBRARIES}
  667. )
  668. if( KICAD_USE_SENTRY )
  669. target_link_libraries( common
  670. sentry )
  671. endif()
  672. if( KICAD_IPC_API )
  673. target_link_libraries( common
  674. kinng
  675. )
  676. endif()
  677. target_include_directories( common
  678. PUBLIC
  679. .
  680. ${CMAKE_BINARY_DIR}
  681. $<TARGET_PROPERTY:argparse::argparse,INTERFACE_INCLUDE_DIRECTORIES>
  682. $<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
  683. )
  684. # text markup support
  685. add_dependencies( common pegtl )
  686. target_include_directories( common PUBLIC
  687. $<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
  688. $<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
  689. )
  690. target_include_directories( common SYSTEM PUBLIC
  691. $<TARGET_PROPERTY:nanodbc,INTERFACE_INCLUDE_DIRECTORIES>
  692. )
  693. set( PCB_COMMON_SRCS
  694. fp_lib_table.cpp
  695. hash_eda.cpp
  696. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_base_frame.cpp
  697. ${CMAKE_SOURCE_DIR}/pcbnew/pcbexpr_evaluator.cpp
  698. ${CMAKE_SOURCE_DIR}/pcbnew/pcbexpr_functions.cpp
  699. ${CMAKE_SOURCE_DIR}/pcbnew/board_commit.cpp
  700. ${CMAKE_SOURCE_DIR}/pcbnew/board_connected_item.cpp
  701. ${CMAKE_SOURCE_DIR}/pcbnew/board_design_settings.cpp
  702. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp #needed by board_design_settings.cpp
  703. ${CMAKE_SOURCE_DIR}/pcbnew/router/pns_meander.cpp #needed by board_design_settings.cpp
  704. ${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
  705. ${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class.cpp
  706. ${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_assignment_rule.cpp
  707. ${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_cache_proxy.cpp
  708. ${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_manager.cpp
  709. ${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
  710. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
  711. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
  712. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_group.cpp
  713. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_marker.cpp
  714. ${CMAKE_SOURCE_DIR}/pcbnew/footprint.cpp
  715. ${CMAKE_SOURCE_DIR}/pcbnew/fix_board_shape.cpp
  716. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
  717. ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
  718. ${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
  719. ${CMAKE_SOURCE_DIR}/pcbnew/pad_utils.cpp
  720. ${CMAKE_SOURCE_DIR}/pcbnew/padstack.cpp
  721. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
  722. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_reference_image.cpp
  723. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_field.cpp
  724. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_table.cpp
  725. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_tablecell.cpp
  726. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
  727. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_textbox.cpp
  728. ${CMAKE_SOURCE_DIR}/pcbnew/project_pcb.cpp
  729. ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/board_stackup.cpp
  730. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_track.cpp
  731. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_generator.cpp
  732. ${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp
  733. ${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp
  734. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_algo.cpp
  735. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_items.cpp
  736. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_data.cpp
  737. ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/from_to_cache.cpp
  738. ${CMAKE_SOURCE_DIR}/pcbnew/convert_shape_list_to_polygon.cpp
  739. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_engine.cpp
  740. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_cache_generator.cpp
  741. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_item.cpp
  742. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule.cpp
  743. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_condition.cpp
  744. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_parser.cpp
  745. ${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_test_provider.cpp
  746. ${CMAKE_SOURCE_DIR}/pcbnew/footprint_editor_settings.cpp
  747. ${CMAKE_SOURCE_DIR}/pcbnew/generators_mgr.cpp
  748. ${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp
  749. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
  750. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
  751. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
  752. ${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
  753. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
  754. ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
  755. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
  756. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp
  757. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp
  758. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp
  759. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp
  760. ${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp
  761. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_data.cpp
  762. ${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_view_item.cpp
  763. ${CMAKE_SOURCE_DIR}/pcbnew/sel_layer.cpp
  764. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop.cpp
  765. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp
  766. ${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
  767. ${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
  768. # IO files
  769. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
  770. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io_mgr.cpp
  771. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp
  772. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp
  773. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp
  774. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp
  775. ${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/geda/pcb_io_geda.cpp
  776. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_grid_helper.cpp
  777. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_actions.cpp
  778. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
  779. ${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_viewer_tools.cpp
  780. ${CMAKE_SOURCE_DIR}/pcbnew/length_calculation.cpp
  781. widgets/net_selector.cpp
  782. )
  783. set( PCB_COMMON_SRCS
  784. ${PCB_COMMON_SRCS}
  785. ${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_enums.cpp
  786. ${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_utils.cpp
  787. )
  788. # add -DPCBNEW to compilation of these PCBNEW sources
  789. set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
  790. COMPILE_DEFINITIONS "PCBNEW"
  791. )
  792. add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
  793. target_include_directories( pcbcommon PRIVATE
  794. )
  795. target_link_libraries( pcbcommon PUBLIC
  796. core
  797. common
  798. delaunator
  799. kimath
  800. kiplatform
  801. )
  802. message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" )
  803. add_subdirectory( ../pcbnew/navlib ./navlib)
  804. target_link_libraries( pcbcommon PUBLIC pcbnew_navlib)
  805. add_dependencies( pcbcommon delaunator )
  806. # The lemon grammar for the numeric evaluator
  807. generate_lemon_grammar(
  808. kicommon
  809. libeval
  810. libeval/numeric_evaluator.cpp
  811. libeval/grammar.lemon
  812. )
  813. # The lemon grammar for the expression compiler
  814. generate_lemon_grammar(
  815. kicommon
  816. libeval_compiler
  817. libeval_compiler/libeval_compiler.cpp
  818. libeval_compiler/grammar.lemon
  819. )
  820. # auto-generate stroke_params_lexer.h and stroke_params_keywords.cpp
  821. # Called twice one for common and one for gal, to ensure the files are created
  822. # on all devel tools ( Linux and msys2 )
  823. # works on Linux:
  824. make_lexer_export(
  825. kicommon
  826. stroke_params.keywords
  827. stroke_params_lexer.h
  828. stroke_params_keywords.cpp
  829. STROKEPARAMS_T
  830. KICOMMON_API
  831. kicommon.h
  832. )
  833. # auto-generate netlist_lexer.h and netlist_keywords.cpp
  834. make_lexer_export(
  835. kicommon
  836. netlist.keywords
  837. netlist_lexer.h
  838. netlist_keywords.cpp
  839. NL_T
  840. KICOMMON_API
  841. kicommon.h
  842. )
  843. # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
  844. make_lexer(
  845. pcbcommon
  846. pcb_plot_params.keywords
  847. pcb_plot_params_lexer.h
  848. pcb_plot_params_keywords.cpp
  849. PCBPLOTPARAMS_T
  850. )
  851. # auto-generate drc_rules_lexer.h and drc_rules_keywords.cpp
  852. make_lexer_export(
  853. kicommon
  854. drc_rules.keywords
  855. drc_rules_lexer.h
  856. drc_rules_keywords.cpp
  857. DRCRULE_T
  858. KICOMMON_API
  859. kicommon.h
  860. )
  861. # auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
  862. make_lexer(
  863. pcbcommon
  864. pcb.keywords
  865. pcb_lexer.h
  866. pcb_keywords.cpp
  867. PCB_KEYS_T
  868. )
  869. # auto-generate s-expression library table code.
  870. make_lexer_export(
  871. kicommon
  872. lib_table.keywords
  873. lib_table_lexer.h
  874. lib_table_keywords.cpp
  875. LIB_TABLE_T
  876. KICOMMON_API
  877. kicommon.h
  878. )
  879. # auto-generate s-expression template fieldnames lexer and keywords.
  880. make_lexer_export(
  881. kicommon
  882. template_fieldnames.keywords
  883. template_fieldnames_lexer.h
  884. template_fieldnames_keywords.cpp
  885. TFIELD_T
  886. KICOMMON_API
  887. kicommon.h
  888. )
  889. # auto-generate page layout reader s-expression page_layout_reader_lexer.h
  890. # and title_block_reader_keywords.cpp.
  891. make_lexer_export(
  892. kicommon
  893. drawing_sheet/drawing_sheet.keywords
  894. drawing_sheet/drawing_sheet_lexer.h
  895. drawing_sheet/drawing_sheet_keywords.cpp
  896. DRAWINGSHEET_T
  897. KICOMMON_API
  898. kicommon.h
  899. )
  900. # auto-generate embedded files lexer and keywords
  901. make_lexer_export(
  902. kicommon
  903. embedded_files.keywords
  904. embedded_files_lexer.h
  905. embedded_files_keywords.cpp
  906. EMBEDDED_FILES_T
  907. KICOMMON_API
  908. kicommon.h
  909. )
  910. # This one gets made only when testing.
  911. # to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
  912. add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
  913. target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )