Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
5d0dee13
Commit
5d0dee13
authored
Jul 22, 2012
by
Miguel Angel Ajo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adam Vašíček patches for WIN32 compilation of kicad scripting
parent
4f01bedf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
20 deletions
+55
-20
CMakeLists.txt
CMakeLists.txt
+8
-0
basicframe.cpp
common/basicframe.cpp
+9
-1
CMakeLists.txt
pcbnew/CMakeLists.txt
+18
-12
kicadplugins.i
scripting/kicadplugins.i
+20
-7
No files found.
CMakeLists.txt
View file @
5d0dee13
...
...
@@ -129,6 +129,14 @@ if(USE_WX_OVERLAY OR APPLE)
add_definitions
(
-DUSE_WX_OVERLAY
)
endif
(
USE_WX_OVERLAY OR APPLE
)
if
(
KICAD_SCRIPTING
)
add_definitions
(
-DKICAD_SCRIPTING
)
endif
(
KICAD_SCRIPTING
)
if
(
KICAD_SCRIPTING_MODULES
)
add_definitions
(
-DKICAD_SCRIPTING_MODULES
)
endif
(
KICAD_SCRIPTING_MODULES
)
if
(
USE_WX_GRAPHICS_CONTEXT
)
add_definitions
(
-DUSE_WX_GRAPHICS_CONTEXT
)
...
...
common/basicframe.cpp
View file @
5d0dee13
...
...
@@ -539,7 +539,15 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
tmp
<<
wxT
(
"OFF
\n
"
);
#endif
tmp
<<
wxT
(
" USE_BOOST_POLYGON_LIBRARY"
);
tmp
<<
wxT
(
" USE_BOOST_POLYGON_LIBRARY
\n
"
);
tmp
<<
wxT
(
" KICAD_SCRIPTING="
);
#ifdef KICAD_SCRIPTING
tmp
<<
wxT
(
"ON
\n
"
);
#else
tmp
<<
wxT
(
"OFF
\n
"
);
#endif
wxTheClipboard
->
SetData
(
new
wxTextDataObject
(
tmp
)
);
wxTheClipboard
->
Close
();
...
...
pcbnew/CMakeLists.txt
View file @
5d0dee13
...
...
@@ -8,8 +8,9 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
INCLUDE
(
${
SWIG_USE_FILE
}
)
FIND_PACKAGE
(
PythonLibs
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_PATH
}
)
add_definitions
(
-DPCBNEW -DKICAD_SCRIPTING
)
endif
()
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DKICAD_SCRIPTING -DKICAD_SCRIPTING_MODULES"
)
endif
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
###
# Includes
...
...
@@ -259,7 +260,7 @@ if (KICAD_SCRIPTING)
pcbnew_wrap.cxx
${
PCBNEW_SCRIPTING_PYTHON_HELPERS
}
)
endif
()
endif
(
KICAD_SCRIPTING
)
##
# Scripting build
...
...
@@ -270,7 +271,7 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
set
(
SWIG_FLAGS -I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../.. -I
${
CMAKE_CURRENT_SOURCE_DIR
}
-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include -I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting
)
if
(
DEBUG
)
set
(
SWIG_FLAGS
${
SWIG_FLAGS
}
-DDEBUG
)
endif
()
endif
(
DEBUG
)
# collect CFLAGS , and pass them to swig later
get_directory_property
(
DirDefs DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMPILE_DEFINITIONS
)
...
...
@@ -281,12 +282,13 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
# check if we have IO_MGR and KICAD_PLUGIN available
if
(
USE_NEW_PCBNEW_LOAD OR USE_NEW_PCBNEW_SAVE
)
SET
(
SWIG_FLAGS
${
SWIG_FLAGS
}
-DBUILD_WITH_PLUGIN
)
endif
()
endif
(
USE_NEW_PCBNEW_LOAD OR USE_NEW_PCBNEW_SAVE
)
if
(
USE_PCBNEW_NANOMETRES
)
SET
(
SWIG_FLAGS
${
SWIG_FLAGS
}
-DUSE_PCBNEW_NANOMETRES
)
endif
()
endif
(
USE_PCBNEW_NANOMETRES
)
endif
()
endif
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
if
(
KICAD_SCRIPTING
)
...
...
@@ -337,9 +339,9 @@ if (KICAD_SCRIPTING_MODULES)
endif
(
KICAD_SCRIPTING_MODULES
)
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
if
(
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
AND NOT WIN32
)
set
(
PCBNEW_EXTRA_LIBS
"rt"
)
endif
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
endif
(
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
AND NOT WIN32
)
###
...
...
@@ -459,9 +461,13 @@ if (KICAD_SCRIPTING_MODULES)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/pcbnew.py
DESTINATION
${
PYTHON_DEST
}
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.so
DESTINATION
${
PYTHON_DEST
}
)
if
(
WIN32
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.dso
DESTINATION
${
PYTHON_DEST
}
)
else
(
WIN32
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.so
DESTINATION
${
PYTHON_DEST
}
)
endif
(
WIN32
)
endif
(
KICAD_SCRIPTING_MODULES
)
...
...
scripting/kicadplugins.i
View file @
5d0dee13
...
...
@@ -45,17 +45,30 @@ def LoadPlugins():
import os
import sys
plugins_dir = os.environ['HOME']+'/.kicad_plugins/'
# Use environment variable KICAD_PATH to derive path to plugins as a temporary solution
kicad_path = os.environ.get('KICAD_PATH')
plugin_directories=[]
sys.path.append(plugins_dir)
if kicad_path and os.path.isdir(kicad_path):
plugin_directories.append(os.path.join(kicad_path, 'scripting', 'plugins'))
if sys.platform.startswith('linux'):
plugin_directories.append(os.environ['HOME']+'/.kicad_plugins/')
plugin_directories.append(os.environ['HOME']+'/.kicad/scripting/plugins/')
for module in os.listdir(plugins_dir):
if os.path.isdir(plugins_dir+module):
__import__(module, locals(), globals())
# scan all possible directories for plugins, and load them
if module == '__init__.py' or module[-3:] != '.py':
for plugins_dir in plugin_directories:
sys.path.append(plugins_dir)
if not os.path.isdir(plugins_dir):
continue
__import__(module[:-3], locals(), globals())
for module in os.listdir(plugins_dir):
if os.path.isdir(plugins_dir+module):
__import__(module, locals(), globals())
if module == '__init__.py' or module[-3:] != '.py':
continue
__import__(module[:-3], locals(), globals())
# KiCadPlugin base class will register any plugin into the right place
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment