[MacOSX] New reorg for building system, typos and path refines

This commit is contained in:
Marco Serantoni 2014-02-19 22:39:21 +01:00
parent bd52f00601
commit 932c92af55
11 changed files with 44 additions and 28 deletions

View File

@ -343,16 +343,17 @@ add_definitions(-DWX_COMPATIBILITY)
find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" )
# Handle target used to specify if a target needs wx-widgets or other libraries
# Always defined, empty if no libraries are to be build
add_custom_target( lib-dependencies )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_custom_target( lib-wxpython )
# This should be build in all cases, if swig exec is not avaiable
# will be impossible also enable SCRIPTING being for PCBNEW required immediatly
include( download_pcre )
include( download_swig )
include( download_wxpython )
add_dependencies( lib-wxpython pcre )
add_dependencies( lib-wxpython swig )
add_dependencies( lib-wxpython libwxpython )
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
@ -372,15 +373,11 @@ add_custom_target( lib-wxpython )
message(STATUS "KICAD_BUILD_DYNAMIC set")
endif()
add_custom_target( lib-dependencies
DEPENDS boost cairo glew libpng pixman pkgconfig
)
include( download_libpng )
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES )
message(STATUS "Scripting ENABLED")
include( download_wxpython )
set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig )
set( SWIG_INCLUDE ${SWIG_ROOT}/include )
@ -388,7 +385,7 @@ add_custom_target( lib-wxpython )
if( NOT EXISTS ${SWIG_EXECUTABLE} )
set(KICAD_SCRIPTING CACHE OFF FORCE "Disabling KICAD_SCRIPTING")
message( STATUS "KICAD_SCRIPTING Enabled but SWIG not found, please disable and before reenabling execute: make lib-wxpython")
message( STATUS "KICAD_SCRIPTING Enabled but SWIG not found, please disable and before reenabling execute: make swig")
message( FATAL_ERROR "Missing SWIG!")
endif()
message(STATUS "SWIG_EXECUTABLE: ${SWIG_EXECUTABLE}")
@ -401,11 +398,15 @@ add_custom_target( lib-wxpython )
set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib )
add_dependencies( lib-dependencies libwxpython )
add_dependencies( lib-dependencies swig )
else()
include( download_wxwidgets )
add_dependencies( lib-dependencies libwx )
endif()
include( download_libpng )
include( download_pkgconfig )
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
include( download_glew )
@ -417,6 +418,12 @@ add_custom_target( lib-wxpython )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" )
add_dependencies( lib-dependencies boost )
add_dependencies( lib-dependencies cairo )
add_dependencies( lib-dependencies libpng )
add_dependencies( lib-dependencies pixman )
add_dependencies( lib-dependencies pkgconfig )
if( KICAD_BUILD_DYNAMIC AND APPLE )
add_custom_target( osx_fix_bundles ALL DEPENDS cvpcb eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor)
add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND scripts/osx_fixbundle.sh COMMENT "Migrating dylibs to bundles")
@ -623,17 +630,13 @@ if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pcbnew lib-dependencies )
add_dependencies( eeschema lib-dependencies )
add_dependencies( cvpcb lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( common lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( pcbcommon lib-dependencies )
add_dependencies( 3d-viewer lib-dependencies )
add_dependencies( pcad2kicadpcb lib-dependencies )
add_dependencies( polygon lib-dependencies )
add_dependencies( pl_editor lib-dependencies )
add_dependencies( pnsrouter lib-dependencies )
if ( BUILD_GITHUB_PLUGIN )
add_dependencies( github_plugin lib-dependencies )
endif()
endif()
if ( KICAD_BUILD_DYNAMIC )

View File

@ -27,8 +27,6 @@
set( PCRE_RELEASE 8.34 )
set( PCRE_MD5 eb34b2c9c727fd64940d6fd9a00995eb ) # re-calc this on every RELEASE change
# The boost headers [and static libs if built] go here, at the top of KiCad
# source tree in boost_root.
set( PCRE_ROOT "${PROJECT_SOURCE_DIR}/pcre_root" )
#-----</configure>---------------------------------------------------------------
@ -45,10 +43,6 @@ if (APPLE)
endif( CMAKE_OSX_ARCHITECTURES )
endif(APPLE)
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
# download, the patch is applied. This lets you regenerate a new patch at any time
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
ExternalProject_Add( pcre
PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}"

View File

@ -37,11 +37,11 @@ Building Kicad with support for Scripting
then issue for example
cmake -DKICAD_BUILD_DYNAMIC=ON .
make lib-wxpython
make swig
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 -DKICAD_SCRIPTING_MODULES=ON .
make
The system will build all accordling your choices and package all in the bundle

View File

@ -57,6 +57,10 @@ set( GAL_SRCS
add_library( gal STATIC ${GAL_SRCS} )
add_dependencies( gal shader_headers )
add_dependencies( gal lib-dependencies )
add_dependencies( shader_headers lib-dependencies )
# Only for win32 cross compilation using MXE
if( WIN32 AND MSYS )
add_definitions( -DGLEW_STATIC )
@ -183,6 +187,7 @@ set( COMMON_SRCS
add_library( common STATIC ${COMMON_SRCS} )
add_dependencies( common lib-dependencies )
set( PCB_COMMON_SRCS
base_screen.cpp
@ -249,6 +254,7 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
)
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
add_dependencies( pcbcommon lib-dependencies )
# auto-generate specctra_lexer.h and specctra_keywords.cpp
make_lexer(
@ -315,3 +321,6 @@ make_lexer(
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
add_dependencies( dsntest lib-dependencies )

View File

@ -502,8 +502,8 @@ void EDA_APP::SetDefaultSearchPaths()
#ifdef __WXMSW__
tmp.AddEnvList( wxT( "PROGRAMFILES" ) );
#elif __WXMAC__
tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support" ) );
tmp.Add( wxT( "/Library/Application Support" ) );
tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support/kicad/" ) );
tmp.Add( wxT( "/Library/Application Support/kicad/" ) );
#else
tmp.AddEnvList( wxT( "PATH" ) );
#endif

View File

@ -513,6 +513,7 @@ make_lexer(
add_subdirectory( pcad2kicadpcb_plugin )
if( BUILD_GITHUB_PLUGIN )
add_subdirectory( github )
add_dependencies( github_plugin lib-dependencies )
endif()
@ -526,6 +527,7 @@ add_executable( pcbnew WIN32 MACOSX_BUNDLE
${PCBNEW_RESOURCES}
)
add_dependencies( pcbnew lib-dependencies )
###
# Set properties for APPLE on pcbnew target
###

View File

@ -1077,7 +1077,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
#ifndef USE_WX_OVERLAY
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), &dc );
#else
// #1267772 - Draw into dialog converted in refresh request
// #1277772 - Draw into dialog converted in refresh request
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), NULL );
m_canvas->Refresh();
#endif

View File

@ -29,3 +29,5 @@ set( PCAD2PCBNEW_SRCS
)
add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} )
add_dependencies( pcad2kicadpcb lib-dependencies )

View File

@ -48,4 +48,3 @@ set( PCBNEW_PNS_SRCS
)
add_library( pnsrouter STATIC ${PCBNEW_PNS_SRCS} )

View File

@ -18,3 +18,6 @@ set(POLYGON_SRCS
)
add_library(polygon STATIC ${POLYGON_SRCS})
add_dependencies( polygon lib-dependencies )

View File

@ -18,6 +18,10 @@ add_executable( dxf2idf dxf2idfmain.cpp dxf2idf.cpp
"${CMAKE_SOURCE_DIR}/common/richio.cpp"
)
add_dependencies( idfcyl lib-dependencies )
add_dependencies( idfrect lib-dependencies )
add_dependencies( dxf2idf lib-dependencies )
target_link_libraries( dxf2idf lib_dxf ${wxWidgets_LIBRARIES} )
install( TARGETS idfcyl idfrect dxf2idf