diff --git a/3d-viewer/3d_cache/sg/CMakeLists.txt b/3d-viewer/3d_cache/sg/CMakeLists.txt index 6a3ff2f395..0899a1925b 100644 --- a/3d-viewer/3d_cache/sg/CMakeLists.txt +++ b/3d-viewer/3d_cache/sg/CMakeLists.txt @@ -104,3 +104,8 @@ install( TARGETS LIBRARY DESTINATION ${KICAD_LIB} COMPONENT binary ) + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index d4429d2636..1e5aacfc03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,11 @@ option( KICAD_GAL_PROFILE "Enable profiling info for GAL" OFF ) +cmake_dependent_option( KICAD_WIN32_INSTALL_PDBS + "Installs debug pdb to the bin folder, NOT REQUIRED FOR DEBUGGING THE SOURCE ON MSVC. This is purely for release building." + OFF "WIN32" + OFF ) + # Global setting: exports are explicit set( CMAKE_CXX_VISIBILITY_PRESET "hidden" ) set( CMAKE_VISIBILITY_INLINES_HIDDEN ON ) diff --git a/bitmap2component/CMakeLists.txt b/bitmap2component/CMakeLists.txt index 5fa78f492c..f7c90663f4 100644 --- a/bitmap2component/CMakeLists.txt +++ b/bitmap2component/CMakeLists.txt @@ -85,6 +85,10 @@ else() ) endif() +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() if( false ) # linker map with cross reference set_target_properties( bitmap2component PROPERTIES diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index ce7ef26ab8..dff14ed334 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -107,3 +107,8 @@ else() COMPONENT binary ) endif() + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() \ No newline at end of file diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 19b3e4ef29..00fcd8aae6 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -494,6 +494,13 @@ else() ) endif() + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() + # auto-generate cmp_library_lexer.h and cmp_library_keywords.cpp for the component # library format. make_lexer( diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index c653a856ee..ae257e001d 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -211,3 +211,10 @@ else() COMPONENT binary ) endif() + + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() \ No newline at end of file diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index b38c195a91..c0e7884236 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -95,11 +95,17 @@ install( TARGETS kicad DESTINATION ${KICAD_BIN} COMPONENT binary ) + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() + if( APPLE ) # "install( CODE ... )" will launch its own CMake, so no variables from # this CMake instance are accessible... use helper to transfer set( SCRIPTING_HELPER "1" ) - + if( KICAD_SPICE ) set( SPICE_HELPER "1" ) else() diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index af18c0b469..af20a0f967 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -166,3 +166,9 @@ else() COMPONENT binary ) endif() + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() \ No newline at end of file diff --git a/pcb_calculator/CMakeLists.txt b/pcb_calculator/CMakeLists.txt index 264ed1b7e0..a649a77315 100644 --- a/pcb_calculator/CMakeLists.txt +++ b/pcb_calculator/CMakeLists.txt @@ -143,6 +143,12 @@ else() ) endif() +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() + # auto-generate pcb_calculator_datafile.h and pcb_calculator_datafile_keywords.cpp # for the storage data file format. make_lexer( diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 814cd2e053..db17479910 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -766,6 +766,11 @@ else() ) endif() +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() if( NOT APPLE ) install( FILES ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py DESTINATION ${PYTHON_DEST} ) diff --git a/plugins/3d/idf/CMakeLists.txt b/plugins/3d/idf/CMakeLists.txt index d9f11c0919..7bcc7656dd 100644 --- a/plugins/3d/idf/CMakeLists.txt +++ b/plugins/3d/idf/CMakeLists.txt @@ -41,3 +41,8 @@ install( TARGETS DESTINATION ${KICAD_USER_PLUGIN}/3d COMPONENT binary ) + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_USER_PLUGIN}/3d) +endif() \ No newline at end of file diff --git a/plugins/3d/oce/CMakeLists.txt b/plugins/3d/oce/CMakeLists.txt index 73a7244aaa..074df30a67 100644 --- a/plugins/3d/oce/CMakeLists.txt +++ b/plugins/3d/oce/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries( s3d_plugin_oce kicad_3dsg ${OCC_LIBRARIES} ${wxWidgets_LI target_include_directories( s3d_plugin_oce PRIVATE $ ) - + if( APPLE ) # puts library into the main kicad.app bundle in build tree set_target_properties( s3d_plugin_oce PROPERTIES @@ -35,3 +35,8 @@ install( TARGETS DESTINATION ${KICAD_USER_PLUGIN}/3d COMPONENT binary ) + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_USER_PLUGIN}/3d) +endif() \ No newline at end of file diff --git a/plugins/3d/vrml/CMakeLists.txt b/plugins/3d/vrml/CMakeLists.txt index b8bd160730..b651598842 100644 --- a/plugins/3d/vrml/CMakeLists.txt +++ b/plugins/3d/vrml/CMakeLists.txt @@ -83,3 +83,8 @@ install( TARGETS DESTINATION ${KICAD_USER_PLUGIN}/3d COMPONENT binary ) + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_USER_PLUGIN}/3d) +endif() \ No newline at end of file diff --git a/utils/kicad2step/CMakeLists.txt b/utils/kicad2step/CMakeLists.txt index 3deae4ea59..fda9ad5a1f 100644 --- a/utils/kicad2step/CMakeLists.txt +++ b/utils/kicad2step/CMakeLists.txt @@ -62,3 +62,8 @@ else() DESTINATION ${KICAD_BIN} COMPONENT binary ) endif() + +if( KICAD_WIN32_INSTALL_PDBS ) + # Get the PDBs to copy over for MSVC + install(FILES $ DESTINATION ${KICAD_BIN}) +endif() \ No newline at end of file