Commit 2c7eaa60 authored by f3nix's avatar f3nix
Browse files

CMake: add check_find_package_result macro.

parent 945f5f1e
Loading
Loading
Loading
Loading
+6 −18
Original line number Diff line number Diff line
@@ -56,33 +56,21 @@ set(KICAD_TEMPLATE ${KICAD_DATA}/template CACHE PATH "Location of KiCad template
mark_as_advanced(KICAD_BIN KICAD_PLUGINS KICAD_DATA KICAD_DOCS
    KICAD_DEMOS KICAD_INTERNAT KICAD_TEMPLATE)

# Find libraries that are needed to build KiCad.
include(CheckFindPackageResult)

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)
check_find_package_result(OPENGL_FOUND "OpenGL")

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)
check_find_package_result(Boost_FOUND "Boost")

# 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)
check_find_package_result(wxWidgets_FOUND "wxWidgets")

# Include wxWidgets macros.
include(${wxWidgets_USE_FILE})
+8 −0
Original line number Diff line number Diff line
macro(check_find_package_result _VAR _PKGNAME)
    if(${_VAR})
        message(STATUS "Check for installed ${_PKGNAME} -- found")
    else(${_VAR})
        message(STATUS "Check for installed ${_PKGNAME} -- not found")
        message(FATAL_ERROR "${_PKGNAME} was not found - it is required to build KiCad")
    endif(${_VAR})
endmacro(check_find_package_result)
+3 −3
Original line number Diff line number Diff line
@@ -41,9 +41,9 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
  ENDFOREACH(_CURRENT_VAR)

  IF (${_NAME_UPPER}_FOUND)
    IF (NOT ${_NAME}_FIND_QUIETLY)
        MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}")
    ENDIF (NOT ${_NAME}_FIND_QUIETLY)
#     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}")
+1 −1
Original line number Diff line number Diff line
find_package(ZLIB)
find_package(ZLIB QUIET)
if(ZLIB_FOUND)
    message(STATUS "Check for installed zlib -- found")
else(ZLIB_FOUND)