diff --git a/CMakeLists.txt b/CMakeLists.txt index b514968d..d7e12614 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ if(UNIX) CACHE PATH "Location of KiCad data files.") set(KICAD_MODULES ${KICAD_DATA}/modules) set(KICAD_LIBRARY ${KICAD_DATA}/library) - set(KICAD_TEMPLATES ${KICAD_DATA}/template) + set(KICAD_TEMPLATE ${KICAD_DATA}/template) endif(APPLE) endif(UNIX) @@ -29,12 +29,20 @@ if(WIN32) # Everything without leading / is relative to CMAKE_INSTALL_PREFIX. set(KICAD_MODULES modules) set(KICAD_LIBRARY library) - set(KICAD_TEMPLATES template) + set(KICAD_TEMPLATE template) endif(WIN32) mark_as_advanced( KICAD_DATA KICAD_MODULES KICAD_LIBRARY ) +if( UNIX ) + set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specifig KiCad config files" ) +elseif( MINGW ) + set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specifig KiCad config files" ) +endif() +mark_as_advanced( KICAD_USER_CONFIG_DIR ) + + #================================================ # "make uninstall" rules #================================================ diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt index c934e6ca..e6423c7d 100644 --- a/template/CMakeLists.txt +++ b/template/CMakeLists.txt @@ -14,5 +14,54 @@ string( REGEX REPLACE "CMakeFiles/[^;]+;?" "" template_lst "${template_lst}" ) foreach( tpl ${template_lst} ) #message( tpl:${tpl} ) - install( DIRECTORY ${tpl} DESTINATION ${KICAD_TEMPLATES} COMPONENT templates ) + install( DIRECTORY ${tpl} DESTINATION ${KICAD_TEMPLATE} COMPONENT templates ) endforeach() + + +# The source tree's CMake installation and this library CMake installation are coordinated. In +# particular, the template directory receives files from both CMake installers so a common location +# should be maintained in both installers, so they both can add to that directory. + +install( FILES + fp-lib-table.for-github + fp-lib-table.for-pretty + fp-lib-table.for-legacy + fp-lib-table.for-eagle-6.4.0 + DESTINATION ${KICAD_TEMPLATE} + COMPONENT resources + ) + + +# Establish fp-lib-table.for-github as template/fp-lib-table for those not running kicad-install.sh +install( FILES + fp-lib-table.for-github + DESTINATION ${KICAD_TEMPLATE} + COMPONENT resources + RENAME fp-lib-table + ) + + +# These can be fired by running +# +# "make install_github_fp-lib-table" +# +# or similar (might change github to pretty) to rename and copy an fp-lib-table strategy into your +# KICAD_USER_CONFIG_DIR (i.e. $HOME directory) where pcbnew will find it for the global table. +# Only one of these should be run of course. + +add_custom_target( install_github_fp-lib-table + "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/template/fp-lib-table.for-github" ${KICAD_USER_CONFIG_DIR}/fp-lib-table + COMMENT "Install template fp-lib-table into your home directory." + ) + +add_custom_target( install_pretty_fp-lib-table + "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/template/fp-lib-table.for-pretty" ${KICAD_USER_CONFIG_DIR}/fp-lib-table + COMMENT "Install template fp-lib-table into your home directory." + ) + +add_custom_target( install_legacy_fp-lib-table + "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/template/fp-lib-table.for-legacy" ${KICAD_USER_CONFIG_DIR}/fp-lib-table + COMMENT "Install template fp-lib-table into your home directory." + ) + + diff --git a/template/fp-lib-table b/template/fp-lib-table deleted file mode 100644 index a765b997..00000000 --- a/template/fp-lib-table +++ /dev/null @@ -1,73 +0,0 @@ -(fp_lib_table - (lib (name Air_Coils_SML_NEOSID)(type Legacy)(uri ${KISYSMOD}/Air_Coils_SML_NEOSID.mod)(options "")(descr HAMxx31A_HDMxx31A)) - (lib (name Capacitors_Elko_ThroughHole)(type Legacy)(uri ${KISYSMOD}/Capacitors_Elko_ThroughHole.mod)(options "")(descr "The way you like them.")) - (lib (name Capacitors_SMD)(type Legacy)(uri ${KISYSMOD}/Capacitors_SMD.mod)(options "")(descr "The way you like them.")) - (lib (name Capacitors)(type Legacy)(uri ${KISYSMOD}/Capacitors.mod)(options "")(descr "The way you like them.")) - (lib (name Connectors_Serial_MOLEX)(type Legacy)(uri ${KISYSMOD}/Connectors_Serial_MOLEX.mod)(options "")(descr 53047-A123)) - (lib (name Connect)(type Legacy)(uri ${KISYSMOD}/Connect.mod)(options "")(descr "The way you like them.")) - (lib (name Converters_DCDC_ACDC)(type Legacy)(uri ${KISYSMOD}/Converters_DCDC_ACDC.mod)(options "")(descr "The way you like them.")) - (lib (name Crystals_Oscillators_SMD)(type Legacy)(uri ${KISYSMOD}/Crystals_Oscillators_SMD.mod)(options "")(descr "The way you like them.")) - (lib (name Crystals)(type Legacy)(uri ${KISYSMOD}/Crystals.mod)(options "")(descr "The way you like them.")) - (lib (name Diodes_SMD)(type Legacy)(uri ${KISYSMOD}/Diodes_SMD.mod)(options "")(descr "The way you like them.")) - (lib (name Diodes_ThroughHole)(type Legacy)(uri ${KISYSMOD}/Diodes_ThroughHole.mod)(options "")(descr "The way you like them.")) - (lib (name Discret)(type Legacy)(uri ${KISYSMOD}/Discret.mod)(options "")(descr "The way you like them.")) - (lib (name Display)(type Legacy)(uri ${KISYSMOD}/Display.mod)(options "")(descr "The way you like them.")) - (lib (name Divers)(type Legacy)(uri ${KISYSMOD}/Divers.mod)(options "")(descr "The way you like them.")) - (lib (name EuroBoard_Outline)(type Legacy)(uri ${KISYSMOD}/EuroBoard_Outline.mod)(options "")(descr "The way you like them.")) - (lib (name Fiducials)(type Legacy)(uri ${KISYSMOD}/Fiducials.mod)(options "")(descr "The way you like them.")) - (lib (name Filters_HF_Coils_NEOSID)(type Legacy)(uri ${KISYSMOD}/Filters_HF_Coils_NEOSID.mod)(options "")(descr "The way you like them.")) - (lib (name Footprint_Symbols)(type Legacy)(uri ${KISYSMOD}/Footprint_Symbols.mod)(options "")(descr "The way you like them.")) - (lib (name Fuse_Holders_and_Fuses)(type Legacy)(uri ${KISYSMOD}/Fuse_Holders_and_Fuses.mod)(options "")(descr "The way you like them.")) - (lib (name Heatsinks)(type Legacy)(uri ${KISYSMOD}/Heatsinks.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_ROHM)(type Legacy)(uri ${KISYSMOD}/Housings_ROHM.mod)(options "")(descr VML0806)) - (lib (name Housings_SIP9)(type Legacy)(uri ${KISYSMOD}/Housings_SIP9.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_SOT-23_SOT-143_TSOT-6)(type Legacy)(uri ${KISYSMOD}/Housings_SOT-23_SOT-143_TSOT-6.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_SOT-89)(type Legacy)(uri ${KISYSMOD}/Housings_SOT-89.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_SOT)(type Legacy)(uri ${KISYSMOD}/Housings_SOT.mod)(options "")(descr "SOT126, SOT32")) - (lib (name Housings_TO-50)(type Legacy)(uri ${KISYSMOD}/Housings_TO-50.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_TO-78)(type Legacy)(uri ${KISYSMOD}/Housings_TO-78.mod)(options "")(descr "The way you like them.")) - (lib (name Housings_TO-92)(type Legacy)(uri ${KISYSMOD}/Housings_TO-92.mod)(options "")(descr "The way you like them.")) - (lib (name Inductors_NEOSID)(type Legacy)(uri ${KISYSMOD}/Inductors_NEOSID.mod)(options "")(descr "The way you like them.")) - (lib (name Inductors)(type Legacy)(uri ${KISYSMOD}/Inductors.mod)(options "")(descr "The way you like them.")) - (lib (name IR-DirectFETs)(type Legacy)(uri ${KISYSMOD}/IR-DirectFETs.mod)(options "")(descr "The way you like them.")) - (lib (name Iut)(type Legacy)(uri ${KISYSMOD}/Iut.mod)(options "")(descr "The way you like them.")) - (lib (name Labels)(type Legacy)(uri ${KISYSMOD}/Labels.mod)(options "")(descr "The way you like them.")) - (lib (name LEDs)(type Legacy)(uri ${KISYSMOD}/LEDs.mod)(options "")(descr "The way you like them.")) - (lib (name Measurement_Points)(type Legacy)(uri ${KISYSMOD}/Measurement_Points.mod)(options "")(descr "The way you like them.")) - (lib (name Measurement_Scales)(type Legacy)(uri ${KISYSMOD}/Measurement_Scales.mod)(options "")(descr "The way you like them.")) - (lib (name Mechanical_Sockets)(type Legacy)(uri ${KISYSMOD}/Mechanical_Sockets.mod)(options "")(descr DIN41612)) - (lib (name Mounting_Holes)(type Legacy)(uri ${KISYSMOD}/Mounting_Holes.mod)(options "")(descr "The way you like them.")) - (lib (name Muonde)(type Legacy)(uri ${KISYSMOD}/Muonde.mod)(options "")(descr "The way you like them.")) - (lib (name NF-Transformers_ETAL)(type Legacy)(uri ${KISYSMOD}/NF-Transformers_ETAL.mod)(options "")(descr "The way you like them.")) - (lib (name Oddities)(type Legacy)(uri ${KISYSMOD}/Oddities.mod)(options "")(descr "The way you like them.")) - (lib (name Opto-Devices)(type Legacy)(uri ${KISYSMOD}/Opto-Devices.mod)(options "")(descr "The way you like them.")) - (lib (name Oscillator-Modules)(type Legacy)(uri ${KISYSMOD}/Oscillator-Modules.mod)(options "")(descr "The way you like them.")) - (lib (name Oscillators)(type Legacy)(uri ${KISYSMOD}/Oscillators.mod)(options "")(descr "SI570, SI571")) - (lib (name Pentawatts)(type Legacy)(uri ${KISYSMOD}/Pentawatts.mod)(options "")(descr "The way you like them.")) - (lib (name PFF_PSF_PSS_Leadforms)(type Legacy)(uri ${KISYSMOD}/PFF_PSF_PSS_Leadforms.mod)(options "")(descr Allegro_ACS754_ACS755_ACS756_HallCurrentSensor)) - (lib (name Pin_Arrays)(type Legacy)(uri ${KISYSMOD}/Pin_Arrays.mod)(options "")(descr "The way you like them.")) - (lib (name Potentiometers)(type Legacy)(uri ${KISYSMOD}/Potentiometers.mod)(options "")(descr "The way you like them.")) - (lib (name Power_Integrations)(type Legacy)(uri ${KISYSMOD}/Power_Integrations.mod)(options "")(descr "The way you like them.")) - (lib (name Printtrafo_CHK)(type Legacy)(uri ${KISYSMOD}/Printtrafo_CHK.mod)(options "")(descr "The way you like them.")) - (lib (name Relays_ThroughHole)(type Legacy)(uri ${KISYSMOD}/Relays_ThroughHole.mod)(options "")(descr "The way you like them.")) - (lib (name Resistors_SMD)(type Legacy)(uri ${KISYSMOD}/Resistors_SMD.mod)(options "")(descr "The way you like them.")) - (lib (name Resistors_ThroughHole)(type Legacy)(uri ${KISYSMOD}/Resistors_ThroughHole.mod)(options "")(descr "The way you like them.")) - (lib (name Resistors_Universal)(type Legacy)(uri ${KISYSMOD}/Resistors_Universal.mod)(options "")(descr Experimental)) - (lib (name SMD_Packages)(type Legacy)(uri ${KISYSMOD}/SMD_Packages.mod)(options "")(descr "The way you like them.")) - (lib (name Sockets_DIP)(type Legacy)(uri ${KISYSMOD}/Sockets_DIP.mod)(options "")(descr "The way you like them.")) - (lib (name Sockets_Mini-Universal)(type Legacy)(uri ${KISYSMOD}/Sockets_Mini-Universal.mod)(options "")(descr Mate-N-Lok)) - (lib (name Sockets_MOLEX_KK-System)(type Legacy)(uri ${KISYSMOD}/Sockets_MOLEX_KK-System.mod)(options "")(descr "The way you like them.")) - (lib (name Sockets_PGA)(type Legacy)(uri ${KISYSMOD}/Sockets_PGA.mod)(options "")(descr "The way you like them.")) - (lib (name Sockets)(type Legacy)(uri ${KISYSMOD}/Sockets.mod)(options "")(descr "The way you like them.")) - (lib (name Sockets_WAGO734)(type Legacy)(uri ${KISYSMOD}/Sockets_WAGO734.mod)(options "")(descr "The way you like them.")) - (lib (name SOIC_Packages)(type Legacy)(uri ${KISYSMOD}/SOIC_Packages.mod)(options "")(descr "The way you like them.")) - (lib (name SSOP_Packages)(type Legacy)(uri ${KISYSMOD}/SSOP_Packages.mod)(options "")(descr "The way you like them.")) - (lib (name Terminal_Blocks)(type Legacy)(uri ${KISYSMOD}/Terminal_Blocks.mod)(options "")(descr WAGO236-RM5mm)) - (lib (name Transformers_SMPS_ThroughHole)(type Legacy)(uri ${KISYSMOD}/Transformers_SMPS_ThroughHole.mod)(options "")(descr "The way you like them.")) - (lib (name Transistors_SMD)(type Legacy)(uri ${KISYSMOD}/Transistors_SMD.mod)(options "")(descr "The way you like them.")) - (lib (name Transistors_TO-220)(type Legacy)(uri ${KISYSMOD}/Transistors_TO-220.mod)(options "")(descr "The way you like them.")) - (lib (name Transistors_TO-247)(type Legacy)(uri ${KISYSMOD}/Transistors_TO-247.mod)(options "")(descr "The way you like them.")) - (lib (name Valves)(type Legacy)(uri ${KISYSMOD}/Valves.mod)(options "")(descr "The way you like them.")) - (lib (name Wire_Connections_Bridges)(type Legacy)(uri ${KISYSMOD}/Wire_Connections_Bridges.mod)(options "")(descr "The way you like them.")) - (lib (name Wire_Pads)(type Legacy)(uri ${KISYSMOD}/Wire_Pads.mod)(options "")(descr "The way you like them.")) -)