]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/include/Modules/FindGSLobj.cmake
ManualPaint RangeSlider 50% DFCH
[creaMaracasVisu.git] / lib / maracasVisuLib / include / Modules / FindGSLobj.cmake
1 #
2 # This module finds if GSLOBJ is installed and determines where the
3 # include files and libraries are. It also determines what the name of
4 # the library is. This code sets the following variables:
5 #
6 #  GSLOBJ_FOUND        = system has GSLOBJ and it should be used
7 #  GSLOBJ_LIBRARIES         = full path to the GSLOBJ library and linker flags on unix
8 #  CMAKE_GSLOBJ_CXX_FLAGS        = compiler flags for building GSLOBJ 
9 #  GSLOBJ_INCLUDE_DIR    = include path of GSLOBJ
10
11 IF(WIN32)
12 IF(NOT UNIX)
13   SET (GSLOBJ_POSSIBLE_LIB_PATHS
14     $ENV{GSLOBJ}/lib
15     $ENV{CREATIS}/gslobj/win32inst/lib
16     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GSLobj_is1;Inno Setup: App Path]/lib"
17   )
18
19   FIND_LIBRARY(GSLOBJ_STATIC_LIBRARY
20     NAMES gslobj
21     PATHS ${GSLOBJ_POSSIBLE_LIB_PATHS} 
22   )
23
24   SET (GSLOBJ_POSSIBLE_INCLUDE_PATHS
25     $ENV{GSLOBJ}/include
26     $ENV{CREATIS}/gslobj/win32inst/include
27     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GSLobj_is1;Inno Setup: App Path]/include"
28   )
29
30   FIND_PATH(GSLOBJ_INCLUDE_DIR
31     gslobj/gslobj.hxx
32     ${GSLOBJ_POSSIBLE_INCLUDE_PATHS} 
33   )
34
35   SET(GSLOBJ_LIBRARIES ${GSLOBJ_STATIC_LIBRARY} ${CMAKE_GSLOBJ_LIBRARIES})
36
37   MARK_AS_ADVANCED(
38     GSLOBJ_STATIC_LIBRARY
39     GSLOBJ_INCLUDE_DIR
40   )
41 ENDIF(NOT UNIX)
42 ENDIF(WIN32)
43
44 IF(UNIX)
45
46   FIND_PROGRAM(CMAKE_GSLOBJ_CONFIG gslobj-config ../gslobj/bin ../../gslobj/bin)
47   SET(CMAKE_GSLOBJ_CXX_FLAGS "`${CMAKE_GSLOBJ_CONFIG} --cflags`")
48   SET(GSLOBJ_LIBRARIES "`${CMAKE_GSLOBJ_CONFIG} --libs`")
49
50 ENDIF(UNIX)  
51
52 MARK_AS_ADVANCED(
53   CMAKE_GSLOBJ_CXX_FLAGS
54   GSLOBJ_INCLUDE_DIR
55 )
56
57 IF(GSLOBJ_LIBRARIES)
58   IF(GSLOBJ_INCLUDE_DIR OR CMAKE_GSLOBJ_CXX_FLAGS)
59     SET(CMAKE_GSLOBJ_CAN_COMPILE 1)
60     SET(GSLOBJ_FOUND 1)
61   ENDIF(GSLOBJ_INCLUDE_DIR OR CMAKE_GSLOBJ_CXX_FLAGS)
62 ENDIF(GSLOBJ_LIBRARIES)