~keith-penguin/kdegames/trunk

« back to all changes in this revision

Viewing changes to cmake/modules/FindLibKDEGames.cmake

  • Committer: Keith Worrell
  • Date: 2009-03-18 05:35:28 UTC
  • Revision ID: keith.worrell@gmail.com-20090318053528-mx6x9c0ngmg0kg6p
imported project

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find the kdegames library
 
2
# Once done this will define
 
3
#
 
4
#  KDEGAMES_FOUND - system has the kdegames library
 
5
#  KDEGAMES_INCLUDE_DIRS - a list of the relevant libkdegames include dirs. Allows the use of forwarding header, e.g. #include <KGameDifficulty>
 
6
#  KDEGAMES_INCLUDE_DIR - the kdegames include directory
 
7
#  KDEGAMES_LIBRARY - Link this to use the kdegames library
 
8
#
 
9
include(CheckLibraryExists)
 
10
 
 
11
if (KDEGAMES_INCLUDE_DIR AND KDEGAMES_LIBRARY)
 
12
    # in cache already
 
13
    SET(KDEGAMES_FOUND TRUE)
 
14
 
 
15
else (KDEGAMES_INCLUDE_DIR AND KDEGAMES_LIBRARY)
 
16
 
 
17
        # reset vars
 
18
        set(KDEGAMES_INCLUDE_DIRS)
 
19
        set(KDEGAMES_INCLUDE_DIR)
 
20
        set(KDEGAMES_LIBRARY)
 
21
        FIND_PATH(KDEGAMES_INCLUDE_DIR kstandardgameaction.h
 
22
                ${INCLUDE_INSTALL_DIR}
 
23
                ${KDE4_INCLUDE_DIR} 
 
24
                ${GNUWIN32_DIR}/include
 
25
        )
 
26
        set(KDEGAMES_INCLUDE_DIR ${KDEGAMES_INCLUDE_DIR})
 
27
 
 
28
        set(CMAKE_LIBRARY_PATH ${LIB_INSTALL_DIR})
 
29
        find_library(KDEGAMES_LIBRARY NAMES kdegames
 
30
                PATHS
 
31
                ${LIB_INSTALL_DIR}
 
32
                ${KDE4_LIB_DIR}
 
33
                ${GNUWIN32_DIR}/lib
 
34
        )
 
35
        set(KDEGAMES_LIBRARY ${KDEGAMES_LIBRARY})
 
36
 
 
37
        include(FindPackageHandleStandardArgs)
 
38
        FIND_PACKAGE_HANDLE_STANDARD_ARGS(KDEGAMES DEFAULT_MSG KDEGAMES_INCLUDE_DIR KDEGAMES_LIBRARY )
 
39
        
 
40
        MARK_AS_ADVANCED(KDEGAMES_INCLUDE_DIR KDEGAMES_LIBRARY)
 
41
ENDIF(KDEGAMES_INCLUDE_DIR AND KDEGAMES_LIBRARY)
 
42
 
 
43
#The ${KDEGAMES_INCLUDE_DIR}/KDE addition is for the forwarding includes
 
44
IF(NOT KDEGAMES_INCLUDE_DIRS)
 
45
    SET(KDEGAMES_INCLUDE_DIRS ${KDEGAMES_INCLUDE_DIR} ${KDEGAMES_INCLUDE_DIR}/KDE ${KDEGAMES_INCLUDE_DIR}/KDE/KGame)
 
46
    MARK_AS_ADVANCED(KDEGAMES_INCLUDE_DIRS)
 
47
ENDIF(NOT KDEGAMES_INCLUDE_DIRS)
 
48