@ -1,10 +1,10 @@
project ( kicad )
project ( kicad )
cmake_minimum_required ( VERSION 2.8.4 FATAL_ERROR )
cmake_minimum_required ( VERSION 2.8.4 FATAL_ERROR )
# b e c a u s e o f h t t p : / / p u b l i c . k i t w a r e . c o m / B u g / v i e w . p h p ? i d = 1 0 3 9 5
# P a t h t o l o c a l C M a k e m o d u l e s .
set ( CMAKE_MODULE_PATH ${ PROJECT_SOURCE_DIR } /CMakeModules )
set ( CMAKE_MODULE_PATH ${ PROJECT_SOURCE_DIR } /CMakeModules )
#
# K i C a d b u i l d o p t i o n s s h o u l d b e a d d e d b e l o w .
@ -15,32 +15,32 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
#
# R u s s i a n G O S T p a t c h
option ( wxUSE_UNICODE "enable/disable building unicode (default OFF)" )
option ( KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)" )
option ( wxUSE_UNICODE "enable/disable building unicode ( default OFF)" )
option ( KICAD_GOST "enable/disable building using GOST notation for multiple gates per package ( default OFF)" )
# f o r t h o s e w h o b o r e d w i t h u p p e r c a s e
option ( KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected" )
option ( KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected" )
option ( USE_WX_GRAPHICS_CONTEXT
" U s e w x G r a p h i c s C o n t e x t f o r rendering ( default OFF ) . W a r n i n g , t h i s i s e x p e r i m e n t a l " )
option ( USE_WX_GRAPHICS_CONTEXT
" U s e w x G r a p h i c s C o n t e x t f o r rendering ( default OFF ) . W a r n i n g , t h i s i s e x p e r i m e n t a l " )
option ( USE_WX_OVERLAY
" U s e w x O v e r l a y : A l w a y s O N f o r MAC ( default OFF ) . W a r n i n g , t h i s i s e x p e r i m e n t a l " )
option ( USE_WX_OVERLAY
" U s e w x O v e r l a y : A l w a y s O N f o r MAC ( default OFF ) . W a r n i n g , t h i s i s e x p e r i m e n t a l " )
# O n e o f t h e s e 2 o p t i o n * m u s t * b e s e t t o O N :
option ( KICAD_STABLE_VERSION
option ( KICAD_STABLE_VERSION
" s e t t h i s o p t i o n t o O N t o b u i l d t h e s t a b l e v e r s i o n o f K I C A D . m a i n l y u s e d t o s e t v e r s i o n ID ( default OFF ) "
)
option ( KICAD_SCRIPTING
option ( KICAD_SCRIPTING
" s e t t h i s o p t i o n O N t o b u i l d t h e s c r i p t i n g s u p p o r t i n s i d e k i c a d b i n a r i e s "
)
option ( KICAD_SCRIPTING_MODULES
option ( KICAD_SCRIPTING_MODULES
" s e t t h i s o p t i o n O N t o b u i l d k i c a d m o d u l e s t h a t c a n b e u s e d f r o m s c r i p t i n g l a n g u a g e s "
)
option ( KICAD_SCRIPTING_WXPYTHON
option ( KICAD_SCRIPTING_WXPYTHON
" s e t t h i s o p t i o n O N t o b u i l d w x p y t h o n i m p l e m e n t a t i o n f o r w x i n t e r f a c e b u i l d i n g i n p y t h o n a n d p y . s h e l l "
)
@ -51,13 +51,16 @@ option(KICAD_SCRIPTING_WXPYTHON
# p y t h o n b i n a r y f i l e s h o u l d b e i s e x e c p a t h .
option ( USE_FP_LIB_TABLE "Use the new footprint library table implementation. (default OFF)" )
option ( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default OFF)" )
# option ( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
# S e t v e r s i o n option ( stable or testing )
if ( KICAD_STABLE_VERSION )
add_definitions ( -DKICAD_STABLE_VERSION )
message ( "Building stable version of KiCad")
if ( KICAD_STABLE_VERSION )
add_definitions ( -DKICAD_STABLE_VERSION )
message ( STATUS "Building stable version of KiCad" )
endif ( )
# A l l C M a k e d o w n l o a d s g o h e r e . S u g g e s t e d i s u p i n t h e s o u r c e t r e e , n o t i n t h e b u i l d d i r w h e r e t h e y
@ -72,14 +75,14 @@ set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
# S e t f l a g s f o r G C C .
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
if ( CMAKE_COMPILER_IS_GNUCXX )
if ( CMAKE_COMPILER_IS_GNUCXX )
set ( KICAD_GCC_RELEASE_BUILD_FLAGS "-O2" )
set ( KICAD_GCC_RELEASE_DEBUG_FLAGS "" )
set ( KICAD_GCC_RELEASE_BUILD_FLAGS "-O2" )
set ( KICAD_GCC_RELEASE_DEBUG_FLAGS "" )
execute_process ( COMMAND ${ CMAKE_C_COMPILER } -dumpversion
execute_process ( COMMAND ${ CMAKE_C_COMPILER } -dumpversion
O U T P U T _ V A R I A B L E G C C _ V E R S I O N
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
# A d d e d - W n o - n a r r o w i n g o n 1 0 / 7 / 1 2 t o p r e v e n t a h u g e n u m b e r o f w a r n i n g s w h e n
# c o m p i l i n g w i t h G C C 4 . 7 . T h i s a p p e a r s t o b e c a u s e d b y a n d i n t t o u n s i g n e d
@ -88,38 +91,38 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# s e e i f t h e p r o b l e m h a s b e e n r e s o l v e d . W a y n e .
#
# A l s o n o t e t h e o p t i m i z a t i o n l e v e l i s - O 1 i n s t e a d o f t h e u s u a l - O 2 l e v e l
# b e c a u s e b o o s t : : p o l y g o n h a s a function ( inflate polygon ) b r o k e n b y
# b e c a u s e b o o s t : : p o l y g o n h a s a function ( inflate polygon ) b r o k e n b y
# t h e - O 2 l e v e l w i t h G C C 4 . 7 ( works fine with with GCC 4.6 ) .
# T h i s l o w e r o p t i m i z a t i o n l e v e l d o e s n o t h a v e a s i g n i f i c a n t c h a n g e o n t h e s p e e d .
#
# A s n e w e r v e r s i o n s o f G C C a n d / o r B o o s t a r e r e l e a s e d , t h i s c o d e n e e d s r e v i e w e d t o
# d e t e r m i n e i f t h e p r o b l e m s a b o v e h a v e b e e n f i x e d e i t h e r i n B o o s t o r G C C .
if ( GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7 )
set ( KICAD_GCC_RELEASE_BUILD_FLAGS "-Wno-narrowing -O1" )
set ( KICAD_GCC_DEBUG_BUILD_FLAGS "-Wno-narrowing" )
if ( GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7 )
set ( KICAD_GCC_RELEASE_BUILD_FLAGS "-Wno-narrowing -O1" )
set ( KICAD_GCC_DEBUG_BUILD_FLAGS "-Wno-narrowing" )
endif ( )
if ( CMAKE_BUILD_TYPE STREQUAL Debug )
message ( STATUS
" S e t t i n g G C C v e r s i o n $ { G C C _ V E R S I O N } b u i l d f l a g s \ " $ { K I C A D _ G C C _ D E B U G _ B U I L D _ F L A G S } \ " " )
if ( CMAKE_BUILD_TYPE STREQUAL Debug )
message ( STATUS
" S e t t i n g G C C v e r s i o n $ { G C C _ V E R S I O N } b u i l d f l a g s \ " $ { K I C A D _ G C C _ D E B U G _ B U I L D _ F L A G S } \ " " )
else ( )
message ( STATUS
" S e t t i n g G C C v e r s i o n $ { G C C _ V E R S I O N } b u i l d f l a g s \ " $ { K I C A D _ G C C _ R E L E A S E _ B U I L D _ F L A G S } \ " " )
message ( STATUS
" S e t t i n g G C C v e r s i o n $ { G C C _ V E R S I O N } b u i l d f l a g s \ " $ { K I C A D _ G C C _ R E L E A S E _ B U I L D _ F L A G S } \ " " )
endif ( )
if ( MINGW )
if ( MINGW )
# A c c o r d i n g t o s o m e s o u r c e s , u n d e r W i n d o w s - f P I C o p t i o n i s n o t n e e d e d :
# h t t p : / / m i n g w . 5 . n 7 . n a b b l e . c o m / O p t i o n - f P I C - n o t - s u p p o r t e d - t d 1 8 4 8 0 . h t m l
# S e t d e f a u l t f l a g s f o r R e l e a s e b u i l d .
set ( CMAKE_C_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
set ( CMAKE_CXX_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -static-libgcc -static-libstdc++" )
set ( CMAKE_C_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
set ( CMAKE_CXX_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -static-libgcc -static-libstdc++" )
# S e t d e f a u l t f l a g s f o r D e b u g b u i l d .
set ( CMAKE_C_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_CXX_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_MODULE_LINKER_FLAGS "-static-libgcc -static-libstdc++" ) # S W I G m a c r o s o n W i n d o w s
set ( CMAKE_C_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_CXX_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_MODULE_LINKER_FLAGS "-static-libgcc -static-libstdc++" ) # S W I G m a c r o s o n W i n d o w s
else ( )
# W e b u i l d D L L / D S O s f r o m s t a t i c l i b r a r i e s , s o c r e a t e p o s i t i o n i n d e p e n d e n t c o d e
@ -129,17 +132,17 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
# T h o u s h a l t n o t l i n k v a p o r w a r e a n d t e l l u s i t ' s a v a l i d D S O :
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) # n e e d e d b y S W I G m a c r o s o n l i n u x
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) # n e e d e d b y S W I G m a c r o s o n l i n u x
# S e t d e f a u l t f l a g s f o r R e l e a s e b u i l d .
set ( CMAKE_C_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
set ( CMAKE_CXX_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
set ( CMAKE_C_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
set ( CMAKE_CXX_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
# S e t d e f a u l t f l a g s f o r D e b u g b u i l d .
set ( CMAKE_C_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_CXX_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_C_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
set ( CMAKE_CXX_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
endif ( )
# q u i e t G C C 4 . 8 . 1 w h i l e i n b o o s t
@ -147,110 +150,109 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
endif ( )
endif ( CMAKE_COMPILER_IS_GNUCXX )
endif ( CMAKE_COMPILER_IS_GNUCXX )
if ( wxUSE_UNICODE )
add_definitions ( -DwxUSE_UNICODE )
if ( wxUSE_UNICODE )
add_definitions ( -DwxUSE_UNICODE )
endif ( )
if ( KICAD_GOST )
add_definitions ( -DKICAD_GOST )
if ( KICAD_GOST )
add_definitions ( -DKICAD_GOST )
endif ( )
if ( KICAD_KEEPCASE )
add_definitions ( -DKICAD_KEEPCASE )
if ( KICAD_KEEPCASE )
add_definitions ( -DKICAD_KEEPCASE )
endif ( )
if ( USE_WX_OVERLAY OR APPLE )
add_definitions ( -DUSE_WX_OVERLAY )
if ( USE_WX_OVERLAY OR APPLE )
add_definitions ( -DUSE_WX_OVERLAY )
endif ( )
if ( KICAD_SCRIPTING )
add_definitions ( -DKICAD_SCRIPTING )
if ( KICAD_SCRIPTING )
add_definitions ( -DKICAD_SCRIPTING )
endif ( )
if ( KICAD_SCRIPTING_MODULES )
add_definitions ( -DKICAD_SCRIPTING_MODULES )
if ( KICAD_SCRIPTING_MODULES )
add_definitions ( -DKICAD_SCRIPTING_MODULES )
endif ( )
if ( KICAD_SCRIPTING_WXPYTHON )
add_definitions ( -DKICAD_SCRIPTING_WXPYTHON )
if ( KICAD_SCRIPTING_WXPYTHON )
add_definitions ( -DKICAD_SCRIPTING_WXPYTHON )
endif ( )
if ( USE_WX_GRAPHICS_CONTEXT )
add_definitions ( -DUSE_WX_GRAPHICS_CONTEXT )
if ( USE_WX_GRAPHICS_CONTEXT )
add_definitions ( -DUSE_WX_GRAPHICS_CONTEXT )
endif ( )
# A l l o w u s e r t o o v e r r i d e t h e d e f a u l t s e t t i n g s f o r a d d i n g i m a g e s t o m e n u i t e m s . B y d e f a u l t
# i m a g e s i n m e n u i t e m s a r e e n a b l e d o n a l l p l a t f o r m s e x c e p t O S X . T h i s c a n b e o v e r r i d d e n b y
# d e f i n i n g - D U S E _ I M A G E S _ I N _ M E N U S = O N / O F F t o f o r c e t h e p r e f e r r e d b e h a v i o r .
if ( NOT DEFINED USE_IMAGES_IN_MENUS )
if ( NOT APPLE )
set ( USE_IMAGES_IN_MENUS ON )
if ( NOT DEFINED USE_IMAGES_IN_MENUS )
if ( NOT APPLE )
set ( USE_IMAGES_IN_MENUS ON )
endif ( )
else ( )
if ( USE_IMAGES_IN_MENUS )
set ( USE_IMAGES_IN_MENUS ON )
if ( USE_IMAGES_IN_MENUS )
set ( USE_IMAGES_IN_MENUS ON )
endif ( )
endif ( )
# L o c a t i o n s f o r i n s t a l l t a r g e t s .
set ( KICAD_BIN bin
C A C H E P A T H " L o c a t i o n o f K i C a d b i n a r i e s . " )
set ( KICAD_BIN bin
C A C H E P A T H " L o c a t i o n o f K i C a d b i n a r i e s . " )
if ( UNIX )
if ( UNIX )
# E v e r y t h i n g w i t h o u t l e a d i n g / i s r e l a t i v e t o C M A K E _ I N S T A L L _ P R E F I X .
set ( KICAD_PLUGINS lib/kicad/plugins
C A C H E P A T H " L o c a t i o n o f K i C a d p l u g i n s . " )
set ( KICAD_DATA share/kicad
C A C H E P A T H " L o c a t i o n o f K i C a d d a t a f i l e s . " )
set ( KICAD_DOCS share/doc/kicad
C A C H E P A T H " L o c a t i o n o f K i C a d d o c u m e n t a t i o n f i l e s . " )
set ( KICAD_PLUGINS lib/kicad/plugins
C A C H E P A T H " L o c a t i o n o f K i C a d p l u g i n s . " )
set ( KICAD_DATA share/kicad
C A C H E P A T H " L o c a t i o n o f K i C a d d a t a f i l e s . " )
set ( KICAD_DOCS share/doc/kicad
C A C H E P A T H " L o c a t i o n o f K i C a d d o c u m e n t a t i o n f i l e s . " )
endif ( )
if ( MINGW )
if ( MINGW )
# L i k e a l l v a r i a b l e s , C M A K E _ I N S T A L L _ P R E F I X c a n b e o v e r - r i d d e n o n t h e c o m m a n d l i n e .
set ( CMAKE_INSTALL_PREFIX c:/kicad
C A C H E P A T H " " )
set ( CMAKE_INSTALL_PREFIX c:/kicad
C A C H E P A T H " " )
# E v e r y t h i n g w i t h o u t l e a d i n g / i s r e l a t i v e t o C M A K E _ I N S T A L L _ P R E F I X .
set ( KICAD_PLUGINS ${ KICAD_BIN } /plugins
C A C H E P A T H " L o c a t i o n o f K i C a d p l u g i n s . " )
set ( KICAD_DATA share
C A C H E P A T H " L o c a t i o n o f K i C a d d a t a f i l e s . " )
set ( KICAD_DOCS doc
C A C H E P A T H " L o c a t i o n o f K i C a d d o c u m e n t a t i o n f i l e s . " )
set ( KICAD_PLUGINS ${ KICAD_BIN } /plugins
C A C H E P A T H " L o c a t i o n o f K i C a d p l u g i n s . " )
set ( KICAD_DATA share
C A C H E P A T H " L o c a t i o n o f K i C a d d a t a f i l e s . " )
set ( KICAD_DOCS doc
C A C H E P A T H " L o c a t i o n o f K i C a d d o c u m e n t a t i o n f i l e s . " )
endif ( )
set ( KICAD_DEMOS ${ KICAD_DATA } /demos
C A C H E P A T H " L o c a t i o n o f K i C a d d e m o f i l e s . " )
set ( KICAD_TEMPLATE ${ KICAD_DATA } /template
C A C H E P A T H " L o c a t i o n o f K i C a d t e m p l a t e f i l e s . " )
set ( KICAD_DEMOS ${ KICAD_DATA } /demos
C A C H E P A T H " L o c a t i o n o f K i C a d d e m o f i l e s . " )
set ( KICAD_TEMPLATE ${ KICAD_DATA } /template
C A C H E P A T H " L o c a t i o n o f K i C a d t e m p l a t e f i l e s . " )
mark_as_advanced ( KICAD_BIN
mark_as_advanced ( KICAD_BIN
K I C A D _ P L U G I N S
K I C A D _ D A T A
K I C A D _ D O C S
K I C A D _ D E M O S
K I C A D _ T E M P L A T E )
K I C A D _ T E M P L A T E )
include ( Functions )
include ( Functions )
include ( ExternalProject )
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# F i n d l i b r a r i e s t h a t a r e n e e d e d t o b u i l d K i C a d .
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
include ( CheckFindPackageResult )
include ( CheckFindPackageResult )
# # # # # # # # # # # # # # # # # # # # # # #
# F i n d O p e n G L l i b r a r y #
# # # # # # # # # # # # # # # # # # # # # # #
find_package ( OpenGL QUIET )
check_find_package_result ( OPENGL_FOUND "OpenGL" )
find_package ( OpenGL QUIET )
check_find_package_result ( OPENGL_FOUND "OpenGL" )
# # # # # # # # # # # # # # # # # # # # # # # # # #
# D o w n l o a d B o o s t l i b r a r y #
# # # # # # # # # # # # # # # # # # # # # # # # # #
# D o w n l o a d b o o s t a n d p o s s i b l y b u i l d p a r t s o f i t
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
include ( download_boost )
@ -262,85 +264,100 @@ include( download_boost )
# h t t p : / / w w w . w x w i d g e t s . o r g / m a n u a l s / 2 . 8 / w x _ l i b r a r i e s l i s t . h t m l
# O n A p p l e o n l y w x w i d g e t s 2 . 9 o r h i g h e r d o e s n ' t n e e d t o f i n d a u i p a r t o f b a s e
if ( APPLE )
find_package ( wxWidgets COMPONENTS gl adv html core net base xml QUIET )
else ( APPLE )
find_package ( wxWidgets COMPONENTS gl aui adv html core net base xml QUIET )
endif ( APPLE )
check_find_package_result ( wxWidgets_FOUND "wxWidgets" )
if ( APPLE )
find_package ( wxWidgets COMPONENTS gl adv html core net base xml QUIET )
else ( APPLE )
find_package ( wxWidgets COMPONENTS gl aui adv html core net base xml QUIET )
endif ( APPLE )
check_find_package_result ( wxWidgets_FOUND "wxWidgets" )
# I n c l u d e w x W i d g e t s m a c r o s .
include ( ${ wxWidgets_USE_FILE } )
include ( ${ wxWidgets_USE_FILE } )
# I n c l u d e M i n G W r e s o u r c e c o m p i l e r .
include ( MinGWResourceCompiler )
include ( MinGWResourceCompiler )
# G e n e r a t e b u i l d s y s t e m s p e c i f i c h e a d e r f i l e .
include ( PerformFeatureChecks )
include ( PerformFeatureChecks )
perform_feature_checks ( )
# F i n d G D I + o n w i n d o w s i f w x G r a p h i c s C o n t e x t i s a v a i l a b l e .
if ( MINGW AND USE_WX_GRAPHICS_CONTEXT )
find_package ( GdiPlus )
check_find_package_result ( GDI_PLUS_FOUND "GDI+" )
if ( MINGW AND USE_WX_GRAPHICS_CONTEXT )
find_package ( GdiPlus )
check_find_package_result ( GDI_PLUS_FOUND "GDI+" )
endif ( )
# A s s i s t w i t h h e a d e r f i l e s e a r c h i n g o p t i m i z a t i o n :
# I N C _ B E F O R E a n d I N C _ A F T E R a r e t w o l i s t s w h i c h g o a t t h e f r o n t a n d b a c k o f t h e
# h e a d e r f i l e s e a r c h l i s t s , r e s p e c t i v e l y .
# I N C _ B E F O R E i s f o r u s e w i t h " include_directories ( BEFORE ... ) " , w h i c h _ r e v e r s e s _
# t h e o r d e r d u r i n g i n s e r t i o n . ( S o p u t f i r s t w a n t e d l a s t , w h i c h i s
# $ { C M A K E _ S O U R C E _ D I R / i n c l u d e . ) U s e ' . ' f o r c u r r e n t s o u r c e d i r s i n c e
# w e d o n ' t w a n t e x p a n s i o n h e r e a n d n o w , w h i c h w o u l d h a p p e n i f u s i n g $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } .
# I n s t e a d w e u s e ' . ' w h i c h i s a p p l i c a b l e t o a n y s o u r c e d i r e c t o r y b e l o w h e r e a s a r e s u l t o f
# t h i s l a c k o f e x p a n s i o n .
set ( INC_BEFORE
.
$ { C M A K E _ S O U R C E _ D I R } / i n c l u d e
)
set ( INC_AFTER
$ { B o o s t _ I N C L U D E _ D I R }
# i n c l u d e < c o n f i g . h >
$ { C M A K E _ B I N A R Y _ D I R }
)
# F i n d P y t h o n a n d o t h e r s c r i p t i n g r e s o u r c e s
if ( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
set ( PythonInterp_FIND_VERSION )
find_package ( PythonInterp )
check_find_package_result ( PYTHONINTERP_FOUND "Python Interpreter" )
if ( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
set ( PythonInterp_FIND_VERSION )
find_package ( PythonInterp )
check_find_package_result ( PYTHONINTERP_FOUND "Python Interpreter" )
# G e t t h e c o r r e c t P y t h o n s i t e p a c k a g e i n s t a l l p a t h f r o m t h e P y t h o n i n t e r p r e t e r f o u n d b y
# F i n d P y t h o n I n t e r p u n l e s s t h e u s e r s p e c i f i c a l l y d e f i n e d a c u s t o m p a t h .
if ( NOT PYTHON_SITE_PACKAGE_PATH )
execute_process ( COMMAND ${ PYTHON_EXECUTABLE } -c "import distutils.sysconfig;print\" %s\ "%distutils.sysconfig.get_python_lib()"
if ( NOT PYTHON_SITE_PACKAGE_PATH )
execute_process ( COMMAND ${ PYTHON_EXECUTABLE } -c "import distutils.sysconfig;print\" %s\ "%distutils.sysconfig.get_python_lib()"
O U T P U T _ V A R I A B L E P Y T H O N _ S I T E _ P A C K A G E _ P A T H
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
if ( NOT PYTHON_SITE_PACKAGE_PATH )
message ( FATAL_ERROR "Error occurred while attemping to find the Python site library path." )
if ( NOT PYTHON_SITE_PACKAGE_PATH )
message ( FATAL_ERROR "Error occurred while attemping to find the Python site library path." )
endif ( )
endif ( )
set ( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}" CACHE PATH "Python module install path." )
mark_as_advanced ( PYTHON_DEST )
message ( STATUS "Python module install path: ${PYTHON_DEST}" )
find_package ( PythonLibs )
include_directories ( ${ PYTHON_INCLUDE_DIRS }
. / s c r i p t i n g )
endif ( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
set ( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}" CACHE PATH "Python module install path." )
mark_as_advanced ( PYTHON_DEST )
message ( STATUS "Python module install path: ${PYTHON_DEST}" )
find_package ( PythonLibs )
# message ( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )
# I n f r e q u e n t l y n e e d e d h e a d e r s g o a t e n d o f s e a r c h p a t h s , a p p e n d t o I N C _ A F T E R w h i c h
# a l t h o u g h i s u s e d f o r a l l c o m p o n e n t s , s h o u l d b e a h a r m l e s s h i t f o r s o m e t h i n g l i k e e e s c h e m a
# s o l o n g a s u n u s e d s e a r c h p a t h s a r e a t t h e e n d l i k e t h i s .
set ( INC_AFTER ${ INC_AFTER } ${ PYTHON_INCLUDE_DIRS } ${ CMAKE_CURRENT_SOURCE_DIR } /scripting )
# message ( STATUS "/ INC_AFTER:${INC_AFTER}" )
endif ( )
# A u t o m a g i c a l l y c r e a t e v e r s i o n h e a d e r f i l e .
include ( CreateBzrVersionHeader )
include ( CreateBzrVersionHeader )
create_bzr_version_header ( )
if ( EXISTS ${ CMAKE_SOURCE_DIR } /include/config.h )
# T h i s f i l e m a y exist ( created by an alternate process to the svn test above ) ,
if ( EXISTS ${ CMAKE_SOURCE_DIR } /include/config.h )
# T h i s f i l e m a y exist ( created by an alternate process to the svn test above ) ,
# e . g . c o u l d b e c r e a t e d b y a c h e c k o u t s c r i p t t h a t p r o d u c e s a s o u r c e t a r f i l e .
# T h i s d i r e c t i v e m e a n s t h e a b o u t b o x w i l l h a v e t h e s v n d a t e & r e v i s i o n i n i t ,
# b u t t h e h a r d c o d e d r e l e a s e date ( program version ) w i l l b e p r e s e r v e d .
add_definitions ( -DHAVE_SVN_REVISION )
# b u t t h e h a r d c o d e d r e l e a s e date ( program version ) w i l l b e p r e s e r v e d .
add_definitions ( -DHAVE_SVN_REVISION )
endif ( )
# F o r include_directories ( BEFORE ... ) , w h i c h _ r e v e r s e s _
# t h e o r d e r d u r i n g i n s e r t i o n , s o p u t f i r s t w a n t e d l a s t , w h i c h i s
# $ { C M A K E _ S O U R C E _ D I R / i n c l u d e . U s e ' . ' f o r c u r r e n t s o u r c e d i r s i n c e
# w e d o n ' t w a n t e x p a n s i o n h e r e a n d n o w , a n d d o n ' t n e e d e x p a n s i o n o f
# $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } , ' . ' w i l l w o r k f o r a n y s o u r c e d i r e c t o r y .
set ( INC_BEFORE
.
$ { C M A K E _ S O U R C E _ D I R } / i n c l u d e
)
set ( INC_AFTER
# i n c l u d e < c o n f i g . h >
$ { C M A K E _ B I N A R Y _ D I R }
)
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# L e t C M a k e l o o k i n t h e s e d i r e c t o r i e s f o r n e s t e d
@ -348,29 +365,28 @@ set(INC_AFTER
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Binaries ( CMake targets ) #
# Binaries ( CMake targets ) #
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
add_subdirectory ( bitmaps_png )
add_subdirectory ( common )
add_subdirectory ( 3d-viewer )
add_subdirectory ( cvpcb )
add_subdirectory ( eeschema )
add_subdirectory ( gerbview )
add_subdirectory ( kicad )
add_subdirectory ( pcbnew )
add_subdirectory ( pcbnew/pcad2kicadpcb_plugin )
add_subdirectory ( polygon )
add_subdirectory ( pagelayout_editor )
add_subdirectory ( potrace )
add_subdirectory ( bitmap2component )
add_subdirectory ( pcb_calculator )
add_subdirectory ( tools )
# add_subdirectory ( new )
add_subdirectory ( bitmaps_png )
add_subdirectory ( common )
add_subdirectory ( 3d-viewer )
add_subdirectory ( cvpcb )
add_subdirectory ( eeschema )
add_subdirectory ( gerbview )
add_subdirectory ( kicad )
add_subdirectory ( pcbnew )
add_subdirectory ( polygon )
add_subdirectory ( pagelayout_editor )
add_subdirectory ( potrace )
add_subdirectory ( bitmap2component )
add_subdirectory ( pcb_calculator )
add_subdirectory ( tools )
# add_subdirectory ( new )
# M a k e a l l l i b s a n d e x e c u t a b l e s d e p e n d o n ExternalProject_Add ( boost ) ,
# e x c e p t p e r h a p s b i t m a p l i b
# e x c e p t p e r h a p s b i t m a p l i b . T h i s a l l o w s a m u l t i - t h r e a d e d b u i l d t o s u c c e e d .
add_dependencies ( pcbnew boost )
add_dependencies ( eeschema boost )
add_dependencies ( cvpcb boost )
@ -385,14 +401,14 @@ add_dependencies( pl_editor boost )
# # # # # # # # # # # # #
# R e s o u r c e s #
# # # # # # # # # # # # #
add_subdirectory ( demos )
add_subdirectory ( template )
add_subdirectory ( demos )
add_subdirectory ( template )
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# D o x y g e n O u t p u t
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
find_package ( Doxygen )
if ( DOXYGEN_FOUND )
find_package ( Doxygen )
if ( DOXYGEN_FOUND )
add_custom_target ( doxygen-docs
$ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y D o c u m e n t a t i o n / d o x y g e n
C O M M A N D $ { D O X Y G E N _ E X E C U T A B L E }
@ -411,67 +427,67 @@ endif()
configure_file (
" $ { C M A K E _ M O D U L E _ P A T H } / c m a k e _ u n i n s t a l l . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e "
I M M E D I A T E @ O N L Y )
I M M E D I A T E @ O N L Y )
add_custom_target ( uninstall
" $ { C M A K E _ C O M M A N D } " - P " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e " )
add_custom_target ( uninstall
" $ { C M A K E _ C O M M A N D } " - P " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e " )
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# I n s t a l l a t i o n p a r a m e t e r s
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
install ( FILES INSTALL.txt
install ( FILES INSTALL.txt
D E S T I N A T I O N $ { K I C A D _ D O C S }
C O M P O N E N T r e s o u r c e s )
C O M P O N E N T r e s o u r c e s )
install ( FILES resources/freeroute.jnlp
install ( FILES resources/freeroute.jnlp
D E S T I N A T I O N $ { K I C A D _ B I N }
C O M P O N E N T r e s o u r c e s )
C O M P O N E N T r e s o u r c e s )
# # #
# I n s t a l l s c r i p t s
# # #
if ( UNIX )
install ( DIRECTORY scripts
if ( UNIX )
install ( DIRECTORY scripts
D E S T I N A T I O N $ { K I C A D _ D O C S }
C O M P O N E N T r e s o u r c e s
P A T T E R N " . s v n " E X C L U D E )
P A T T E R N " . s v n " E X C L U D E )
endif ( )
# # #
# F r e e D e s k t o p . d e s k t o p a n d M I M E r e s o u r c e s
# # #
if ( UNIX )
if ( UNIX )
# S e t p a t h s
set ( UNIX_MIME_DIR resources/linux/mime )
set ( UNIX_MIMELNK_FILES ${ UNIX_MIME_DIR } /mimelnk )
set ( UNIX_MIME_FILES ${ UNIX_MIME_DIR } /mime )
set ( UNIX_ICONS_FILES ${ UNIX_MIME_DIR } /icons )
set ( UNIX_APPLICATIONS_FILES ${ UNIX_MIME_DIR } /applications )
set ( UNIX_MIME_DIR resources/linux/mime )
set ( UNIX_MIMELNK_FILES ${ UNIX_MIME_DIR } /mimelnk )
set ( UNIX_MIME_FILES ${ UNIX_MIME_DIR } /mime )
set ( UNIX_ICONS_FILES ${ UNIX_MIME_DIR } /icons )
set ( UNIX_APPLICATIONS_FILES ${ UNIX_MIME_DIR } /applications )
# I n s t a l l M i m e l n k d i r e c t o r y
install ( DIRECTORY ${ UNIX_MIMELNK_FILES }
install ( DIRECTORY ${ UNIX_MIMELNK_FILES }
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e
C O M P O N E N T r e s o u r c e s
P A T T E R N " . s v n " E X C L U D E )
P A T T E R N " . s v n " E X C L U D E )
# I n s t a l l M i m e d i r e c t o r y
install ( DIRECTORY ${ UNIX_ICONS_FILES }
install ( DIRECTORY ${ UNIX_ICONS_FILES }
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e
C O M P O N E N T r e s o u r c e s
P A T T E R N " . s v n " E X C L U D E )
P A T T E R N " . s v n " E X C L U D E )
# I n s t a l l I c o n s
install ( DIRECTORY ${ UNIX_MIME_FILES }
install ( DIRECTORY ${ UNIX_MIME_FILES }
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e
C O M P O N E N T r e s o u r c e s
P A T T E R N " . s v n " E X C L U D E )
P A T T E R N " . s v n " E X C L U D E )
# I n s t a l l A p p l i c a t i o n s directory ( .desktop files )
install ( DIRECTORY ${ UNIX_APPLICATIONS_FILES }
install ( DIRECTORY ${ UNIX_APPLICATIONS_FILES }
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e
C O M P O N E N T r e s o u r c e s
P A T T E R N " . s v n " E X C L U D E )
P A T T E R N " . s v n " E X C L U D E )
endif ( )
include ( CTest )
include ( CTest )