Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 13, 2008, 9:32:44 PM (16 years ago)
Author:
landauf
Message:

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/FindBoost.cmake

    r1505 r1776  
    22# use with cation
    33# Nicolas Schlumberger <nico AT orxonx DOT net> (C) 2007
     4#
     5# Several changes and additions by Fabian 'x3n' Landau
     6#                 > www.orxonox.net <
    47#
    58# - Find the Boost includes and libraries.
     
    5053# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
    5154# LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    52 #
    53 # In Windows, we make the assumption that, if the Boost files are installed, the default directory
    54 # will be C:\boost.
    5555
    5656#
     
    6060#    to use Link Directories.
    6161#
     62
     63IF (Boost_INCLUDE_DIR)
     64  SET (Boost_INCLUDE_FIND_QUIETLY TRUE)
     65ENDIF (Boost_INCLUDE_DIR)
    6266
    6367IF(WIN32)
     
    7579# BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
    7680# a library is selected for linking.
    77   SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
     81#  SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
    7882#  SET(Boost_LIB_PREFIX "lib")
    7983#  SET(Boost_LIB_SUFFIX "gcc-mt-1_33_1.lib")
     
    8185
    8286
    83 SET(BOOST_INCLUDE_PATH_DESCRIPTION "directory containing the boost include files. E.g /usr/local/include/boost-1_33_1 or c:\\boost\\include\\boost-1_33_1")
     87SET(BOOST_INCLUDE_PATH_DESCRIPTION "directory containing the boost include files.")
    8488
    8589SET(BOOST_DIR_MESSAGE "Set the Boost_INCLUDE_DIR cmake cache entry to the ${BOOST_INCLUDE_PATH_DESCRIPTION}")
     
    9094  SET(BOOST_DIR_SEARCH ${BOOST_DIR_SEARCH}/include)
    9195ENDIF(BOOST_DIR_SEARCH)
    92 
    93 IF(WIN32)
    94   SET(BOOST_DIR_SEARCH
    95     ${BOOST_DIR_SEARCH}
    96     C:/boost/include
    97     D:/boost/include
    98   )
    99 ENDIF(WIN32)
    10096
    10197# Add in some path suffixes. These will have to be updated whenever a new Boost version comes out.
     
    114110# Look for an installation.
    115111#
    116 IF(WIN32)
    117   SET(Boost_INCLUDE_DIR
     112FIND_PATH(Boost_INCLUDE_DIR NAMES boost/config.hpp PATH_SUFFIXES ${SUFFIX_FOR_PATH} PATHS
     113
     114# Look in other places.
     115  ${BOOST_DIR_SEARCH}
     116
    118117#    ../libs/boost_1_33_1
    119118    ../libs/boost_1_34_1
    120 #    ../libs/boost_1_35_0
    121   )
    122 ELSE(WIN32)
    123   FIND_PATH(Boost_INCLUDE_DIR NAMES boost/config.hpp PATH_SUFFIXES ${SUFFIX_FOR_PATH} PATHS
    124 
    125 # Look in other places.
    126     ${BOOST_DIR_SEARCH}
     119#    ../libs/boost-1_35_0
    127120
    128121# Help the user find it if we cannot.
    129     DOC "The ${BOOST_INCLUDE_PATH_DESCRIPTION}"
    130   )
    131 ENDIF(WIN32)
     122  DOC "The ${BOOST_INCLUDE_PATH_DESCRIPTION}"
     123)
    132124
    133125# Assume we didn't find it.
     
    175167    MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
    176168  ENDIF(EXISTS "${Boost_INCLUDE_DIR}")
    177 
    178169  IF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
    179170    SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR})
     
    260251    MARK_AS_ADVANCED(Boost_${name}_LIBRARY Boost_${name}_LIBRARY_DEBUG)
    261252  ELSE(Boost_${name}_LIBRARY)
    262     MESSAGE(STATUS "sdfds")
    263253    IF(NOT Boost_FIND_QUIETLY)
    264       MESSAGE(STATUS "Boost ${name} library was not found.")
     254      MESSAGE(SEND_ERROR "Boost ${name} library was not found.")
    265255    ELSE(NOT Boost_FIND_QUIETLY)
    266256      IF(Boost_FIND_REQUIRED_${name})
     
    284274  SET(Boost_LIBRARIES)
    285275  FOREACH(library ${Boost_FIND_LIBRARIES})
     276    IF (Boost_${library}_LIBRARY)
     277      SET (Boost_${name}_LIBRARY_FIND_QUIETLY TRUE)
     278    ENDIF (Boost_${library}_LIBRARY)
     279
    286280    BOOST_FIND_LIBRARY(${library})
    287281    IF(Boost_${library}_FOUND)
    288282      SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${library}_LIBRARIES})
    289       MESSAGE(STATUS "Found BoostLibrary: ${library}")
     283      IF (NOT Boost_${name}_LIBRARY_FIND_QUIETLY)
     284        MESSAGE(STATUS "Found BoostLibrary: ${library}")
     285        IF (VERBOSE_FIND)
     286          MESSAGE (STATUS "  library path: ${Boost_${library}_LIBRARIES}")
     287        ENDIF (VERBOSE_FIND)
     288      ENDIF (NOT Boost_${name}_LIBRARY_FIND_QUIETLY)
    290289    ENDIF(Boost_${library}_FOUND)
    291290  ENDFOREACH(library)
     291ELSE(Boost_LIBRARY_DIRS)
     292  MESSAGE(SEND_ERROR "Boost libraries not found: ${Boost_FIND_COMPONENTS}")
    292293ENDIF(Boost_LIBRARY_DIRS)
    293294
    294295IF(NOT Boost_FOUND)
    295296  IF(NOT Boost_FIND_QUIETLY)
    296     MESSAGE(STATUS "Boost was not found. ${BOOST_DIR_MESSAGE}")
     297    MESSAGE(SEND_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
    297298  ELSE(NOT Boost_FIND_QUIETLY)
    298299    IF(Boost_FIND_REQUIRED)
    299       MESSAGE(FATAL_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
     300      MESSAGE(SEND_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
    300301    ENDIF(Boost_FIND_REQUIRED)
    301302  ENDIF(NOT Boost_FIND_QUIETLY)
     303ELSE(NOT Boost_FOUND)
     304  IF (NOT Boost_INCLUDE_FIND_QUIETLY)
     305    MESSAGE(STATUS "Boost include path was found.")
     306    IF (VERBOSE_FIND)
     307      MESSAGE (STATUS "  include path: ${Boost_INCLUDE_DIR}")
     308    ENDIF (VERBOSE_FIND)
     309  ENDIF (NOT Boost_INCLUDE_FIND_QUIETLY)
    302310ENDIF(NOT Boost_FOUND)
     311
Note: See TracChangeset for help on using the changeset viewer.