Commit 338e0db7 authored by f3nix's avatar f3nix
Browse files

Debug build should be easier now. See how-to-build-kicad.txt. Tested on linux only.

parent f77e47dc
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
FIND_PACKAGE(OpenGL)
IF(OPENGL_FOUND)
	MESSAGE(STATUS "Check for installed OpenGL -- found")
ELSE(OPENGL_FOUND)
	MESSAGE(STATUS "Check for installed OpenGL -- not found")
	MESSAGE(FATAL_ERROR "OpenGL was not found - it is required to build KiCad")
ENDIF(OPENGL_FOUND)

ADD_DEFINITIONS(-DPCBNEW)

INCLUDE_DIRECTORIES(
+0 −3
Original line number Diff line number Diff line
TODO:
* Fix minizip build on windows.
* Add install targets for binaries, docs, translations, libraries on Mac.
  Linux version has a preliminary support.
  Windows version has a preliminary support.
* Add DEBUG.
* Add PYTHON.
* Add shared/static.
* Testing.
+55 −41
Original line number Diff line number Diff line
# Our project is called 'kicad'. This is what it will be called in
# Visual Studio and in our makefiles.
# our makefiles.
PROJECT(kicad)

CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)

# Uncomment this line if you want verbose build messages.
#SET(CMAKE_VERBOSE_MAKEFILE ON)
# Path to local CMake modules
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)

# List of variables that may be set from command line:
# CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL)
#   Turns ON/OFF verbose build messages.
#
# CMAKE_BUILD_TYPE Release/Debug (REQUIRED)
#   
#
# wxWidgets_USE_DEBUG ON/OFF (REQUIRED)
#   Should be set to ON only when CMAKE_BUILD_TYPE=Debug.
#
# CMAKE_INSTALL_PREFIX (OPTIONAL)
#   

# Comment this out if you don't want to build minizip.
SET(BUILD_MINIZIP ON CACHE BOOL "Build minizip?")
SET(KICAD_MINIZIP ON CACHE BOOL "Build minizip?")

# Set default flags for Debug build.
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
# Comment this out if you don't want to build with Python support.
# SET(KICAD_PYTHON ON CACHE BOOL "Build with Python support?")

# 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")

# 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)

# OpenGL support
SET(WXWINDOWS_USE_GL 1)
# We need the Find package for wxWidgets to work.
FIND_PACKAGE(wxWidgets REQUIRED)
# Set default flags for Debug build.
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")

# Locations for install targets.
IF(UNIX)
@@ -49,7 +55,7 @@ ENDIF(UNIX)

IF(WIN32)
	# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
	SET(CMAKE_INSTALL_PREFIX c:/kicad)
	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)
@@ -60,22 +66,36 @@ IF(WIN32)
	SET(KICAD_TEMPLATE template)
ENDIF(WIN32)

# Did we find wxWidgets ? This condition will fail
# for as long as the internal vars do not point to
# the proper wxWidgets configuration.
FIND_PACKAGE(OpenGL)
IF(OPENGL_FOUND)
	MESSAGE(STATUS "Check for installed OpenGL -- found")
ELSE(OPENGL_FOUND)
	MESSAGE(STATUS "Check for installed OpenGL -- not found")
	MESSAGE(FATAL_ERROR "OpenGL was not found - it is required to build KiCad")
ENDIF(OPENGL_FOUND)

# 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)
IF(wxWidgets_FOUND)
	MESSAGE(STATUS "Check for installed wxWidgets -- found")
ELSE(wxWidgets_FOUND)
	MESSAGE(STATUS "Check for installed wxWidgets -- not found")
	MESSAGE(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad")
ENDIF(wxWidgets_FOUND)

# Include wxWidgets macros.
INCLUDE(${wxWidgets_USE_FILE})

	# We define the include paths here.
	# Include dirs for wxWidgets was defined before.
# Include paths.
INCLUDE_DIRECTORIES(
	${CMAKE_CURRENT_SOURCE_DIR}/include
	${CMAKE_CURRENT_SOURCE_DIR}/share)

# CMake will look in these dirs for nested 'CMakeLists.txt' files.
# Binaries.
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(3d-viewer)
ADD_SUBDIRECTORY(cvpcb)
@@ -84,13 +104,7 @@ IF(wxWidgets_FOUND)
ADD_SUBDIRECTORY(kicad)
ADD_SUBDIRECTORY(pcbnew)
ADD_SUBDIRECTORY(polygon)
ELSE(wxWidgets_FOUND)
	# For convenience. When we cannot continue, inform the user.
	MESSAGE(STATUS "Check for installed wxWidgets -- not found")
	MESSAGE(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad")
ENDIF(wxWidgets_FOUND)

# CMake will look at this dirs for nested 'CMakeLists.txt' files.
# Resources.
ADD_SUBDIRECTORY(internat)
ADD_SUBDIRECTORY(help)
ADD_SUBDIRECTORY(library)
+56 −0
Original line number Diff line number Diff line
# CMake CVS r1.3

# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
#    This macro is intended to be used in FindXXX.cmake modules files.
#    It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
#    it also sets the <UPPERCASED_NAME>_FOUND variable.
#    The package is found if all variables listed are TRUE.
#    Example:
#
#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
#
#    LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and 
#    LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
#    If it is not found and REQUIRED was used, it fails with FATAL_ERROR, 
#    independent whether QUIET was used or not.
#    If it is found, the location is reported using the VAR1 argument, so 
#    here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
#    If the second argument is DEFAULT_MSG, the message in the failure case will 
#    be "Could NOT find LibXml2", if you don't like this message you can specify
#    your own custom failure message there.

MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )

  IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
    SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
  ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
    SET(_FAIL_MESSAGE "${_FAIL_MSG}")
  ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")

  STRING(TOUPPER ${_NAME} _NAME_UPPER)

  SET(${_NAME_UPPER}_FOUND TRUE)
  IF(NOT ${_VAR1})
    SET(${_NAME_UPPER}_FOUND FALSE)
  ENDIF(NOT ${_VAR1})

  FOREACH(_CURRENT_VAR ${ARGN})
    IF(NOT ${_CURRENT_VAR})
      SET(${_NAME_UPPER}_FOUND FALSE)
    ENDIF(NOT ${_CURRENT_VAR})
  ENDFOREACH(_CURRENT_VAR)

  IF (${_NAME_UPPER}_FOUND)
    IF (NOT ${_NAME}_FIND_QUIETLY)
        MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}")
    ENDIF (NOT ${_NAME}_FIND_QUIETLY)
  ELSE (${_NAME_UPPER}_FOUND)
    IF (${_NAME}_FIND_REQUIRED)
        MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}")
    ELSE (${_NAME}_FIND_REQUIRED)
      IF (NOT ${_NAME}_FIND_QUIETLY)
        MESSAGE(STATUS "${_FAIL_MESSAGE}")
      ENDIF (NOT ${_NAME}_FIND_QUIETLY)
    ENDIF (${_NAME}_FIND_REQUIRED)
  ENDIF (${_NAME_UPPER}_FOUND)
ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+971 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading