Commit 2acaa287 authored by Marco Serantoni's avatar Marco Serantoni

[MacOSX] Fixing build system, sorry guys, refining build system and make building smoother.

parent e7d2b9b4
......@@ -341,7 +341,9 @@ add_definitions(-DWX_COMPATIBILITY)
find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" )
if( KICAD_SCRIPTING_WXPYTHON )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_custom_target( lib-wxpython )
include( download_pcre )
include( download_swig )
......@@ -349,9 +351,7 @@ add_custom_target( lib-wxpython )
add_dependencies( lib-wxpython pcre )
add_dependencies( lib-wxpython swig )
add_dependencies( lib-wxpython libwxpython )
endif()
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
......
......@@ -42,8 +42,10 @@ if (APPLE)
set( SWIG_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" )
set( SWIG_CXXFLAGS "CXXFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" )
set( SWIG_LDFLAGS "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" )
set( SWIG_PYTHON "--with-python=/usr/bin/python2.6" )
endif( CMAKE_OSX_ARCHITECTURES )
set( SWIG_PYTHON "--with-python=/usr/bin/python2.6" )
set( SWIG_OPTS --disable-dependency-tracking )
endif(APPLE)
# <SOURCE_DIR> = ${PREFIX}/src/glew
......@@ -66,7 +68,7 @@ ExternalProject_Add( swig
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${SWIG_ROOT}"
#PATCH_COMMAND "true"
CONFIGURE_COMMAND ./configure --prefix=${SWIG_ROOT} --with-pcre-prefix=${PCRE_ROOT} ${SWIG_CFLAGS} ${SWIG_LDFLAGS} ${SWIG_CXXFLAGS} ${SWIG_PYTHON}
CONFIGURE_COMMAND ./configure --prefix=${SWIG_ROOT} --with-pcre-prefix=${PCRE_ROOT} ${SWIG_CFLAGS} ${SWIG_LDFLAGS} ${SWIG_CXXFLAGS} ${SWIG_PYTHON} ${SWIG_OPTS}
#BINARY_DIR "${PREFIX}"
......
......@@ -74,7 +74,7 @@ ExternalProject_Add( libwxpython
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${LIBWXPYTHON_ROOT}"
COMMAND ${LIBWXPYTHON_EXEC} wxPython/build-wxpython.py --clean
CONFIGURE_COMMAND ${LIBWXPYTHON_EXEC} wxPython/build-wxpython.py --prefix=/Users/marco/Development/product/libwxpython_root --unicode --install ${LIBWXPYTHON_OPTS}
CONFIGURE_COMMAND ${LIBWXPYTHON_EXEC} wxPython/build-wxpython.py --prefix=${LIBWXPYTHON_ROOT} --unicode --install ${LIBWXPYTHON_OPTS}
#BINARY_DIR "${PREFIX}"
......
......@@ -27,18 +27,21 @@ Building Kicad with no support for Scripting
If you set KICAD_BUILD_DYNAMIC the building system will build all and include
the needed libraries for each executable in its bundle
cmake -DKICAD_BUILD_DYNAMIC=ON .
make
Building Kicad with support for Scripting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due some problems with some dependencies the build of this kind of binary is a bit
more complex, you should initially set KICAD_BUILD_DYNAMIC
then issue for example
cmake -DKICAD_BUILD_DYNAMIC=ON
cmake -DKICAD_BUILD_DYNAMIC=ON .
make lib-wxpython
After successfully building you can set your KICAD_SCRIPTING* options (for example):
cmake -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_WXPYTHON=ON
cmake -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_WXPYTHON=ON .
make
The system will build all accordling your choices and package all in the bundle
......
=== modified file 'wxPython/config.py'
--- wxPython/config.py 2014-02-07 20:23:11 +0000
+++ wxPython/config.py 2014-02-07 21:00:18 +0000
--- wxPython/config.py 2014-02-08 12:23:31 +0000
+++ wxPython/config.py 2014-02-08 13:58:07 +0000
@@ -22,6 +22,7 @@
import sys, os, glob, fnmatch, tempfile
......@@ -17,8 +17,8 @@
- cflags.append(ARCH)
- lflags.append("-arch")
- lflags.append(ARCH)
+ cflags.append('-arch ' + re.sub(',',' -arch ',ARCH))
+ lflags.append('-arch ' + re.sub(',',' -arch ',ARCH))
+ cflags.append("-arch " + re.sub(","," -arch ",ARCH))
+ #lflags.append("-arch " + re.sub(","," -arch ",ARCH))
if not os.environ.get('CC') or not os.environ.get('CXX'):
os.environ["CXX"] = getWxConfigValue('--cxx')
......
......@@ -598,7 +598,7 @@ if( KICAD_SCRIPTING )
# copies all into PYTHON_DEST then all into the bundle !
add_custom_target( _pcbnew_py_copy ALL
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py "${PYTHON_DEST}"
DEPENDS FixSwigImportsModuleScripting
DEPENDS FixSwigImportsScripting
COMMENT "Copying pcbnew.py into PYTHON_DEST"
)
......
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