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
0e941708
Commit
0e941708
authored
Sep 30, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make scripting version compilable under Windows
parent
6bb4dea5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
CMakeLists.txt
CMakeLists.txt
+15
-1
CMakeLists.txt
pcbnew/CMakeLists.txt
+5
-5
No files found.
CMakeLists.txt
View file @
0e941708
...
@@ -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 @
0e941708
...
@@ -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
"
)
)
...
...
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