2008-03-11 15:57:54 +00:00
|
|
|
project(kicad)
|
2008-01-06 21:56:45 +00:00
|
|
|
|
2011-06-17 13:24:22 +00:00
|
|
|
# The minimum CMake version requirement could be different under unix, OSX, or Windows
|
2008-09-07 19:32:07 +00:00
|
|
|
if(WIN32)
|
2011-06-17 13:24:22 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # win32 and win64
|
|
|
|
elseif(APPLE)
|
|
|
|
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # OSX
|
2008-09-07 19:32:07 +00:00
|
|
|
else(WIN32)
|
2011-06-17 13:24:22 +00:00
|
|
|
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) # Linux, Unix, and everything else.
|
2008-09-07 19:32:07 +00:00
|
|
|
endif(WIN32)
|
2008-01-06 21:56:45 +00:00
|
|
|
|
2008-03-31 01:32:15 +00:00
|
|
|
# Path to local CMake modules.
|
2008-03-11 15:57:54 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2011-10-05 18:26:22 +00:00
|
|
|
#
|
2011-10-07 14:41:30 +00:00
|
|
|
# KiCad build options should be added below.
|
2011-10-05 18:26:22 +00:00
|
|
|
#
|
|
|
|
# If you add a new build option, please add it's state to the CopyVersionInfoToClipboard()
|
2012-10-16 01:42:50 +00:00
|
|
|
# function in common/basicframe.cpp so that build option settings can be included in bug
|
2011-10-05 18:26:22 +00:00
|
|
|
# reports.
|
|
|
|
#
|
|
|
|
|
2012-04-07 18:05:56 +00:00
|
|
|
option(USE_PCBNEW_SEXPR_FILE_FORMAT
|
2012-10-07 15:37:25 +00:00
|
|
|
"Use Pcbnew s-expression file format support (default OFF)." )
|
2011-09-08 06:58:52 +00:00
|
|
|
|
2012-04-01 20:51:56 +00:00
|
|
|
option(USE_PCBNEW_NANOMETRES
|
2012-10-15 05:21:31 +00:00
|
|
|
"Use nanometers for Pcbnew internal units instead of deci-mils (default ON)." ON)
|
2011-12-07 05:28:49 +00:00
|
|
|
|
2012-10-07 15:37:25 +00:00
|
|
|
option(USE_PCBNEW_SEXPR_FOOTPRINT_LIBS
|
|
|
|
"Use Pcbnew s-expression footprint library format (default OFF).")
|
|
|
|
|
2010-02-02 07:18:40 +00:00
|
|
|
# Russian GOST patch
|
2008-11-05 11:41:15 +00:00
|
|
|
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
|
2009-05-05 17:32:07 +00:00
|
|
|
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
|
2008-11-05 11:41:15 +00:00
|
|
|
|
2010-10-22 15:02:11 +00:00
|
|
|
#for those who bored with uppercase
|
|
|
|
option(KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected")
|
|
|
|
|
2010-02-08 18:15:42 +00:00
|
|
|
option(USE_WX_GRAPHICS_CONTEXT
|
2010-07-31 12:26:07 +00:00
|
|
|
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental")
|
2009-11-05 08:52:41 +00:00
|
|
|
|
2010-10-09 08:08:29 +00:00
|
|
|
option(USE_WX_OVERLAY
|
|
|
|
"Use wxOverlay: Always ON for MAC (default OFF). Warning, this is experimental")
|
|
|
|
|
2011-04-09 18:53:39 +00:00
|
|
|
#One of these 2 option *must* be set to ON:
|
|
|
|
option(KICAD_STABLE_VERSION
|
|
|
|
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)"
|
|
|
|
)
|
|
|
|
|
|
|
|
option(KICAD_TESTING_VERSION
|
|
|
|
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)"
|
|
|
|
)
|
|
|
|
|
2012-03-17 15:17:13 +00:00
|
|
|
option(KICAD_SCRIPTING
|
|
|
|
"set this option ON to build the scripting support inside kicad binaries"
|
|
|
|
)
|
|
|
|
|
|
|
|
option(KICAD_SCRIPTING_MODULES
|
|
|
|
"set this option ON to build kicad modules that can be used from scripting languages"
|
|
|
|
)
|
2012-08-04 11:47:24 +00:00
|
|
|
|
2012-08-02 17:24:53 +00:00
|
|
|
option(KICAD_SCRIPTING_WXPYTHON
|
|
|
|
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
|
2012-08-01 11:54:20 +00:00
|
|
|
)
|
2012-08-04 11:47:24 +00:00
|
|
|
|
2012-09-30 17:50:17 +00:00
|
|
|
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
|
|
|
|
# PYTHON_EXECUTABLE can be defined when invoking cmake
|
|
|
|
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
|
|
|
|
# when not defined by user, the default is python.exe under Windows and python2 for others
|
|
|
|
# python binary filee should be is exec path.
|
|
|
|
|
2012-03-17 15:17:13 +00:00
|
|
|
|
2011-04-09 18:53:39 +00:00
|
|
|
#Set version option (stable or testing)
|
|
|
|
|
|
|
|
if (KICAD_STABLE_VERSION )
|
|
|
|
if ( KICAD_TESTING_VERSION )
|
|
|
|
message( FATAL_ERROR
|
|
|
|
"Please set to ON only one option KICAD_TESTING_VERSION or KICAD_STABLE_VERSION" )
|
|
|
|
endif( KICAD_TESTING_VERSION )
|
|
|
|
add_definitions(-DKICAD_STABLE_VERSION)
|
|
|
|
message( "Build stable version of Kicad" )
|
|
|
|
else (KICAD_STABLE_VERSION )
|
|
|
|
if (KICAD_TESTING_VERSION )
|
|
|
|
add_definitions(-DKICAD_TESTING_VERSION)
|
|
|
|
message( "Build testing (unstable) version of Kicad" )
|
|
|
|
else (KICAD_TESTING_VERSION )
|
|
|
|
message( "Please set to ON one option of KICAD_TESTING_VERSION or KICAD_STABLE_VERSION" )
|
2011-04-11 11:45:16 +00:00
|
|
|
message( "When calling cmake add option -DKICAD_STABLE_VERSION=ON" )
|
|
|
|
message( "or add option -DKICAD_TESTING_VERSION=ON" )
|
2011-04-09 18:53:39 +00:00
|
|
|
message( FATAL_ERROR "one option of KICAD_TESTING_VERSION or KICAD_STABLE_VERSION must be defined" )
|
|
|
|
endif(KICAD_TESTING_VERSION )
|
|
|
|
endif(KICAD_STABLE_VERSION )
|
|
|
|
|
2012-04-07 18:05:56 +00:00
|
|
|
# Nanometers must be enabled when USE_PCBNEW_SEXPR_FILE_FORMAT=ON.
|
2012-08-15 17:55:48 +00:00
|
|
|
if( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
|
|
|
|
set( TMP "The Pcbnew s-expression file format requires nano-meter internal units to be " )
|
|
|
|
set( TMP "${TMP} enabled using -DUSE_PCBNEW_NANOMETRES=ON." )
|
|
|
|
message( FATAL_ERROR ${TMP} )
|
|
|
|
endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
|
2011-04-09 18:53:39 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
2008-03-31 01:32:15 +00:00
|
|
|
# Set flags for GCC.
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
|
|
|
|
2008-03-11 15:57:54 +00:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
2012-10-16 01:42:50 +00:00
|
|
|
set(KICAD_GCC_RELEASE_BUILD_FLAGS "-O2")
|
|
|
|
set(KICAD_GCC_RELEASE_DEBUG_FLAGS "")
|
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
|
|
|
OUTPUT_VARIABLE GCC_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
2012-10-07 15:37:25 +00:00
|
|
|
# Added -Wno-narrowing on 10/7/12 to prevent a huge number of warnings when
|
|
|
|
# compiling with GCC 4.7. This appears to be caused by and int to unsigned
|
|
|
|
# conversion in the Boost polygon library. At some point in the future when
|
|
|
|
# Boost is updated to the next version, -Wno-narrowing should be removed to
|
|
|
|
# see if the problem has been resolved. Wayne.
|
2012-10-14 16:57:11 +00:00
|
|
|
#
|
|
|
|
# Also note the optimization level is -O1 instead of the usual -O2 level
|
|
|
|
# because boost::polygon has a function (inflate polygon) broken by
|
|
|
|
# the -O2 level with GCC 4.7 (works fine with with GCC 4.6).
|
|
|
|
# This lower optimization level does not have a significant change on the speed.
|
|
|
|
#
|
2012-10-16 01:42:50 +00:00
|
|
|
# As newer versions of GCC and/or Boost are released, this code needs reviewed to
|
|
|
|
# determine if the problems above have been fixed either in Boost or GCC.
|
|
|
|
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
|
|
|
|
"Setting GCC version ${GCC_VERSION} build flags \"${KICAD_GCC_DEBUG_BUILD_FLAGS}\"")
|
|
|
|
else(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
message(STATUS
|
|
|
|
"Setting GCC version ${GCC_VERSION} build flags \"${KICAD_GCC_RELEASE_BUILD_FLAGS}\"")
|
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
|
2012-07-16 14:48:51 +00:00
|
|
|
if(WIN32) # under Windows/mingw, -fPIC option is enabled by default
|
|
|
|
# Set default flags for Release build.
|
2012-10-16 01:42:50 +00:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG")
|
2012-07-16 14:48:51 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
|
|
|
|
|
|
|
|
# Set default flags for Debug build.
|
2012-10-16 01:42:50 +00:00
|
|
|
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")
|
2012-07-16 14:48:51 +00:00
|
|
|
else(WIN32)
|
|
|
|
# Set default flags for Release build.
|
2012-10-16 05:28:39 +00:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG -fPIC")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG -fPIC")
|
2012-07-16 14:48:51 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
|
|
|
|
|
|
|
|
# Set default flags for Debug build.
|
2012-10-16 01:42:50 +00:00
|
|
|
set(CMAKE_C_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG -fPIC")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG -fPIC")
|
2012-07-16 14:48:51 +00:00
|
|
|
endif(WIN32)
|
2011-09-10 17:48:35 +00:00
|
|
|
|
2008-03-11 15:57:54 +00:00
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2008-11-05 11:41:15 +00:00
|
|
|
if(wxUSE_UNICODE)
|
|
|
|
add_definitions(-DwxUSE_UNICODE)
|
|
|
|
endif(wxUSE_UNICODE)
|
|
|
|
|
|
|
|
if(KICAD_GOST)
|
|
|
|
add_definitions(-DKICAD_GOST)
|
|
|
|
endif(KICAD_GOST)
|
|
|
|
|
2010-10-22 15:02:11 +00:00
|
|
|
if(KICAD_KEEPCASE)
|
|
|
|
add_definitions(-DKICAD_KEEPCASE)
|
|
|
|
endif(KICAD_KEEPCASE)
|
|
|
|
|
2010-10-09 08:08:29 +00:00
|
|
|
if(USE_WX_OVERLAY OR APPLE)
|
|
|
|
add_definitions(-DUSE_WX_OVERLAY)
|
|
|
|
endif(USE_WX_OVERLAY OR APPLE)
|
|
|
|
|
2012-07-22 12:15:38 +00:00
|
|
|
if(KICAD_SCRIPTING)
|
|
|
|
add_definitions(-DKICAD_SCRIPTING)
|
|
|
|
endif(KICAD_SCRIPTING)
|
|
|
|
|
|
|
|
if(KICAD_SCRIPTING_MODULES)
|
|
|
|
add_definitions(-DKICAD_SCRIPTING_MODULES)
|
|
|
|
endif(KICAD_SCRIPTING_MODULES)
|
2012-08-01 11:54:20 +00:00
|
|
|
|
2012-08-02 17:24:53 +00:00
|
|
|
if(KICAD_SCRIPTING_WXPYTHON)
|
|
|
|
add_definitions(-DKICAD_SCRIPTING_WXPYTHON)
|
|
|
|
endif(KICAD_SCRIPTING_WXPYTHON)
|
2010-10-09 08:08:29 +00:00
|
|
|
|
2010-02-08 18:15:42 +00:00
|
|
|
if(USE_WX_GRAPHICS_CONTEXT)
|
|
|
|
add_definitions(-DUSE_WX_GRAPHICS_CONTEXT)
|
|
|
|
endif(USE_WX_GRAPHICS_CONTEXT)
|
|
|
|
|
2011-08-29 19:50:05 +00:00
|
|
|
# Allow user to override the default settings for adding images to menu items. By default
|
2012-10-16 01:42:50 +00:00
|
|
|
# images in menu items are enabled on all platforms except OSX. This can be over ridden by
|
2011-08-29 19:50:05 +00:00
|
|
|
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
|
|
|
|
if(NOT DEFINED USE_IMAGES_IN_MENUS)
|
|
|
|
if(NOT APPLE)
|
|
|
|
set(USE_IMAGES_IN_MENUS ON)
|
|
|
|
endif(NOT APPLE)
|
|
|
|
else(NOT DEFINED USE_IMAGES_IN_MENUS)
|
|
|
|
if(USE_IMAGES_IN_MENUS)
|
|
|
|
set(USE_IMAGES_IN_MENUS ON)
|
|
|
|
endif(USE_IMAGES_IN_MENUS)
|
|
|
|
endif(NOT DEFINED USE_IMAGES_IN_MENUS)
|
|
|
|
|
2007-12-25 20:48:58 +00:00
|
|
|
# Locations for install targets.
|
2008-08-11 11:45:29 +00:00
|
|
|
set(KICAD_BIN bin
|
|
|
|
CACHE PATH "Location of KiCad binaries.")
|
2008-03-05 07:16:43 +00:00
|
|
|
|
2008-03-11 15:57:54 +00:00
|
|
|
if(UNIX)
|
2008-06-15 16:31:32 +00:00
|
|
|
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
|
2008-08-11 11:45:29 +00:00
|
|
|
set(KICAD_PLUGINS lib/kicad/plugins
|
|
|
|
CACHE PATH "Location of KiCad plugins.")
|
|
|
|
set(KICAD_DATA share/kicad
|
|
|
|
CACHE PATH "Location of KiCad data files.")
|
|
|
|
set(KICAD_DOCS share/doc/kicad
|
|
|
|
CACHE PATH "Location of KiCad documentation files.")
|
2008-03-11 15:57:54 +00:00
|
|
|
endif(UNIX)
|
2007-11-08 12:46:02 +00:00
|
|
|
|
2008-03-11 15:57:54 +00:00
|
|
|
if(WIN32)
|
2008-01-30 09:42:19 +00:00
|
|
|
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
|
2008-09-07 19:32:07 +00:00
|
|
|
set(CMAKE_INSTALL_PREFIX c:/kicad
|
|
|
|
CACHE PATH "")
|
2008-03-31 01:32:15 +00:00
|
|
|
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
|
2008-09-07 19:32:07 +00:00
|
|
|
set(KICAD_PLUGINS ${KICAD_BIN}/plugins
|
|
|
|
CACHE PATH "Location of KiCad plugins.")
|
|
|
|
set(KICAD_DATA share
|
|
|
|
CACHE PATH "Location of KiCad data files.")
|
|
|
|
set(KICAD_DOCS doc
|
|
|
|
CACHE PATH "Location of KiCad documentation files.")
|
2008-03-11 15:57:54 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
2008-09-07 19:32:07 +00:00
|
|
|
set(KICAD_DEMOS ${KICAD_DATA}/demos
|
2008-08-11 11:45:29 +00:00
|
|
|
CACHE PATH "Location of KiCad demo files.")
|
|
|
|
set(KICAD_TEMPLATE ${KICAD_DATA}/template
|
|
|
|
CACHE PATH "Location of KiCad template files.")
|
|
|
|
|
2008-09-07 19:32:07 +00:00
|
|
|
mark_as_advanced(KICAD_BIN
|
2008-08-11 11:45:29 +00:00
|
|
|
KICAD_PLUGINS
|
|
|
|
KICAD_DATA
|
|
|
|
KICAD_DOCS
|
|
|
|
KICAD_DEMOS
|
|
|
|
KICAD_TEMPLATE)
|
2008-03-31 01:32:15 +00:00
|
|
|
|
2010-12-27 16:49:39 +00:00
|
|
|
include(Functions)
|
2008-03-11 15:57:54 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
2008-04-13 14:00:01 +00:00
|
|
|
# Find libraries that are needed to build KiCad.
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
2008-04-13 14:00:01 +00:00
|
|
|
include(CheckFindPackageResult)
|
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#######################
|
|
|
|
# Find OpenGL library #
|
|
|
|
#######################
|
2008-09-07 19:32:07 +00:00
|
|
|
find_package(OpenGL QUIET)
|
2008-04-13 14:00:01 +00:00
|
|
|
check_find_package_result(OPENGL_FOUND "OpenGL")
|
2008-03-11 15:57:54 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
######################
|
|
|
|
# Find Boost library #
|
|
|
|
######################
|
2009-10-01 18:28:56 +00:00
|
|
|
# kicad now includes needed boost files.
|
|
|
|
# the two next lines can be uncommented to use the native boost lib.
|
|
|
|
# but this is not a good idea
|
|
|
|
#find_package(Boost 1.36 QUIET)
|
|
|
|
#check_find_package_result(Boost_FOUND "Boost")
|
2008-01-30 09:42:19 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
##########################
|
|
|
|
# Find wxWidgets library #
|
|
|
|
##########################
|
2008-01-06 12:03:13 +00:00
|
|
|
# Here you can define what libraries of wxWidgets you need for your
|
|
|
|
# application. You can figure out what libraries you need here;
|
|
|
|
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
|
2009-11-05 08:52:41 +00:00
|
|
|
|
2010-01-26 11:05:30 +00:00
|
|
|
# On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
|
|
|
|
if(APPLE)
|
2010-07-30 21:41:55 +00:00
|
|
|
find_package(wxWidgets COMPONENTS gl adv html core net base xml QUIET)
|
2010-01-26 11:05:30 +00:00
|
|
|
else(APPLE)
|
2010-07-30 21:41:55 +00:00
|
|
|
find_package(wxWidgets COMPONENTS gl aui adv html core net base xml QUIET)
|
2010-01-26 11:05:30 +00:00
|
|
|
endif(APPLE)
|
2008-04-13 14:00:01 +00:00
|
|
|
check_find_package_result(wxWidgets_FOUND "wxWidgets")
|
2007-11-08 12:46:02 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
|
2008-01-06 12:03:13 +00:00
|
|
|
# Include wxWidgets macros.
|
2008-03-11 15:57:54 +00:00
|
|
|
include(${wxWidgets_USE_FILE})
|
2008-01-06 12:03:13 +00:00
|
|
|
|
2008-04-13 19:07:32 +00:00
|
|
|
# Include MinGW resource compiler.
|
|
|
|
include(MinGWResourceCompiler)
|
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
# Generate build system specific header file.
|
|
|
|
include(PerformFeatureChecks)
|
|
|
|
perform_feature_checks()
|
|
|
|
|
2010-02-08 18:15:42 +00:00
|
|
|
# Find GDI+ on windows if wxGraphicsContext is available.
|
|
|
|
if(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
|
|
|
|
find_package(GdiPlus)
|
|
|
|
check_find_package_result(GDI_PLUS_FOUND "GDI+")
|
|
|
|
endif(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
|
|
|
|
|
2012-08-02 07:47:30 +00:00
|
|
|
# Find Python and other scripting resources
|
|
|
|
if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
|
|
|
|
|
2012-09-30 17:50:17 +00:00
|
|
|
if( "${PYTHON_EXECUTABLE}" STREQUAL "" )
|
|
|
|
if(WIN32)
|
|
|
|
SET( PYTHON_EXECUTABLE "python.exe" )
|
|
|
|
else(WIN32)
|
|
|
|
SET( PYTHON_EXECUTABLE "python2" )
|
|
|
|
endif(WIN32)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;print\"%s.%s\"%sys.version_info[0:2]" OUTPUT_VARIABLE PYTHON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2012-08-02 07:47:30 +00:00
|
|
|
set(PYTHON_DEST "lib/python${PYTHON_VERSION}/dist-packages" )
|
|
|
|
find_package(PythonLibs)
|
|
|
|
include_directories(${PYTHON_INCLUDE_PATH}
|
|
|
|
./scripting)
|
|
|
|
|
|
|
|
endif(KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-06-06 12:39:00 +00:00
|
|
|
# Automagically create version header file.
|
2010-04-21 12:25:16 +00:00
|
|
|
include(CreateBzrVersionHeader)
|
|
|
|
create_bzr_version_header()
|
2008-05-05 13:26:46 +00:00
|
|
|
|
2008-08-29 14:06:19 +00:00
|
|
|
if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
|
2008-09-07 19:32:07 +00:00
|
|
|
# This file may exist (created by an alternate process to the svn test above),
|
|
|
|
# e.g. could be created by a checkout script that produces a source tar file.
|
|
|
|
# This directive means the about box will have the svn date & revision in it,
|
|
|
|
# but the hard coded release date (program version) will be preserved.
|
|
|
|
add_definitions(-DHAVE_SVN_REVISION)
|
2008-08-29 14:06:19 +00:00
|
|
|
endif(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
# For include_directories(BEFORE ...), which _reverses_
|
|
|
|
# the order during insertion, so put first wanted last, which is
|
|
|
|
# ${CMAKE_SOURCE_DIR/include. Use '.' for current source dir since
|
|
|
|
# we don't want expansion here and now, and don't need expansion of
|
|
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}, '.' will work for any source directory.
|
|
|
|
set(INC_BEFORE
|
|
|
|
.
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
set(INC_AFTER
|
|
|
|
#include <config.h>
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
)
|
2008-01-06 12:03:13 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
|
|
|
# Let CMake look in these directories for nested
|
|
|
|
# 'CMakeLists.txt' files to process
|
|
|
|
#================================================
|
|
|
|
|
|
|
|
############
|
|
|
|
# Binaries #
|
|
|
|
############
|
2012-01-23 04:33:36 +00:00
|
|
|
|
2012-04-07 11:09:57 +00:00
|
|
|
add_subdirectory(bitmaps_png)
|
2008-03-31 01:32:15 +00:00
|
|
|
add_subdirectory(common)
|
2012-04-05 18:27:56 +00:00
|
|
|
add_subdirectory(3d-viewer)
|
2008-03-11 15:57:54 +00:00
|
|
|
add_subdirectory(cvpcb)
|
|
|
|
add_subdirectory(eeschema)
|
|
|
|
add_subdirectory(gerbview)
|
|
|
|
add_subdirectory(kicad)
|
|
|
|
add_subdirectory(pcbnew)
|
|
|
|
add_subdirectory(polygon)
|
2010-06-10 18:43:12 +00:00
|
|
|
add_subdirectory(potrace)
|
|
|
|
add_subdirectory(bitmap2component)
|
2011-08-05 19:53:42 +00:00
|
|
|
add_subdirectory(pcb_calculator)
|
2012-04-30 02:57:48 +00:00
|
|
|
add_subdirectory(tools)
|
2010-12-20 06:06:34 +00:00
|
|
|
#add_subdirectory(new)
|
2008-08-11 11:45:29 +00:00
|
|
|
|
2012-01-04 06:18:38 +00:00
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#############
|
|
|
|
# Resources #
|
|
|
|
#############
|
2008-03-11 15:57:54 +00:00
|
|
|
add_subdirectory(demos)
|
|
|
|
add_subdirectory(template)
|
2008-03-18 21:16:49 +00:00
|
|
|
|
2010-06-13 04:10:16 +00:00
|
|
|
#================================================
|
|
|
|
# Doxygen Output
|
|
|
|
#================================================
|
|
|
|
find_package(Doxygen)
|
|
|
|
if(DOXYGEN_FOUND)
|
2011-12-10 05:33:24 +00:00
|
|
|
add_custom_target( doxygen-docs
|
|
|
|
${CMAKE_COMMAND} -E remove_directory Documentation/doxygen
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE}
|
2010-06-13 04:10:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
2011-12-10 05:33:24 +00:00
|
|
|
DEPENDS Doxyfile
|
|
|
|
COMMENT "building doxygen docs into directory Documentation/doxygen/html"
|
|
|
|
)
|
2010-06-13 04:10:16 +00:00
|
|
|
else(DOXYGEN_FOUND)
|
|
|
|
message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
|
|
|
|
endif()
|
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
|
2010-10-12 10:20:28 +00:00
|
|
|
#================================================
|
|
|
|
# make uninstall rules
|
|
|
|
#================================================
|
2010-10-12 18:42:29 +00:00
|
|
|
configure_file(
|
|
|
|
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
2010-10-12 10:20:28 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
|
2010-10-12 18:42:29 +00:00
|
|
|
add_custom_target(uninstall
|
2010-10-12 10:20:28 +00:00
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
|
|
|
|
|
|
|
|
2008-08-11 11:45:29 +00:00
|
|
|
#================================================
|
|
|
|
# Installation parameters
|
|
|
|
#================================================
|
2008-12-20 08:14:33 +00:00
|
|
|
install(FILES INSTALL.txt
|
2008-08-11 11:45:29 +00:00
|
|
|
DESTINATION ${KICAD_DOCS}
|
|
|
|
COMPONENT resources)
|
2009-10-15 18:44:06 +00:00
|
|
|
install(FILES resources/freeroute.jnlp
|
2008-08-11 11:45:29 +00:00
|
|
|
DESTINATION ${KICAD_BIN}
|
|
|
|
COMPONENT resources)
|
2009-06-02 19:18:09 +00:00
|
|
|
###
|
|
|
|
# Install scripts
|
|
|
|
###
|
|
|
|
if(UNIX)
|
2009-06-21 13:37:27 +00:00
|
|
|
install(DIRECTORY scripts
|
|
|
|
DESTINATION ${KICAD_DOCS}
|
|
|
|
COMPONENT resources
|
|
|
|
PATTERN ".svn" EXCLUDE)
|
2009-06-02 19:18:09 +00:00
|
|
|
endif(UNIX)
|
2009-06-02 13:51:57 +00:00
|
|
|
###
|
|
|
|
# FreeDesktop .desktop and MIME resources
|
|
|
|
###
|
2008-03-18 21:16:49 +00:00
|
|
|
if(UNIX)
|
2009-06-21 13:37:27 +00:00
|
|
|
# Set paths
|
|
|
|
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)
|
|
|
|
|
|
|
|
# Install Mimelnk directory
|
|
|
|
install(DIRECTORY ${UNIX_MIMELNK_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
|
|
|
COMPONENT resources
|
|
|
|
PATTERN ".svn" EXCLUDE)
|
|
|
|
|
|
|
|
# Install Mime directory
|
|
|
|
install(DIRECTORY ${UNIX_ICONS_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
|
|
|
COMPONENT resources
|
|
|
|
PATTERN ".svn" EXCLUDE)
|
|
|
|
|
|
|
|
# Install Icons
|
|
|
|
install(DIRECTORY ${UNIX_MIME_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
|
|
|
COMPONENT resources
|
|
|
|
PATTERN ".svn" EXCLUDE)
|
|
|
|
|
|
|
|
# Install Applications directory (.desktop files)
|
|
|
|
install(DIRECTORY ${UNIX_APPLICATIONS_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
|
|
|
COMPONENT resources
|
|
|
|
PATTERN ".svn" EXCLUDE)
|
2008-03-18 21:16:49 +00:00
|
|
|
endif(UNIX)
|
2010-02-12 23:12:00 +00:00
|
|
|
|
|
|
|
include(CTest)
|