diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2010-09-13 09:16:49 -0700 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2010-09-13 09:16:49 -0700 |
commit | c2f5bc0b129e0e0d2606a8e7849bbf37eb0276ea (patch) | |
tree | f139be7762d07c9b3331a3ff475a71c9156a6814 /indra/cmake | |
parent | a6669cbd7905d75e5ff1ec596563bb6fad3c7642 (diff) | |
parent | 807aec7bafe19fca75a8f3980bd621fad7c8338e (diff) |
Merge with http://hg.secondlife.com/viewer-development after migration
of Brad's simconsole work.
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/FindJsonCpp.cmake | 55 | ||||
-rw-r--r-- | indra/cmake/JsonCpp.cmake | 22 |
2 files changed, 77 insertions, 0 deletions
diff --git a/indra/cmake/FindJsonCpp.cmake b/indra/cmake/FindJsonCpp.cmake new file mode 100644 index 0000000000..9d16f2aaab --- /dev/null +++ b/indra/cmake/FindJsonCpp.cmake @@ -0,0 +1,55 @@ +# -*- cmake -*- + +# - Find JSONCpp +# Find the JSONCpp includes and library +# This module defines +# JSONCPP_INCLUDE_DIR, where to find json.h, etc. +# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp. +# JSONCPP_FOUND, If false, do not try to use jsoncpp. +# also defined, but not for general use are +# JSONCPP_LIBRARY, where to find the jsoncpp library. + +FIND_PATH(JSONCPP_INCLUDE_DIR jsoncpp/json.h +/usr/local/include +/usr/include +) + +# Get the GCC compiler version +EXEC_PROGRAM(${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _gcc_COMPILER_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + +SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so) +FIND_LIBRARY(JSONCPP_LIBRARY + NAMES ${JSONCPP_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) + SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) + SET(JSONCPP_FOUND "YES") +ELSE (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) + SET(JSONCPP_FOUND "NO") +ENDIF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR) + + +IF (JSONCPP_FOUND) + IF (NOT JSONCPP_FIND_QUIETLY) + MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}") + ENDIF (NOT JSONCPP_FIND_QUIETLY) +ELSE (JSONCPP_FOUND) + IF (JSONCPP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find JSONCpp library") + ENDIF (JSONCPP_FIND_REQUIRED) +ENDIF (JSONCPP_FOUND) + +# Deprecated declarations. +SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARY} PATH) + +MARK_AS_ADVANCED( + JSONCPP_LIBRARY + JSONCPP_INCLUDE_DIR + ) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake new file mode 100644 index 0000000000..7dd565be7c --- /dev/null +++ b/indra/cmake/JsonCpp.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- + +include(Prebuilt) + +set(JSONCPP_FIND_QUIETLY ON) +set(JSONCPP_FIND_REQUIRED ON) + +if (STANDALONE) + include(FindJsonCpp) +else (STANDALONE) + use_prebuilt_binary(jsoncpp) + if (WINDOWS) + set(JSONCPP_LIBRARIES + debug json_vc80d + optimized json_vc80) + elseif (DARWIN) + set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt) + elseif (LINUX) + set(JSONCPP_LIBRARIES jsoncpp) + endif (WINDOWS) + set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/jsoncpp) +endif (STANDALONE) |