Difference between revisions of "CMakeUserFindClanLib"

From KitwarePublic
Jump to navigationJump to search
(Add explicit preformat markup)
(Remove leading space rectangles from preformatted blocks)
Line 2: Line 2:
-----
-----
<pre>
<pre>
# - Find ClanLib
# - Find ClanLib
# ClanLib is a cross platform SDK geared toward making games. It is
# ClanLib is a cross platform SDK geared toward making games. It is
# available from http://clanlib.org.
# available from http://clanlib.org.
#
#
# Please define the following before starting this module
# Please define the following before starting this module
#  ClanLib_MAJOR_VERSION
#  ClanLib_MAJOR_VERSION
#  ClanLib_MINOR_VERSION
#  ClanLib_MINOR_VERSION
#
#
# The following are defined by this module:
# The following are defined by this module:
#  ClanLib_FOUND - TRUE if ClanLib was found
#  ClanLib_FOUND - TRUE if ClanLib was found
#  ClanLib_INCLUDE_DIRS - Directory containing the ClanLib headers
#  ClanLib_INCLUDE_DIRS - Directory containing the ClanLib headers
#  ClanLib_LIBRARIES - If invoked via FIND_PACKAGE(ClanLib COMPONENTS ...),
#  ClanLib_LIBRARIES - If invoked via FIND_PACKAGE(ClanLib COMPONENTS ...),
#                      will only contain the libraries matching each component.
#                      will only contain the libraries matching each component.
#                      otherwise, it will contain all ClanLib libraries found.
#                      otherwise, it will contain all ClanLib libraries found.
# For the components Core, App, Display, GL, GUI, GUIStyleSilver, MikMod,
# For the components Core, App, Display, GL, GUI, GUIStyleSilver, MikMod,
# Network, SDL, Signals, Sound and Vorbis, the following variables are set:
# Network, SDL, Signals, Sound and Vorbis, the following variables are set:
#  ClanLib_${COMPONENT}_LIBRARY - Full path to the component's library.
#  ClanLib_${COMPONENT}_LIBRARY - Full path to the component's library.
IF(ClanLib_INCLUDE_DIRS)
IF(ClanLib_INCLUDE_DIRS)
  SET(ClanLib_FIND_QUIETLY TRUE)
  SET(ClanLib_FIND_QUIETLY TRUE)
ENDIF(ClanLib_INCLUDE_DIRS)
ENDIF(ClanLib_INCLUDE_DIRS)
 
IF(NOT ClanLib_FIND_COMPONENTS)
IF(NOT ClanLib_FIND_COMPONENTS)
  SET(ClanLib_FIND_COMPONENTS
  SET(ClanLib_FIND_COMPONENTS
    App
    App
    Display
    Display
    GL
    GL
    GUI
    GUI
    GUIStyleSilver
    GUIStyleSilver
    MikMod
    MikMod
    Network
    Network
    SDL
    SDL
    Signals
    Signals
    Sound
    Sound
    Vorbis)
    Vorbis)
ENDIF(NOT ClanLib_FIND_COMPONENTS)
ENDIF(NOT ClanLib_FIND_COMPONENTS)
 
MACRO(ClanLib_MSG MSG)
MACRO(ClanLib_MSG MSG)
  IF(NOT ClanLib_FIND_QUIETLY)
  IF(NOT ClanLib_FIND_QUIETLY)
    MESSAGE(STATUS ${MSG})
    MESSAGE(STATUS ${MSG})
  ENDIF(NOT ClanLib_FIND_QUIETLY)
  ENDIF(NOT ClanLib_FIND_QUIETLY)
ENDMACRO(ClanLib_MSG)
ENDMACRO(ClanLib_MSG)
 
MACRO(ClanLib_ERR MSG)
MACRO(ClanLib_ERR MSG)
  IF(ClanLib_FIND_REQUIRED)
  IF(ClanLib_FIND_REQUIRED)
    MESSAGE(SEND_ERROR ${MSG})
    MESSAGE(SEND_ERROR ${MSG})
  ELSE(ClanLib_FIND_REQUIRED)
  ELSE(ClanLib_FIND_REQUIRED)
    ClanLib_MSG(${MSG})
    ClanLib_MSG(${MSG})
  ENDIF(ClanLib_FIND_REQUIRED)
  ENDIF(ClanLib_FIND_REQUIRED)
