Commit 970e0333 authored by Miguel Angel Ajo's avatar Miguel Angel Ajo

build _pcbnew DSO/DLL

parent ec5757a4
...@@ -91,7 +91,7 @@ set(PCBNEW_DIALOGS ...@@ -91,7 +91,7 @@ set(PCBNEW_DIALOGS
dialogs/dialog_scripting.cpp dialogs/dialog_scripting.cpp
) )
set(PCBNEW_SRCS set(PCBNEW_CLASS_SRCS
tool_modview.cpp tool_modview.cpp
modview.cpp modview.cpp
modview_frame.cpp modview_frame.cpp
...@@ -114,7 +114,6 @@ set(PCBNEW_SRCS ...@@ -114,7 +114,6 @@ set(PCBNEW_SRCS
dimension.cpp dimension.cpp
cross-probing.cpp cross-probing.cpp
deltrack.cpp deltrack.cpp
${PCBNEW_DIALOGS}
dist.cpp dist.cpp
dragsegm.cpp dragsegm.cpp
drc.cpp drc.cpp
...@@ -212,6 +211,8 @@ set(PCBNEW_SRCS ...@@ -212,6 +211,8 @@ set(PCBNEW_SRCS
zones_test_and_combine_areas.cpp zones_test_and_combine_areas.cpp
) )
set(PCBNEW_SRCS ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS})
### ###
# We need some extra sources from common # We need some extra sources from common
### ###
...@@ -222,11 +223,15 @@ set(PCBNEW_COMMON_SRCS ...@@ -222,11 +223,15 @@ set(PCBNEW_COMMON_SRCS
## ##
# Scripting sources # Scripting sources
## ##
set(PCBNEW_SCRIPTING_PYTHON_HELPERS
scripting/wx_python_helpers.cpp
scripting/python_scripting.cpp
)
set(PCBNEW_SCRIPTING_SRCS set(PCBNEW_SCRIPTING_SRCS
# kicad_wrap.cxx # kicad_wrap.cxx
pcbnew_wrap.cxx pcbnew_wrap.cxx
scripting/wx_python_helpers.cpp ${PCBNEW_SCRIPTING_PYTHON_HELPERS}
scripting/python_scripting.cpp
) )
## ##
...@@ -234,32 +239,31 @@ set(PCBNEW_SCRIPTING_SRCS ...@@ -234,32 +239,31 @@ set(PCBNEW_SCRIPTING_SRCS
## ##
set(SWIG_FLAGS -I${CMAKE_CURRENT_SOURCE_DIR}/../.. -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../include -DDEBUG)
SET(SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../.. -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../include -DDEBUG )
# 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 ) get_directory_property( DirDefs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS )
foreach( d ${DirDefs} ) foreach( d ${DirDefs} )
SET(SWIG_OPTS ${SWIG_OPTS} -D${d} ) SET(SWIG_FLAGS ${SWIG_FLAGS} -D${d} )
endforeach() endforeach()
# check if we have IO_MGR and KICAD_PLUGIN available # check if we have IO_MGR and KICAD_PLUGIN available
if ( USE_NEW_PCBNEW_LOAD OR USE_NEW_PCBNEW_SAVE ) if ( USE_NEW_PCBNEW_LOAD OR USE_NEW_PCBNEW_SAVE )
SET(SWIG_OPTS ${SWIG_OPTS} -DBUILD_WITH_PLUGIN) SET(SWIG_FLAGS ${SWIG_FLAGS} -DBUILD_WITH_PLUGIN)
endif() endif()
foreach( d ${SWIG_OPTS} ) foreach( d ${SWIG_FLAGS} )
message(STATUS "Swig options:" ${d}) message(STATUS "Swig options:" ${d})
endforeach() endforeach()
SET(SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
if ( USE_NEW_PCBNEW_LOAD OR USE_NEW_PCBNEW_SAVE )
endif()
# we checked the posibility to build kicad thinks in a separate module, but it
# will be easier in just one "pcbnew" for now
#
#add_custom_command( #add_custom_command(
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_wrap.cxx # OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_wrap.cxx
# COMMAND ${SWIG_EXECUTABLE} ${SWIG_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/kicad_wrap.cxx scripting/kicad.i # COMMAND ${SWIG_EXECUTABLE} ${SWIG_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/kicad_wrap.cxx scripting/kicad.i
...@@ -273,6 +277,26 @@ add_custom_command( ...@@ -273,6 +277,26 @@ add_custom_command(
) )
###
# _pcbnew DLL/DSO file creation
###
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})
SWIG_LINK_LIBRARIES(pcbnew
3d-viewer
pcbcommon
common
bitmaps
polygon
kbool
${wxWidgets_LIBRARIES}
${OPENGL_LIBRARIES}
${GDI_PLUS_LIBRARIES}
${PYTHON_LIBRARIES})
### ###
# Windows resource file # Windows resource file
### ###
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment