PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/MonoEmbed.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 57 lines | 41 code | 12 blank | 4 comment | 4 complexity | 2e915c41a98639129ff866107eb71c62 MD5 | raw file
 1# -*- cmake -*-
 2
 3include(Prebuilt)
 4use_prebuilt_binary(libmono)
 5
 6SET(GLIB_2_0 glib-2.0)
 7
 8if (WINDOWS)
 9    SET(MONO_LIB mono) 
10else (WINDOWS)
11    SET(MONO_LIB mono)
12    SET(M_LIBRARIES m)
13    SET(GTHREAD_2_0 gthread-2.0)
14endif(WINDOWS)
15
16
17IF (DARWIN)
18
19  FIND_LIBRARY(MONO_LIBRARY NAMES Mono)
20  # Find_file doesnt work as expected. Hardcode relative to Mono.framework. 
21  #FIND_FILE(GLIB_CONFIG glibconfig.h ${MONO_LIBRARY})
22  #FIND_FILE(MONO_GLIB_LIBRARY glib.h ${MONO_LIBRARY})
23  SET(MONO_GLIB_LIBRARY ${MONO_LIBRARY}/Headers/glib-2.0/)
24  SET(GLIB_CONFIG ${MONO_LIBRARY}/Libraries/glib-2.0/include/)
25  SET(MONO_LIB_DIRECTORY ${MONO_LIBRARY}/Libraries)
26
27  IF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
28    MESSAGE(STATUS "Found Mono for embedding")
29    INCLUDE_DIRECTORIES(${MONO_GLIB_LIBRARY} ${GLIB_CONFIG})
30    LINK_DIRECTORIES(${MONO_LIB_DIRECTORY})
31  ELSE (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
32    MESSAGE(FATAL_ERROR "Mono not found for embedding")   
33    MESSAGE(${MONO_LIBRARY})
34    MESSAGE(${MONO_GLIB_LIBRARY})
35    MESSAGE(${GLIB_CONFIG})
36  ENDIF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
37
38ELSE (DARWIN)
39
40  SET(MONO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)  
41  SET(GLIB_2_0_PLATFORM_INCLUDE_DIR
42    ${LIBS_PREBUILT_DIR}/include/glib-2.0)
43  SET(GLIB_2_0_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/glib-2.0)
44
45  INCLUDE_DIRECTORIES(
46    ${MONO_INCLUDE_DIR} 
47    ${GLIB_2_0_PLATFORM_INCLUDE_DIR} 
48    ${GLIB_2_0_INCLUDE_DIR})
49    
50ENDIF (DARWIN) 
51
52SET(MONO_LIBRARIES 
53    ${MONO_LIB} 
54    ${M_LIBRARIES} 
55    ${GLIB_2_0}
56    ${GTHREAD_2_0} 
57)