ENDMACRO(ClanLib_ERR)
ENDMACRO(ClanLib_ERR)
 
MACRO(ClanLib_FIND_COMPONENT COMPONENT)
MACRO(ClanLib_FIND_COMPONENT COMPONENT)
  ClanLib_MSG("Checking for Clan${COMPONENT}")
  ClanLib_MSG("Checking for Clan${COMPONENT}")
  FIND_LIBRARY(ClanLib_${COMPONENT}_LIBRARY clan${ClanLib_MAJOR_VERSION}${ClanLib_MINOR_VERSION}${COMPONENT}
  FIND_LIBRARY(ClanLib_${COMPONENT}_LIBRARY clan${ClanLib_MAJOR_VERSION}${ClanLib_MINOR_VERSION}${COMPONENT}
    ${CLANLIB_ROOT_DIR}/lib /lib /usr/lib /usr/local/lib
    ${CLANLIB_ROOT_DIR}/lib /lib /usr/lib /usr/local/lib
    DOC "Library name for clan${COMPONENT}.")
    DOC "Library name for clan${COMPONENT}.")
  IF(ClanLib_${COMPONENT}_LIBRARY)
  IF(ClanLib_${COMPONENT}_LIBRARY)
    SET(ClanLib_${COMPONENT}_FOUND TRUE)
    SET(ClanLib_${COMPONENT}_FOUND TRUE)
    ClanLib_MSG("Checking for Clan${COMPONENT} -- ${ClanLib_${COMPONENT}_LIBRARY}")
    ClanLib_MSG("Checking for Clan${COMPONENT} -- ${ClanLib_${COMPONENT}_LIBRARY}")
  ELSE(ClanLib_${COMPONENT}_LIBRARY)
  ELSE(ClanLib_${COMPONENT}_LIBRARY)
    SET(ClanLib_${COMPONENT}_FOUND FALSE)
    SET(ClanLib_${COMPONENT}_FOUND FALSE)
    IF(ClanLib_FIND_REQUIRED_${COMPONENT})
    IF(ClanLib_FIND_REQUIRED_${COMPONENT})
      ClanLib_ERR("Checking for Clan${COMPONENT} -- not found")
      ClanLib_ERR("Checking for Clan${COMPONENT} -- not found")
    ELSE(ClanLib_FIND_REQUIRED_${COMPONENT})
    ELSE(ClanLib_FIND_REQUIRED_${COMPONENT})
      ClanLib_MSG("Checking for Clan${COMPONENT} -- not found")
      ClanLib_MSG("Checking for Clan${COMPONENT} -- not found")
    ENDIF(ClanLib_FIND_REQUIRED_${COMPONENT})
    ENDIF(ClanLib_FIND_REQUIRED_${COMPONENT})
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
ENDMACRO(ClanLib_FIND_COMPONENT)
ENDMACRO(ClanLib_FIND_COMPONENT)
 
