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
a3ea46d0
Commit
a3ea46d0
authored
Jul 16, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compil issues under mingw
parent
829e952e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
45 deletions
+61
-45
CMakeLists.txt
CMakeLists.txt
+21
-10
CMakeLists.txt
pcbnew/CMakeLists.txt
+30
-25
dialog_footprint_wizard_list.cpp
pcbnew/dialogs/dialog_footprint_wizard_list.cpp
+10
-10
No files found.
CMakeLists.txt
View file @
a3ea46d0
...
...
@@ -55,8 +55,8 @@ option(KICAD_SCRIPTING
option
(
KICAD_SCRIPTING_MODULES
"set this option ON to build kicad modules that can be used from scripting languages"
)
#Set version option (stable or testing)
...
...
@@ -91,14 +91,25 @@ endif(KICAD_STABLE_VERSION )
#================================================
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# Set default flags for Release build.
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG -fPIC"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
# Set default flags for Debug build.
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG -fPIC"
)
if
(
WIN32
)
# under Windows/mingw, -fPIC option is enabled by default
# Set default flags for Release build.
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
# Set default flags for Debug build.
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG"
)
else
(
WIN32
)
# Set default flags for Release build.
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall -O2 -DNDEBUG -fPIC"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
# Set default flags for Debug build.
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall -g3 -ggdb3 -DDEBUG -fPIC"
)
endif
(
WIN32
)
endif
(
CMAKE_COMPILER_IS_GNUCXX
)
...
...
pcbnew/CMakeLists.txt
View file @
a3ea46d0
...
...
@@ -5,10 +5,10 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
SET
(
PYTHON_DEST
"lib/python
${
PYTHON_VERSION
}
/dist-packages"
)
file
(
MAKE_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/scripting
)
FIND_PACKAGE
(
SWIG REQUIRED
)
INCLUDE
(
${
SWIG_USE_FILE
}
)
INCLUDE
(
${
SWIG_USE_FILE
}
)
FIND_PACKAGE
(
PythonLibs
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_PATH
}
)
add_definitions
(
-DPCBNEW -DKICAD_SCRIPTING
)
add_definitions
(
-DPCBNEW -DKICAD_SCRIPTING
)
endif
()
###
...
...
@@ -246,7 +246,7 @@ set(PCBNEW_SCRIPTING_DIALOGS
)
set
(
PCBNEW_SCRIPTING_PYTHON_HELPERS
set
(
PCBNEW_SCRIPTING_PYTHON_HELPERS
../scripting/wx_python_helpers.cpp
../scripting/python_scripting.cpp
scripting/pcbnew_scripting_helpers.cpp
...
...
@@ -268,16 +268,16 @@ endif()
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
)
if
(
DEBUG
)
set
(
SWIG_FLAGS
${
SWIG_FLAGS
}
-DDEBUG
)
endif
()
# collect CFLAGS , and pass them to swig later
# collect CFLAGS , and pass them to swig later
get_directory_property
(
DirDefs DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMPILE_DEFINITIONS
)
foreach
(
d
${
DirDefs
}
)
SET
(
SWIG_FLAGS
${
SWIG_FLAGS
}
-D
${
d
}
)
endforeach
()
# 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
)
...
...
@@ -287,11 +287,11 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
endif
()
endif
()
if
(
KICAD_SCRIPTING
)
SET
(
SWIG_OPTS -python -c++ -outdir
${
CMAKE_CURRENT_BINARY_DIR
}
${
SWIG_FLAGS
}
)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew_wrap.cxx
DEPENDS scripting/pcbnew.i
...
...
@@ -304,13 +304,13 @@ if (KICAD_SCRIPTING)
DEPENDS ../scripting/kicad.i
DEPENDS ../scripting/wx.i
DEPENDS ../scripting/kicadplugins.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
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endif
(
KICAD_SCRIPTING
)
...
...
@@ -323,7 +323,7 @@ if (KICAD_SCRIPTING_MODULES)
SET
(
CMAKE_SWIG_FLAGS
${
SWIG_FLAGS
}
)
SET_SOURCE_FILES_PROPERTIES
(
scripting/pcbnew.i PROPERTIES CPLUSPLUS ON
)
SWIG_ADD_MODULE
(
pcbnew python scripting/pcbnew.i
${
PCBNEW_SCRIPTING_PYTHON_HELPERS
}
${
PCBNEW_SRCS
}
${
PCBNEW_COMMON_SRCS
}
)
SWIG_LINK_LIBRARIES
(
pcbnew
SWIG_LINK_LIBRARIES
(
pcbnew
3d-viewer
pcbcommon
common
...
...
@@ -334,9 +334,14 @@ if (KICAD_SCRIPTING_MODULES)
${
OPENGL_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
${
PYTHON_LIBRARIES
}
)
endif
(
KICAD_SCRIPTING_MODULES
)
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
set
(
PCBNEW_EXTRA_LIBS
"rt"
)
endif
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES
)
###
# Windows resource file
###
...
...
@@ -410,6 +415,7 @@ endif(APPLE)
###
# Link executable target pcbnew with correct libraries
###
target_link_libraries
(
pcbnew
3d-viewer
pcbcommon
...
...
@@ -421,7 +427,7 @@ target_link_libraries(pcbnew
${
OPENGL_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
${
PYTHON_LIBRARIES
}
rt
${
PCBNEW_EXTRA_LIBS
}
)
###
...
...
@@ -435,9 +441,9 @@ if(KICAD_SCRIPTING)
add_custom_target
(
FixSwigImportsScripting ALL
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew
COMMENT
"Fixing swig_import_helper"
)
COMMENT
"Fixing swig_import_helper"
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/pcbnew.py
DESTINATION
${
PYTHON_DEST
}
)
...
...
@@ -447,13 +453,13 @@ if (KICAD_SCRIPTING_MODULES)
add_custom_target
(
FixSwigImportsModuleScripting ALL
${
CMAKE_CURRENT_SOURCE_DIR
}
/../scripting/fixswigimports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/_pcbnew
COMMENT
"Fixing swig_import_helper"
)
COMMENT
"Fixing swig_import_helper"
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/pcbnew.py
DESTINATION
${
PYTHON_DEST
}
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.so
DESTINATION
${
PYTHON_DEST
}
)
endif
(
KICAD_SCRIPTING_MODULES
)
...
...
@@ -463,12 +469,11 @@ endif(KICAD_SCRIPTING_MODULES)
if
(
NOT MSVC
)
# This one gets made only when testing.
add_executable
(
specctra_test EXCLUDE_FROM_ALL specctra_test.cpp specctra.cpp
)
target_link_libraries
(
specctra_test common
${
wxWidgets_LIBRARIES
}
rt
)
target_link_libraries
(
specctra_test common
${
wxWidgets_LIBRARIES
}
)
endif
(
NOT MSVC
)
# This one gets made only when testing.
add_executable
(
layer_widget_test WIN32 EXCLUDE_FROM_ALL
layer_widget.cpp
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
rt
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
)
pcbnew/dialogs/dialog_footprint_wizard_list.cpp
View file @
a3ea46d0
...
...
@@ -2,7 +2,7 @@
* @file dialog_scripting.cpp
*/
#include <wx
-2.8/wx/generic
/grid.h>
#include <wx/grid.h>
...
...
@@ -20,20 +20,20 @@ DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent )
{
SetFocus
();
int
n_wizards
=
FOOTPRINT_WIZARDS
::
GetSize
();
// Current wizard selection, empty or first
m_FootprintWizard
=
NULL
;
if
(
n_wizards
)
m_FootprintWizard
=
FOOTPRINT_WIZARDS
::
GetWizard
(
0
);
// Choose selection mode and insert the needed rows
m_footprintWizardsGrid
->
SetColSize
(
0
,
0
);
// hide the preview for now
m_footprintWizardsGrid
->
SetSelectionMode
(
wxGrid
::
wxGridSelectRows
);
m_footprintWizardsGrid
->
InsertRows
(
0
,
n_wizards
,
true
);
// Put all wizards in the list
for
(
int
i
=
0
;
i
<
n_wizards
;
i
++
)
{
...
...
@@ -41,12 +41,12 @@ DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent )
wxString
name
=
wizard
->
GetName
();
wxString
description
=
wizard
->
GetDescription
();
wxString
image
=
wizard
->
GetImage
();
m_footprintWizardsGrid
->
SetCellValue
(
i
,
1
,
name
);
m_footprintWizardsGrid
->
SetCellValue
(
i
,
2
,
description
);
}
// Select the first row
m_footprintWizardsGrid
->
ClearSelection
();
m_footprintWizardsGrid
->
SelectRow
(
0
,
false
);
...
...
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