2007-11-08 20:38:30 +00:00
|
|
|
# Our project is called 'kicad' this is how it will be called in
|
|
|
|
# visual studio, and in our makefiles.
|
2007-11-08 07:17:37 +00:00
|
|
|
PROJECT(kicad)
|
|
|
|
|
2007-11-16 16:25:27 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2007-11-08 21:03:58 +00:00
|
|
|
# Uncomment this line if you want verbose build messages.
|
2007-11-08 07:17:37 +00:00
|
|
|
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
|
2007-12-02 13:56:03 +00:00
|
|
|
# Set default flags for Debug build
|
2007-12-11 21:40:10 +00:00
|
|
|
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
2007-12-11 21:02:05 +00:00
|
|
|
|
2007-12-02 13:56:03 +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")
|
|
|
|
|
2007-11-08 20:38:30 +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
|
2007-11-08 07:17:37 +00:00
|
|
|
SET(wxWidgets_USE_LIBS base core adv gl html net)
|
|
|
|
|
2007-11-08 20:38:30 +00:00
|
|
|
# We need the Find package for wxWidgets to work.
|
2007-11-08 07:17:37 +00:00
|
|
|
FIND_PACKAGE(wxWidgets REQUIRED)
|
|
|
|
|
2007-11-09 21:45:26 +00:00
|
|
|
# Locations for install targets
|
2007-11-08 12:46:02 +00:00
|
|
|
IF(UNIX)
|
2007-12-02 13:56:03 +00:00
|
|
|
IF(APPLE)
|
|
|
|
ELSE(APPLE)
|
|
|
|
#SET(CMAKE_INSTALL_PATH /usr/local)
|
|
|
|
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)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2007-11-08 20:38:30 +00:00
|
|
|
# Did we find wxWidgets ? This condition will fail
|
|
|
|
# for as long as the internal vars do not point to
|
|
|
|
# the proper wxWidgets configuration.
|
2007-11-07 16:18:24 +00:00
|
|
|
IF(wxWidgets_FOUND)
|
2007-12-02 13:56:03 +00:00
|
|
|
MESSAGE(STATUS "Check for installed wxWidgets -- found")
|
|
|
|
|
2007-11-08 20:38:30 +00:00
|
|
|
# Include wxWidgets macros.
|
|
|
|
INCLUDE(${wxWidgets_USE_FILE})
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2007-11-08 21:03:58 +00:00
|
|
|
# We define the include paths here.
|
|
|
|
# Include dirs for wxWidgets was defined before.
|
2007-11-08 07:17:37 +00:00
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/share)
|
2007-11-07 16:18:24 +00:00
|
|
|
|
2007-11-08 21:03:58 +00:00
|
|
|
# CMake will look at this dirs for nested 'CMakeLists.txt' files
|
|
|
|
ADD_SUBDIRECTORY(common)
|
2007-11-08 10:13:59 +00:00
|
|
|
ADD_SUBDIRECTORY(3d-viewer)
|
|
|
|
ADD_SUBDIRECTORY(cvpcb)
|
|
|
|
ADD_SUBDIRECTORY(eeschema)
|
|
|
|
ADD_SUBDIRECTORY(gerbview)
|
|
|
|
ADD_SUBDIRECTORY(kicad)
|
|
|
|
ADD_SUBDIRECTORY(pcbnew)
|
2007-11-07 16:18:24 +00:00
|
|
|
ELSE(wxWidgets_FOUND)
|
2007-11-08 20:38:30 +00:00
|
|
|
# For convenience. When we cannot continue, inform the user.
|
2007-12-02 13:56:03 +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
|
|
|
|
2007-11-08 21:03:58 +00:00
|
|
|
# CMake will look at this dirs for nested 'CMakeLists.txt' files
|
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)
|