Commit 932c92af authored by Marco Serantoni's avatar Marco Serantoni

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

parent bd52f006
...@@ -343,16 +343,17 @@ add_definitions(-DWX_COMPATIBILITY) ...@@ -343,16 +343,17 @@ add_definitions(-DWX_COMPATIBILITY)
find_package( OpenGL QUIET ) find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" ) 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 ) 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_pcre )
include( download_swig ) 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") #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
...@@ -372,15 +373,11 @@ add_custom_target( lib-wxpython ) ...@@ -372,15 +373,11 @@ add_custom_target( lib-wxpython )
message(STATUS "KICAD_BUILD_DYNAMIC set") message(STATUS "KICAD_BUILD_DYNAMIC set")
endif() 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 ) if( KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES )
message(STATUS "Scripting ENABLED") message(STATUS "Scripting ENABLED")
include( download_wxpython )
set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig ) set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig )
set( SWIG_INCLUDE ${SWIG_ROOT}/include ) set( SWIG_INCLUDE ${SWIG_ROOT}/include )
...@@ -388,7 +385,7 @@ add_custom_target( lib-wxpython ) ...@@ -388,7 +385,7 @@ add_custom_target( lib-wxpython )
if( NOT EXISTS ${SWIG_EXECUTABLE} ) if( NOT EXISTS ${SWIG_EXECUTABLE} )
set(KICAD_SCRIPTING CACHE OFF FORCE "Disabling KICAD_SCRIPTING") 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!") message( FATAL_ERROR "Missing SWIG!")
endif() endif()
message(STATUS "SWIG_EXECUTABLE: ${SWIG_EXECUTABLE}") message(STATUS "SWIG_EXECUTABLE: ${SWIG_EXECUTABLE}")
...@@ -401,11 +398,15 @@ add_custom_target( lib-wxpython ) ...@@ -401,11 +398,15 @@ add_custom_target( lib-wxpython )
set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib ) set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib )
add_dependencies( lib-dependencies libwxpython ) add_dependencies( lib-dependencies libwxpython )
add_dependencies( lib-dependencies swig )
else() else()
include( download_wxwidgets ) include( download_wxwidgets )
add_dependencies( lib-dependencies libwx ) add_dependencies( lib-dependencies libwx )
endif() endif()
include( download_libpng )
include( download_pkgconfig ) include( download_pkgconfig )
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" ) set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
include( download_glew ) include( download_glew )
...@@ -417,6 +418,12 @@ add_custom_target( lib-wxpython ) ...@@ -417,6 +418,12 @@ add_custom_target( lib-wxpython )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" ) set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" ) 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 ) 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_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") 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 ) ...@@ -623,17 +630,13 @@ if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pcbnew lib-dependencies ) add_dependencies( pcbnew lib-dependencies )
add_dependencies( eeschema lib-dependencies ) add_dependencies( eeschema lib-dependencies )
add_dependencies( cvpcb lib-dependencies ) add_dependencies( cvpcb lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( common lib-dependencies ) add_dependencies( common lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( pcbcommon lib-dependencies ) add_dependencies( pcbcommon lib-dependencies )
add_dependencies( 3d-viewer lib-dependencies ) add_dependencies( 3d-viewer lib-dependencies )
add_dependencies( pcad2kicadpcb lib-dependencies ) add_dependencies( pcad2kicadpcb lib-dependencies )
add_dependencies( polygon lib-dependencies )
add_dependencies( pl_editor lib-dependencies ) add_dependencies( pl_editor lib-dependencies )
add_dependencies( pnsrouter lib-dependencies ) add_dependencies( pnsrouter lib-dependencies )
if ( BUILD_GITHUB_PLUGIN )
add_dependencies( github_plugin lib-dependencies )
endif()
endif() endif()
if ( KICAD_BUILD_DYNAMIC ) if ( KICAD_BUILD_DYNAMIC )
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
set( PCRE_RELEASE 8.34 ) set( PCRE_RELEASE 8.34 )
set( PCRE_MD5 eb34b2c9c727fd64940d6fd9a00995eb ) # re-calc this on every RELEASE change 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" ) set( PCRE_ROOT "${PROJECT_SOURCE_DIR}/pcre_root" )
#-----</configure>--------------------------------------------------------------- #-----</configure>---------------------------------------------------------------
...@@ -45,10 +43,6 @@ if (APPLE) ...@@ -45,10 +43,6 @@ if (APPLE)
endif( CMAKE_OSX_ARCHITECTURES ) endif( CMAKE_OSX_ARCHITECTURES )
endif(APPLE) 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 ExternalProject_Add( pcre
PREFIX "${PREFIX}" PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}" DOWNLOAD_DIR "${DOWNLOAD_DIR}"
......
...@@ -37,11 +37,11 @@ Building Kicad with support for Scripting ...@@ -37,11 +37,11 @@ Building Kicad with support for Scripting
then issue for example then issue for example
cmake -DKICAD_BUILD_DYNAMIC=ON . cmake -DKICAD_BUILD_DYNAMIC=ON .
make lib-wxpython make swig
After successfully building you can set your KICAD_SCRIPTING* options (for example): 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 make
The system will build all accordling your choices and package all in the bundle The system will build all accordling your choices and package all in the bundle
......
...@@ -57,6 +57,10 @@ set( GAL_SRCS ...@@ -57,6 +57,10 @@ set( GAL_SRCS
add_library( gal STATIC ${GAL_SRCS} ) add_library( gal STATIC ${GAL_SRCS} )
add_dependencies( gal shader_headers ) add_dependencies( gal shader_headers )
add_dependencies( gal lib-dependencies )
add_dependencies( shader_headers lib-dependencies )
# Only for win32 cross compilation using MXE # Only for win32 cross compilation using MXE
if( WIN32 AND MSYS ) if( WIN32 AND MSYS )
add_definitions( -DGLEW_STATIC ) add_definitions( -DGLEW_STATIC )
...@@ -183,6 +187,7 @@ set( COMMON_SRCS ...@@ -183,6 +187,7 @@ set( COMMON_SRCS
add_library( common STATIC ${COMMON_SRCS} ) add_library( common STATIC ${COMMON_SRCS} )
add_dependencies( common lib-dependencies )
set( PCB_COMMON_SRCS set( PCB_COMMON_SRCS
base_screen.cpp base_screen.cpp
...@@ -249,6 +254,7 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES ...@@ -249,6 +254,7 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
) )
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} ) add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
add_dependencies( pcbcommon lib-dependencies )
# auto-generate specctra_lexer.h and specctra_keywords.cpp # auto-generate specctra_lexer.h and specctra_keywords.cpp
make_lexer( make_lexer(
...@@ -315,3 +321,6 @@ make_lexer( ...@@ -315,3 +321,6 @@ make_lexer(
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp # to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp ) add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt ) target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
add_dependencies( dsntest lib-dependencies )
...@@ -502,8 +502,8 @@ void EDA_APP::SetDefaultSearchPaths() ...@@ -502,8 +502,8 @@ void EDA_APP::SetDefaultSearchPaths()
#ifdef __WXMSW__ #ifdef __WXMSW__
tmp.AddEnvList( wxT( "PROGRAMFILES" ) ); tmp.AddEnvList( wxT( "PROGRAMFILES" ) );
#elif __WXMAC__ #elif __WXMAC__
tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support" ) ); tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support/kicad/" ) );
tmp.Add( wxT( "/Library/Application Support" ) ); tmp.Add( wxT( "/Library/Application Support/kicad/" ) );
#else #else
tmp.AddEnvList( wxT( "PATH" ) ); tmp.AddEnvList( wxT( "PATH" ) );
#endif #endif
......
...@@ -513,6 +513,7 @@ make_lexer( ...@@ -513,6 +513,7 @@ make_lexer(
add_subdirectory( pcad2kicadpcb_plugin ) add_subdirectory( pcad2kicadpcb_plugin )
if( BUILD_GITHUB_PLUGIN ) if( BUILD_GITHUB_PLUGIN )
add_subdirectory( github ) add_subdirectory( github )
add_dependencies( github_plugin lib-dependencies )
endif() endif()
...@@ -526,6 +527,7 @@ add_executable( pcbnew WIN32 MACOSX_BUNDLE ...@@ -526,6 +527,7 @@ add_executable( pcbnew WIN32 MACOSX_BUNDLE
${PCBNEW_RESOURCES} ${PCBNEW_RESOURCES}
) )
add_dependencies( pcbnew lib-dependencies )
### ###
# Set properties for APPLE on pcbnew target # Set properties for APPLE on pcbnew target
### ###
......
...@@ -1077,7 +1077,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1077,7 +1077,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
#ifndef USE_WX_OVERLAY #ifndef USE_WX_OVERLAY
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), &dc ); InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), &dc );
#else #else
// #1267772 - Draw into dialog converted in refresh request // #1277772 - Draw into dialog converted in refresh request
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), NULL ); InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), NULL );
m_canvas->Refresh(); m_canvas->Refresh();
#endif #endif
......
...@@ -29,3 +29,5 @@ set( PCAD2PCBNEW_SRCS ...@@ -29,3 +29,5 @@ set( PCAD2PCBNEW_SRCS
) )
add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} ) add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} )
add_dependencies( pcad2kicadpcb lib-dependencies )
...@@ -48,4 +48,3 @@ set( PCBNEW_PNS_SRCS ...@@ -48,4 +48,3 @@ set( PCBNEW_PNS_SRCS
) )
add_library( pnsrouter STATIC ${PCBNEW_PNS_SRCS} ) add_library( pnsrouter STATIC ${PCBNEW_PNS_SRCS} )
...@@ -18,3 +18,6 @@ set(POLYGON_SRCS ...@@ -18,3 +18,6 @@ set(POLYGON_SRCS
) )
add_library(polygon STATIC ${POLYGON_SRCS}) add_library(polygon STATIC ${POLYGON_SRCS})
add_dependencies( polygon lib-dependencies )
...@@ -18,6 +18,10 @@ add_executable( dxf2idf dxf2idfmain.cpp dxf2idf.cpp ...@@ -18,6 +18,10 @@ add_executable( dxf2idf dxf2idfmain.cpp dxf2idf.cpp
"${CMAKE_SOURCE_DIR}/common/richio.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} ) target_link_libraries( dxf2idf lib_dxf ${wxWidgets_LIBRARIES} )
install( TARGETS idfcyl idfrect dxf2idf install( TARGETS idfcyl idfrect dxf2idf
......
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