aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake/FindJsonCpp.cmake
diff options
context:
space:
mode:
authorPatrick Sapinski2010-08-24 03:04:20 -0400
committerMcCabe Maxsted2010-08-30 17:04:59 -0700
commitded1245db74ae4c97d174c5779f8572ee2f032fa (patch)
treef42c33f233ed68e715a0ac4c74ddc043f43a68da /linden/indra/cmake/FindJsonCpp.cmake
parentAdded debug setting UseLegacyChatLogsFolder for saving chat.txt and IM logs i... (diff)
downloadmeta-impy-ded1245db74ae4c97d174c5779f8572ee2f032fa.zip
meta-impy-ded1245db74ae4c97d174c5779f8572ee2f032fa.tar.gz
meta-impy-ded1245db74ae4c97d174c5779f8572ee2f032fa.tar.bz2
meta-impy-ded1245db74ae4c97d174c5779f8572ee2f032fa.tar.xz
added spellcheck + translation from Emerald Viewer. references to modularsystems.sl should be changed!
Diffstat (limited to '')
-rw-r--r--linden/indra/cmake/FindJsonCpp.cmake60
1 files changed, 60 insertions, 0 deletions
diff --git a/linden/indra/cmake/FindJsonCpp.cmake b/linden/indra/cmake/FindJsonCpp.cmake
new file mode 100644
index 0000000..cf84b30
--- /dev/null
+++ b/linden/indra/cmake/FindJsonCpp.cmake
@@ -0,0 +1,60 @@
1# -*- cmake -*-
2
3# - Find JSONCpp
4# Find the JSONCpp includes and library
5# This module defines
6# JSONCPP_INCLUDE_DIR, where to find json.h, etc.
7# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
8# JSONCPP_FOUND, If false, do not try to use jsoncpp.
9# also defined, but not for general use are
10# JSONCPP_LIBRARY, where to find the jsoncpp library.
11
12FIND_PATH(JSONCPP_INCLUDE_DIR jsoncpp/json.h
13/usr/local/include
14/usr/include
15)
16
17# Get the GCC compiler version
18EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
19 ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
20 OUTPUT_VARIABLE _gcc_COMPILER_VERSION
21 OUTPUT_STRIP_TRAILING_WHITESPACE
22 )
23
24# Try to find a library that was compiled with the same compiler version as we currently use.
25SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
26IF (STANDALONE)
27 # On standalone, assume that the system installed library was compiled with the used compiler.
28 SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
29ENDIF (STANDALONE)
30FIND_LIBRARY(JSONCPP_LIBRARY
31 NAMES ${JSONCPP_NAMES}
32 PATHS /usr/lib /usr/local/lib
33 )
34
35IF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
36 SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
37 SET(JSONCPP_FOUND "YES")
38ELSE (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
39 SET(JSONCPP_FOUND "NO")
40ENDIF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
41
42
43IF (JSONCPP_FOUND)
44 IF (NOT JSONCPP_FIND_QUIETLY)
45 MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}")
46 ENDIF (NOT JSONCPP_FIND_QUIETLY)
47ELSE (JSONCPP_FOUND)
48 IF (JSONCPP_FIND_REQUIRED)
49 MESSAGE(FATAL_ERROR "Could not find JSONCpp library")
50 ENDIF (JSONCPP_FIND_REQUIRED)
51ENDIF (JSONCPP_FOUND)
52
53# Deprecated declarations.
54SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIR} )
55GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARY} PATH)
56
57MARK_AS_ADVANCED(
58 JSONCPP_LIBRARY
59 JSONCPP_INCLUDE_DIR
60 )