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
c169de80
Commit
c169de80
authored
Oct 01, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
Pcbnew: Make scripting version compilable under Windows
parents
6bb4dea5
0e941708
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
CMakeLists.txt
CMakeLists.txt
+15
-1
CMakeLists.txt
pcbnew/CMakeLists.txt
+5
-5
fixswigimports.py
scripting/fixswigimports.py
+5
-5
No files found.
CMakeLists.txt
View file @
c169de80
...
@@ -60,6 +60,12 @@ option(KICAD_SCRIPTING_WXPYTHON
...
@@ -60,6 +60,12 @@ option(KICAD_SCRIPTING_WXPYTHON
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
)
)
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
# PYTHON_EXECUTABLE can be defined when invoking cmake
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
# when not defined by user, the default is python.exe under Windows and python2 for others
# python binary filee should be is exec path.
#Set version option (stable or testing)
#Set version option (stable or testing)
...
@@ -259,7 +265,15 @@ endif(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
...
@@ -259,7 +265,15 @@ endif(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
# Find Python and other scripting resources
# Find Python and other scripting resources
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
execute_process
(
COMMAND python2 -c
"import sys;print
\"
%s.%s
\"
%sys.version_info[0:2]"
OUTPUT_VARIABLE PYTHON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
"
${
PYTHON_EXECUTABLE
}
"
STREQUAL
""
)
if
(
WIN32
)
SET
(
PYTHON_EXECUTABLE
"python.exe"
)
else
(
WIN32
)
SET
(
PYTHON_EXECUTABLE
"python2"
)
endif
(
WIN32
)
endif
()
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import sys;print
\"
%s.%s
\"
%sys.version_info[0:2]"
OUTPUT_VARIABLE PYTHON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
set
(
PYTHON_DEST
"lib/python
${
PYTHON_VERSION
}
/dist-packages"
)
set
(
PYTHON_DEST
"lib/python
${
PYTHON_VERSION
}
/dist-packages"
)
find_package
(
PythonLibs
)
find_package
(
PythonLibs
)
include_directories
(
${
PYTHON_INCLUDE_PATH
}
include_directories
(
${
PYTHON_INCLUDE_PATH
}
...
...
pcbnew/CMakeLists.txt
View file @
c169de80
...
@@ -301,7 +301,7 @@ if (KICAD_SCRIPTING)
...
@@ -301,7 +301,7 @@ if (KICAD_SCRIPTING)
DEPENDS ../scripting/kicadplugins.i
DEPENDS ../scripting/kicadplugins.i
COMMAND
${
SWIG_EXECUTABLE
}
${
SWIG_OPTS
}
-o
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew_wrap.cxx scripting/pcbnew.i
COMMAND
${
SWIG_EXECUTABLE
}
${
SWIG_OPTS
}
-o
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew_wrap.cxx scripting/pcbnew.i
COMMAND
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
)
...
@@ -432,9 +432,9 @@ install(TARGETS pcbnew
...
@@ -432,9 +432,9 @@ install(TARGETS pcbnew
if
(
KICAD_SCRIPTING
)
if
(
KICAD_SCRIPTING
)
add_custom_target
(
FixSwigImportsScripting ALL
add_custom_target
(
FixSwigImportsScripting ALL
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew
COMMENT
"Fixing swig_import_helper"
COMMENT
"Fixing swig_import_helper
in Kicad scripting
"
)
)
...
@@ -444,9 +444,9 @@ endif(KICAD_SCRIPTING)
...
@@ -444,9 +444,9 @@ endif(KICAD_SCRIPTING)
if
(
KICAD_SCRIPTING_MODULES
)
if
(
KICAD_SCRIPTING_MODULES
)
add_custom_target
(
FixSwigImportsModuleScripting ALL
add_custom_target
(
FixSwigImportsModuleScripting ALL
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/_pcbnew
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/_pcbnew
COMMENT
"Fixing swig_import_helper"
COMMENT
"Fixing swig_import_helper
in Kicad scripting modules
"
)
)
...
...
scripting/fixswigimports.py
View file @
c169de80
...
@@ -30,12 +30,12 @@ f.close()
...
@@ -30,12 +30,12 @@ f.close()
doneOk
=
False
doneOk
=
False
if
(
len
(
lines
)
<
4000
):
if
(
len
(
lines
)
<
4000
):
print
"still building"
print
"still building"
exit
(
0
)
exit
(
0
)
txt
=
""
txt
=
""
for
l
in
lines
:
for
l
in
lines
:
if
l
.
startswith
(
"if version_info >= (2,6,0):"
):
if
l
.
startswith
(
"if version_info >= (2,6,0):"
):
l
=
l
.
replace
(
"version_info >= (2,6,0)"
,
"False"
)
l
=
l
.
replace
(
"version_info >= (2,6,0)"
,
"False"
)
...
@@ -55,8 +55,8 @@ else:
...
@@ -55,8 +55,8 @@ else:
print
" and fix this script: fixswigimports.py"
print
" and fix this script: fixswigimports.py"
exit
(
2
)
exit
(
2
)
exit
(
0
)
exit
(
0
)
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