2008-01-06 12:03:13 +00:00
|
|
|
# List of variables that may be set from command line:
|
|
|
|
#
|
|
|
|
# CMAKE_BUILD_TYPE Release/Debug (REQUIRED)
|
2008-01-06 21:56:45 +00:00
|
|
|
# Choose build type: Release/Debug
|
2008-01-06 12:03:13 +00:00
|
|
|
#
|
|
|
|
# wxWidgets_USE_DEBUG ON/OFF (REQUIRED)
|
|
|
|
# Should be set to ON only when CMAKE_BUILD_TYPE=Debug.
|
|
|
|
#
|
2008-01-06 21:56:45 +00:00
|
|
|
# wxWidgets_USE_STATIC ON/OFF (OPTIONAL)
|
2008-02-27 19:38:16 +00:00
|
|
|
#
|
2008-01-06 21:56:45 +00:00
|
|
|
#
|
|
|
|
# CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL)
|
|
|
|
# Turns ON/OFF verbose build messages.
|
2008-02-19 04:30:17 +00:00
|
|
|
# You can also pass VERBOSE=1 to make for the same effect.
|
2008-01-06 21:56:45 +00:00
|
|
|
#
|
2008-01-06 12:03:13 +00:00
|
|
|
# CMAKE_INSTALL_PREFIX (OPTIONAL)
|
2008-02-27 19:38:16 +00:00
|
|
|
#
|
2008-02-19 04:30:17 +00:00
|
|
|
#
|
2008-02-06 20:36:44 +00:00
|
|
|
# KICAD_MINIZIP ON/OFF
|
2008-02-27 19:38:16 +00:00
|
|
|
#
|
2008-02-06 20:36:44 +00:00
|
|
|
#
|
|
|
|
# KICAD_PYTHON ON/OFF
|
2008-02-27 19:38:16 +00:00
|
|
|
#
|
2008-01-06 21:56:45 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Our project is called 'kicad'. This is what it will be called in
|
|
|
|
# our makefiles.
|
|
|
|
PROJECT(kicad)
|
|
|
|
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
|
|
|
|
|
|
|
# Path to local CMake modules
|
|
|
|
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2008-02-06 20:36:44 +00:00
|
|
|
# Command line option to enable or disable building minizip. Minizip
|
|
|
|
# building is enabled by default. Use -DKICAD_MINZIP=OFF to disable
|
2008-01-28 05:49:15 +00:00
|
|
|
# building minizip.
|
|
|
|
OPTION(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
|
2008-01-05 19:16:30 +00:00
|
|
|
|
2008-01-06 12:03:13 +00:00
|
|
|
# Comment this out if you don't want to build with Python support.
|
2008-02-06 20:36:44 +00:00
|
|
|
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
|
2007-12-11 21:02:05 +00:00
|
|
|
|
2008-02-27 20:47:03 +00:00
|
|
|
# Set flags for GNU compilers.
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
2008-02-27 19:38:16 +00:00
|
|
|
# Set default flags for Release build.
|
|
|
|
SET(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG")
|
|
|
|
SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG")
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
|
|
|
|
|
|
|
|
# Set default flags for Debug build.
|
|
|
|
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
2008-02-27 20:47:03 +00:00
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2007-12-25 20:48:58 +00:00
|
|
|
# Locations for install targets.
|
2007-11-08 12:46:02 +00:00
|
|
|
IF(UNIX)
|
2008-01-30 09:42:19 +00:00
|
|
|
IF(APPLE)
|
|
|
|
ELSE(APPLE)
|
|
|
|
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
|
|
|
|
SET(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "")
|
|
|
|
# When used later, "bin" and others with no leading / is relative to CMAKE_INSTALL_PREFIX.
|
|
|
|
SET(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.")
|
|
|
|
SET(KICAD_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins.")
|
|
|
|
SET(KICAD_DOCS share/doc/kicad CACHE PATH "Location of KiCad documentation files.")
|
|
|
|
SET(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.")
|
|
|
|
SET(KICAD_MODULES ${KICAD_DATA}/modules)
|
|
|
|
SET(KICAD_LIBRARY ${KICAD_DATA}/library)
|
|
|
|
SET(KICAD_INTERNAT ${KICAD_DATA}/internat)
|
|
|
|
SET(KICAD_TEMPLATE ${KICAD_DATA}/template)
|
|
|
|
ENDIF(APPLE)
|
2007-11-08 12:46:02 +00:00
|
|
|
ENDIF(UNIX)
|
|
|
|
|
|
|
|
IF(WIN32)
|
2008-01-30 09:42:19 +00:00
|
|
|
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
|
|
|
|
SET(CMAKE_INSTALL_PREFIX c:/kicad CACHE PATH "")
|
|
|
|
# When used later, "winexe" and others with no leading / is relative to CMAKE_INSTALL_PREFIX.
|
|
|
|
SET(KICAD_BIN winexe CACHE PATH "Location of KiCad binaries.")
|
|
|
|
SET(KICAD_PLUGINS ${KICAD_BIN}/plugins)
|
|
|
|
SET(KICAD_DOCS help)
|
|
|
|
SET(KICAD_MODULES modules)
|
|
|
|
SET(KICAD_LIBRARY library)
|
|
|
|
SET(KICAD_INTERNAT internat)
|
|
|
|
SET(KICAD_TEMPLATE template)
|
2007-11-08 12:46:02 +00:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2008-01-06 12:03:13 +00:00
|
|
|
FIND_PACKAGE(OpenGL)
|
|
|
|
IF(OPENGL_FOUND)
|
2008-01-30 09:42:19 +00:00
|
|
|
MESSAGE(STATUS "Check for installed OpenGL -- found")
|
2008-01-06 12:03:13 +00:00
|
|
|
ELSE(OPENGL_FOUND)
|
2008-01-30 09:42:19 +00:00
|
|
|
MESSAGE(STATUS "Check for installed OpenGL -- not found")
|
|
|
|
MESSAGE(FATAL_ERROR "OpenGL was not found - it is required to build KiCad")
|
2008-01-06 12:03:13 +00:00
|
|
|
ENDIF(OPENGL_FOUND)
|
|
|
|
|
2008-01-30 09:42:19 +00:00
|
|
|
FIND_PACKAGE(Boost)
|
|
|
|
IF(Boost_FOUND)
|
|
|
|
MESSAGE(STATUS "Check for installed Boost -- found")
|
|
|
|
ELSE(Boost_FOUND)
|
|
|
|
MESSAGE(STATUS "Check for installed Boost -- not found")
|
|
|
|
MESSAGE(FATAL_ERROR "Boost was not found - it is required to build KiCad")
|
|
|
|
ENDIF(Boost_FOUND)
|
|
|
|
|
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
|
|
|
|
SET(wxWidgets_USE_LIBS base core adv gl html net)
|
|
|
|
FIND_PACKAGE(wxWidgetsCVS)
|
2007-11-07 16:18:24 +00:00
|
|
|
IF(wxWidgets_FOUND)
|
2008-01-30 09:42:19 +00:00
|
|
|
MESSAGE(STATUS "Check for installed wxWidgets -- found")
|
2007-11-07 16:18:24 +00:00
|
|
|
ELSE(wxWidgets_FOUND)
|
2008-01-30 09:42:19 +00:00
|
|
|
MESSAGE(STATUS "Check for installed wxWidgets -- not found")
|
|
|
|
MESSAGE(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad")
|
2007-11-07 16:18:24 +00:00
|
|
|
ENDIF(wxWidgets_FOUND)
|
2007-11-08 12:46:02 +00:00
|
|
|
|
2008-01-06 12:03:13 +00:00
|
|
|
# Include wxWidgets macros.
|
|
|
|
INCLUDE(${wxWidgets_USE_FILE})
|
|
|
|
|
|
|
|
# Include paths.
|
|
|
|
INCLUDE_DIRECTORIES(
|
2008-01-30 09:42:19 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/share)
|
2008-01-06 12:03:13 +00:00
|
|
|
|
|
|
|
# CMake will look in these dirs for nested 'CMakeLists.txt' files.
|
|
|
|
# Binaries.
|
|
|
|
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)
|
|
|
|
# Resources.
|
2007-11-08 12:46:02 +00:00
|
|
|
ADD_SUBDIRECTORY(internat)
|
2007-11-09 22:15:22 +00:00
|
|
|
ADD_SUBDIRECTORY(help)
|
2007-11-08 12:46:02 +00:00
|
|
|
ADD_SUBDIRECTORY(library)
|
|
|
|
ADD_SUBDIRECTORY(modules)
|
|
|
|
ADD_SUBDIRECTORY(template)
|