ClanLib_MSG("Checking for ClanLib")
ClanLib_MSG("Checking for ClanLib")
FIND_PATH(ClanLib_INCLUDE_DIRS ClanLib/core.h
FIND_PATH(ClanLib_INCLUDE_DIRS ClanLib/core.h
  ${ClanLib_ROOT_DIR}/include ${ClanLib_ROOT_DIR}/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  ${ClanLib_ROOT_DIR}/include ${ClanLib_ROOT_DIR}/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/local/include          /usr/local/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/local/include          /usr/local/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/include                /usr/include/ClanLib--${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/include                /usr/include/ClanLib--${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  DOC "Where to find the ClanLib includes.")
  DOC "Where to find the ClanLib includes.")
IF(ClanLib_INCLUDE_DIRS)
IF(ClanLib_INCLUDE_DIRS)
  ClanLib_MSG("Checking for ClanLib -- headers")
  ClanLib_MSG("Checking for ClanLib -- headers")
ELSE(ClanLib_INCLUDE_DIRS)
ELSE(ClanLib_INCLUDE_DIRS)
  ClanLib_ERR("Checking for ClanLib -- headers not found")
  ClanLib_ERR("Checking for ClanLib -- headers not found")
ENDIF(ClanLib_INCLUDE_DIRS)
ENDIF(ClanLib_INCLUDE_DIRS)
 
ClanLib_FIND_COMPONENT(Core)
ClanLib_FIND_COMPONENT(Core)
IF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
IF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
  SET(ClanLib_FOUND TRUE)
  SET(ClanLib_FOUND TRUE)
  SET(ClanLib_LIBRARIES ${ClanLib_Core_LIBRARY})
  SET(ClanLib_LIBRARIES ${ClanLib_Core_LIBRARY})
ELSE(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
ELSE(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
  SET(ClanLib_FOUND FALSE)
  SET(ClanLib_FOUND FALSE)
ENDIF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
ENDIF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
 
ClanLib_MSG("Checking for other ClanLib components")
ClanLib_MSG("Checking for other ClanLib components")
FOREACH(COMPONENT ${ClanLib_FIND_COMPONENTS})
FOREACH(COMPONENT ${ClanLib_FIND_COMPONENTS})
  ClanLib_FIND_COMPONENT(${COMPONENT})
  ClanLib_FIND_COMPONENT(${COMPONENT})
  IF(ClanLib_${COMPONENT}_LIBRARY)
  IF(ClanLib_${COMPONENT}_LIBRARY)
    LIST(APPEND ClanLib_LIBRARIES ${ClanLib_${COMPONENT}_LIBRARY})
    LIST(APPEND ClanLib_LIBRARIES ${ClanLib_${COMPONENT}_LIBRARY})
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
ENDFOREACH(COMPONENT)
ENDFOREACH(COMPONENT)
 
MARK_AS_ADVANCED(
MARK_AS_ADVANCED(
  ClanLib_INCLUDE_DIRS
  ClanLib_INCLUDE_DIRS
  ClanLib_App_LIBRARY
  ClanLib_App_LIBRARY
  ClanLib_Core_LIBRARY
  ClanLib_Core_LIBRARY
  ClanLib_Display_LIBRARY
  ClanLib_Display_LIBRARY
  ClanLib_GL_LIBRARY
  ClanLib_GL_LIBRARY
  ClanLib_GUI_LIBRARY
  ClanLib_GUI_LIBRARY
  ClanLib_GUIStyleSilver_LIBRARY
  ClanLib_GUIStyleSilver_LIBRARY
  ClanLib_MikMod_LIBRARY
  ClanLib_MikMod_LIBRARY
  ClanLib_Network_LIBRARY
  ClanLib_Network_LIBRARY
  ClanLib_SDL_LIBRARY
  ClanLib_SDL_LIBRARY
  ClanLib_Signals_LIBRARY
  ClanLib_Signals_LIBRARY
  ClanLib_Sound_LIBRARY
  ClanLib_Sound_LIBRARY
  ClanLib_Vorbis_LIBRARY
  ClanLib_Vorbis_LIBRARY
)
)
</pre>
</pre>
-----
-----

Revision as of 21:04, 20 April 2018

Back


# - Find ClanLib
# ClanLib is a cross platform SDK geared toward making games. It is
# available from http://clanlib.org.
#
# Please define the following before starting this module
#  ClanLib_MAJOR_VERSION
#  ClanLib_MINOR_VERSION
#
# The following are defined by this module:
#  ClanLib_FOUND - TRUE if ClanLib was found
#  ClanLib_INCLUDE_DIRS - Directory containing the ClanLib headers
#  ClanLib_LIBRARIES - If invoked via FIND_PACKAGE(ClanLib COMPONENTS ...),
#                      will only contain the libraries matching each component.
#                      otherwise, it will contain all ClanLib libraries found.
# For the components Core, App, Display, GL, GUI, GUIStyleSilver, MikMod,
# Network, SDL, Signals, Sound and Vorbis, the following variables are set:
#  ClanLib_${COMPONENT}_LIBRARY - Full path to the component's library.
IF(ClanLib_INCLUDE_DIRS)
  SET(ClanLib_FIND_QUIETLY TRUE)
ENDIF(ClanLib_INCLUDE_DIRS)

IF(NOT ClanLib_FIND_COMPONENTS)
  SET(ClanLib_FIND_COMPONENTS
    App
    Display
    GL
    GUI
    GUIStyleSilver
    MikMod
    Network
    SDL
    Signals
    Sound
    Vorbis)
ENDIF(NOT ClanLib_FIND_COMPONENTS)

MACRO(ClanLib_MSG MSG)
  IF(NOT ClanLib_FIND_QUIETLY)
    MESSAGE(STATUS ${MSG})
  ENDIF(NOT ClanLib_FIND_QUIETLY)
ENDMACRO(ClanLib_MSG)

MACRO(ClanLib_ERR MSG)
  IF(ClanLib_FIND_REQUIRED)
    MESSAGE(SEND_ERROR ${MSG})
  ELSE(ClanLib_FIND_REQUIRED)
    ClanLib_MSG(${MSG})
  ENDIF(ClanLib_FIND_REQUIRED)
ENDMACRO(ClanLib_ERR)

MACRO(ClanLib_FIND_COMPONENT COMPONENT)
  ClanLib_MSG("Checking for Clan${COMPONENT}")
  FIND_LIBRARY(ClanLib_${COMPONENT}_LIBRARY clan${ClanLib_MAJOR_VERSION}${ClanLib_MINOR_VERSION}${COMPONENT}
    ${CLANLIB_ROOT_DIR}/lib /lib /usr/lib /usr/local/lib
    DOC "Library name for clan${COMPONENT}.")
  IF(ClanLib_${COMPONENT}_LIBRARY)
    SET(ClanLib_${COMPONENT}_FOUND TRUE)
    ClanLib_MSG("Checking for Clan${COMPONENT} -- ${ClanLib_${COMPONENT}_LIBRARY}")
  ELSE(ClanLib_${COMPONENT}_LIBRARY)
    SET(ClanLib_${COMPONENT}_FOUND FALSE)
    IF(ClanLib_FIND_REQUIRED_${COMPONENT})
      ClanLib_ERR("Checking for Clan${COMPONENT} -- not found")
    ELSE(ClanLib_FIND_REQUIRED_${COMPONENT})
      ClanLib_MSG("Checking for Clan${COMPONENT} -- not found")
    ENDIF(ClanLib_FIND_REQUIRED_${COMPONENT})
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
ENDMACRO(ClanLib_FIND_COMPONENT)

ClanLib_MSG("Checking for ClanLib")
FIND_PATH(ClanLib_INCLUDE_DIRS ClanLib/core.h
  ${ClanLib_ROOT_DIR}/include ${ClanLib_ROOT_DIR}/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/local/include          /usr/local/include/ClanLib-${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  /usr/include                /usr/include/ClanLib--${ClanLib_MAJOR_VERSION}.${ClanLib_MINOR_VERSION}
  DOC "Where to find the ClanLib includes.")
IF(ClanLib_INCLUDE_DIRS)
  ClanLib_MSG("Checking for ClanLib -- headers")
ELSE(ClanLib_INCLUDE_DIRS)
  ClanLib_ERR("Checking for ClanLib -- headers not found")
ENDIF(ClanLib_INCLUDE_DIRS)

ClanLib_FIND_COMPONENT(Core)
IF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
  SET(ClanLib_FOUND TRUE)
  SET(ClanLib_LIBRARIES ${ClanLib_Core_LIBRARY})
ELSE(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)
  SET(ClanLib_FOUND FALSE)
ENDIF(ClanLib_INCLUDE_DIRS AND ClanLib_Core_LIBRARY)

ClanLib_MSG("Checking for other ClanLib components")
FOREACH(COMPONENT ${ClanLib_FIND_COMPONENTS})
  ClanLib_FIND_COMPONENT(${COMPONENT})
  IF(ClanLib_${COMPONENT}_LIBRARY)
    LIST(APPEND ClanLib_LIBRARIES ${ClanLib_${COMPONENT}_LIBRARY})
  ENDIF(ClanLib_${COMPONENT}_LIBRARY)
ENDFOREACH(COMPONENT)

MARK_AS_ADVANCED(
  ClanLib_INCLUDE_DIRS
  ClanLib_App_LIBRARY
  ClanLib_Core_LIBRARY
  ClanLib_Display_LIBRARY
  ClanLib_GL_LIBRARY
  ClanLib_GUI_LIBRARY
  ClanLib_GUIStyleSilver_LIBRARY
  ClanLib_MikMod_LIBRARY
  ClanLib_Network_LIBRARY
  ClanLib_SDL_LIBRARY
  ClanLib_Signals_LIBRARY
  ClanLib_Sound_LIBRARY
  ClanLib_Vorbis_LIBRARY
)

Back



CMake: [Welcome | Site Map]