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.

923 lines
26 KiB

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