aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/cmake
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/cmake/00-Common.cmake206
-rw-r--r--linden/indra/cmake/APR.cmake55
-rw-r--r--linden/indra/cmake/Audio.cmake34
-rw-r--r--linden/indra/cmake/BerkeleyDB.cmake11
-rw-r--r--linden/indra/cmake/Boost.cmake49
-rw-r--r--linden/indra/cmake/BuildVersion.cmake18
-rw-r--r--linden/indra/cmake/CARes.cmake23
-rw-r--r--linden/indra/cmake/CMakeCopyIfDifferent.cmake41
-rw-r--r--linden/indra/cmake/CSharpMacros.cmake142
-rw-r--r--linden/indra/cmake/CURL.cmake19
-rw-r--r--linden/indra/cmake/CommonMiscLibs.cmake7
-rw-r--r--linden/indra/cmake/CopyBackToSource.cmake16
-rw-r--r--linden/indra/cmake/CopyWinLibs.cmake155
-rw-r--r--linden/indra/cmake/DirectX.cmake40
-rw-r--r--linden/indra/cmake/ELFIO.cmake19
-rw-r--r--linden/indra/cmake/EXPAT.cmake17
-rw-r--r--linden/indra/cmake/FMOD.cmake64
-rw-r--r--linden/indra/cmake/FindAPR.cmake94
-rw-r--r--linden/indra/cmake/FindBerkeleyDB.cmake50
-rw-r--r--linden/indra/cmake/FindCARes.cmake48
-rw-r--r--linden/indra/cmake/FindELFIO.cmake48
-rw-r--r--linden/indra/cmake/FindGooglePerfTools.cmake66
-rw-r--r--linden/indra/cmake/FindMono.cmake68
-rw-r--r--linden/indra/cmake/FindMySQL.cmake48
-rw-r--r--linden/indra/cmake/FindOpenJPEG.cmake50
-rw-r--r--linden/indra/cmake/FindSCP.cmake40
-rw-r--r--linden/indra/cmake/FindXmlRpcEpi.cmake48
-rw-r--r--linden/indra/cmake/FreeType.cmake20
-rw-r--r--linden/indra/cmake/GStreamer.cmake38
-rw-r--r--linden/indra/cmake/GooglePerfTools.cmake28
-rw-r--r--linden/indra/cmake/JPEG.cmake23
-rw-r--r--linden/indra/cmake/LLAudio.cmake15
-rw-r--r--linden/indra/cmake/LLCharacter.cmake9
-rw-r--r--linden/indra/cmake/LLCommon.cmake21
-rw-r--r--linden/indra/cmake/LLCrashLogger.cmake9
-rw-r--r--linden/indra/cmake/LLDatabase.cmake13
-rw-r--r--linden/indra/cmake/LLImage.cmake15
-rw-r--r--linden/indra/cmake/LLImageJ2COJ.cmake8
-rw-r--r--linden/indra/cmake/LLInventory.cmake9
-rw-r--r--linden/indra/cmake/LLKDU.cmake20
-rw-r--r--linden/indra/cmake/LLMath.cmake9
-rw-r--r--linden/indra/cmake/LLMedia.cmake15
-rw-r--r--linden/indra/cmake/LLMessage.cmake22
-rw-r--r--linden/indra/cmake/LLPhysics.cmake76
-rw-r--r--linden/indra/cmake/LLPrimitive.cmake9
-rw-r--r--linden/indra/cmake/LLRender.cmake32
-rw-r--r--linden/indra/cmake/LLScene.cmake9
-rw-r--r--linden/indra/cmake/LLUI.cmake9
-rw-r--r--linden/indra/cmake/LLVFS.cmake13
-rw-r--r--linden/indra/cmake/LLWindow.cmake43
-rw-r--r--linden/indra/cmake/LLXML.cmake13
-rw-r--r--linden/indra/cmake/LScript.cmake16
-rw-r--r--linden/indra/cmake/Linking.cmake45
-rw-r--r--linden/indra/cmake/MonoDeps.cmake48
-rw-r--r--linden/indra/cmake/MonoEmbed.cmake57
-rw-r--r--linden/indra/cmake/Mozlib.cmake47
-rw-r--r--linden/indra/cmake/MySQL.cmake23
-rw-r--r--linden/indra/cmake/NDOF.cmake14
-rw-r--r--linden/indra/cmake/OpenGL.cmake9
-rw-r--r--linden/indra/cmake/OpenJPEG.cmake22
-rw-r--r--linden/indra/cmake/OpenSSL.cmake23
-rw-r--r--linden/indra/cmake/PNG.cmake13
-rw-r--r--linden/indra/cmake/Prebuilt.cmake44
-rw-r--r--linden/indra/cmake/Python.cmake49
-rw-r--r--linden/indra/cmake/QuickTime.cmake33
-rw-r--r--linden/indra/cmake/TemplateCheck.cmake14
-rw-r--r--linden/indra/cmake/UI.cmake64
-rw-r--r--linden/indra/cmake/UnixInstall.cmake31
-rw-r--r--linden/indra/cmake/Variables.cmake100
-rw-r--r--linden/indra/cmake/ViewerMiscLibs.cmake10
-rw-r--r--linden/indra/cmake/XmlRpcEpi.cmake17
-rw-r--r--linden/indra/cmake/ZLIB.cmake20
72 files changed, 2653 insertions, 0 deletions
diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake
new file mode 100644
index 0000000..240853a
--- /dev/null
+++ b/linden/indra/cmake/00-Common.cmake
@@ -0,0 +1,206 @@
1# -*- cmake -*-
2#
3# Compilation options shared by all Second Life components.
4
5include(Variables)
6
7
8# Portable compilation flags.
9
10set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
11set(CMAKE_CXX_FLAGS_RELEASE
12 "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG")
13set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
14 "-DLL_RELEASE=1 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
15
16
17# Don't bother with a MinSizeRel build.
18
19set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
20 "Supported build types." FORCE)
21
22
23# Platform-specific compilation flags.
24
25if (WINDOWS)
26 # Don't build DLLs.
27 set(BUILD_SHARED_LIBS OFF)
28
29 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MTd"
30 CACHE STRING "C++ compiler debug options" FORCE)
31 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
32 "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MT"
33 CACHE STRING "C++ compiler release-with-debug options" FORCE)
34 set(CMAKE_CXX_FLAGS_RELEASE
35 "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MT"
36 CACHE STRING "C++ compiler release options" FORCE)
37
38 add_definitions(
39 /DLL_WINDOWS=1
40 /DUNICODE
41 /D_UNICODE
42 /GS
43 /TP
44 /W3
45 /c
46 /Zc:forScope
47 /nologo
48 /Oy-
49 )
50
51 if(MSVC80 OR MSVC90)
52 add_definitions(
53 /Zc:wchar_t-
54 )
55 endif (MSVC80 OR MSVC90)
56
57 # Are we using the crummy Visual Studio KDU build workaround?
58 if (NOT VS_DISABLE_FATAL_WARNINGS)
59 add_definitions(/WX)
60 endif (NOT VS_DISABLE_FATAL_WARNINGS)
61endif (WINDOWS)
62
63
64if (LINUX)
65 set(CMAKE_SKIP_RPATH TRUE)
66
67 # Here's a giant hack for Fedora 8, where we can't use
68 # _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1.
69
70 find_program(GXX g++)
71 mark_as_advanced(GXX)
72
73 if (GXX)
74 execute_process(
75 COMMAND ${GXX} --version
76 COMMAND sed "s/^[gc+ ]*//"
77 COMMAND head -1
78 OUTPUT_VARIABLE GXX_VERSION
79 OUTPUT_STRIP_TRAILING_WHITESPACE
80 )
81 else (GXX)
82 set(GXX_VERSION x)
83 endif (GXX)
84
85 # The quoting hack here is necessary in case we're using distcc or
86 # ccache as our compiler. CMake doesn't pass the command line
87 # through the shell by default, so we end up trying to run "distcc"
88 # " g++" - notice the leading space. Ugh.
89
90 execute_process(
91 COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version"
92 COMMAND sed "s/^[gc+ ]*//"
93 COMMAND head -1
94 OUTPUT_VARIABLE CXX_VERSION
95 OUTPUT_STRIP_TRAILING_WHITESPACE)
96
97 if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
98 add_definitions(-D_FORTIFY_SOURCE=2)
99 else (${GXX_VERSION} STREQUAL ${CXX_VERSION})
100 if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
101 add_definitions(-D_FORTIFY_SOURCE=2)
102 endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
103 endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})
104
105 # GCC 4.3 introduces a pile of obnoxious new warnings, which we
106 # treat as errors due to -Werror. Quiet the most offensive and
107 # widespread of them.
108
109 if (${CXX_VERSION} MATCHES "4.3")
110 add_definitions(-Wno-deprecated -Wno-parentheses)
111 endif (${CXX_VERSION} MATCHES "4.3")
112
113 # End of hacks.
114
115 add_definitions(
116 -DLL_LINUX=1
117 -D_REENTRANT
118 -fexceptions
119 -fno-math-errno
120 -fno-strict-aliasing
121 -fsigned-char
122 -g
123 -pthread
124 )
125
126 if (SERVER)
127 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-60")
128 if (EXISTS /etc/debian_version)
129 FILE(READ /etc/debian_version DEBIAN_VERSION)
130 else (EXISTS /etc/debian_version)
131 set(DEBIAN_VERSION "")
132 endif (EXISTS /etc/debian_version)
133
134 if (NOT DEBIAN_VERSION STREQUAL "3.1")
135 add_definitions(-DCTYPE_WORKAROUND)
136 endif (NOT DEBIAN_VERSION STREQUAL "3.1")
137
138 if (EXISTS /usr/lib/mysql4/mysql)
139 link_directories(/usr/lib/mysql4/mysql)
140 endif (EXISTS /usr/lib/mysql4/mysql)
141
142 add_definitions(
143 -msse2
144 -mfpmath=sse
145 )
146 endif (SERVER)
147
148 if (VIEWER)
149 add_definitions(-DAPPID=secondlife)
150 add_definitions(-fvisibility=hidden)
151 if (NOT STANDALONE)
152 # this stops us requiring a really recent glibc at runtime
153 add_definitions(-fno-stack-protector)
154 endif (NOT STANDALONE)
155 endif (VIEWER)
156
157 set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
158 set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
159endif (LINUX)
160
161
162if (DARWIN)
163 add_definitions(-DLL_DARWIN=1)
164 set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
165 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
166 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
167 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
168endif (DARWIN)
169
170
171if (LINUX OR DARWIN)
172 set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
173
174 if (NOT GCC_DISABLE_FATAL_WARNINGS)
175 set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
176 endif (NOT GCC_DISABLE_FATAL_WARNINGS)
177
178 set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder")
179
180 set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
181 set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
182endif (LINUX OR DARWIN)
183
184
185if (STANDALONE)
186 add_definitions(-DLL_STANDALONE=1)
187
188 if (LINUX AND ${ARCH} STREQUAL "i686")
189 add_definitions(-march=pentiumpro)
190 endif (LINUX AND ${ARCH} STREQUAL "i686")
191
192else (STANDALONE)
193 set(${ARCH}_linux_INCLUDES
194 ELFIO
195 atk-1.0
196 glib-2.0
197 gstreamer-0.10
198 gtk-2.0
199 llfreetype2
200 pango-1.0
201 )
202endif (STANDALONE)
203
204if(SERVER)
205 include_directories(${LIBS_PREBUILT_DIR}/include/havok)
206endif(SERVER)
diff --git a/linden/indra/cmake/APR.cmake b/linden/indra/cmake/APR.cmake
new file mode 100644
index 0000000..2a96d70
--- /dev/null
+++ b/linden/indra/cmake/APR.cmake
@@ -0,0 +1,55 @@
1# -*- cmake -*-
2
3include(BerkeleyDB)
4include(Linking)
5include(Prebuilt)
6
7set(APR_FIND_QUIETLY ON)
8set(APR_FIND_REQUIRED ON)
9
10set(APRUTIL_FIND_QUIETLY ON)
11set(APRUTIL_FIND_REQUIRED ON)
12
13if (STANDALONE)
14 include(FindAPR)
15else (STANDALONE)
16 use_prebuilt_binary(apr_suite)
17 if (WINDOWS)
18 set(WINLIBS_PREBUILT_DEBUG_DIR
19 ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug
20 )
21 set(WINLIBS_PREBUILT_RELEASE_DIR
22 ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release
23 )
24 set(APR_LIBRARIES
25 debug ${WINLIBS_PREBUILT_DEBUG_DIR}/apr-1.lib
26 optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/apr-1.lib
27 )
28 set(APRUTIL_LIBRARIES
29 debug ${WINLIBS_PREBUILT_DEBUG_DIR}/aprutil-1.lib
30 optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/aprutil-1.lib
31 )
32 set(APRICONV_LIBRARIES
33 debug ${WINLIBS_PREBUILT_DEBUG_DIR}/apriconv-1.lib
34 optimized ${WINLIBS_PREBUILT_RELEASE_DIR}/apriconv-1.lib
35 )
36 elseif (DARWIN)
37 set(APR_LIBRARIES
38 debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
39 optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
40 )
41 set(APRUTIL_LIBRARIES
42 debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
43 optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
44 )
45 set(APRICONV_LIBRARIES apriconv-1)
46 else (WINDOWS)
47 set(APR_LIBRARIES apr-1)
48 set(APRUTIL_LIBRARIES aprutil-1)
49 endif (WINDOWS)
50 set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/apr-1)
51
52 if (LINUX AND VIEWER)
53 list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
54 endif (LINUX AND VIEWER)
55endif (STANDALONE)
diff --git a/linden/indra/cmake/Audio.cmake b/linden/indra/cmake/Audio.cmake
new file mode 100644
index 0000000..c6ccab2
--- /dev/null
+++ b/linden/indra/cmake/Audio.cmake
@@ -0,0 +1,34 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (STANDALONE)
5 include(FindPkgConfig)
6 pkg_check_modules(OGG REQUIRED ogg)
7 pkg_check_modules(VORBIS REQUIRED vorbis)
8 pkg_check_modules(VORBISENC REQUIRED vorbisenc)
9 pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
10else (STANDALONE)
11 use_prebuilt_binary(ogg-vorbis)
12 set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
13 set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
14 set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
15
16 if (WINDOWS)
17 set(OGG_LIBRARIES ogg_static_mt)
18 set(VORBIS_LIBRARIES vorbis_static_mt)
19 set(VORBISENC_LIBRARIES vorbisenc_static_mt)
20 set(VORBISFILE_LIBRARIES vorbisfile_static_mt)
21 else (WINDOWS)
22 set(OGG_LIBRARIES ogg)
23 set(VORBIS_LIBRARIES vorbis)
24 set(VORBISENC_LIBRARIES vorbisenc)
25 set(VORBISFILE_LIBRARIES vorbisfile)
26 endif (WINDOWS)
27endif (STANDALONE)
28
29link_directories(
30 ${VORBIS_LIBRARY_DIRS}
31 ${VORBISENC_LIBRARY_DIRS}
32 ${VORBISFILE_LIBRARY_DIRS}
33 ${OGG_LIBRARY_DIRS}
34 )
diff --git a/linden/indra/cmake/BerkeleyDB.cmake b/linden/indra/cmake/BerkeleyDB.cmake
new file mode 100644
index 0000000..d98e791
--- /dev/null
+++ b/linden/indra/cmake/BerkeleyDB.cmake
@@ -0,0 +1,11 @@
1# -*- cmake -*-
2
3set(DB_FIND_QUIETLY ON)
4set(DB_FIND_REQUIRED ON)
5
6if (STANDALONE)
7 include(FindBerkeleyDB)
8else (STANDALONE)
9 set(DB_LIBRARIES db-4.2)
10 set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
11endif (STANDALONE)
diff --git a/linden/indra/cmake/Boost.cmake b/linden/indra/cmake/Boost.cmake
new file mode 100644
index 0000000..a7db67c
--- /dev/null
+++ b/linden/indra/cmake/Boost.cmake
@@ -0,0 +1,49 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(Boost_FIND_QUIETLY ON)
5set(Boost_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindBoost)
9
10 set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
11 set(BOOST_REGEX_LIBRARY boost_regex-mt)
12 set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
13else (STANDALONE)
14 use_prebuilt_binary(boost)
15 set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
16
17 if (WINDOWS)
18 set(BOOST_VERSION 1_34_1)
19 if (MSVC71)
20 set(BOOST_PROGRAM_OPTIONS_LIBRARY
21 optimized libboost_program_options-vc71-mt-s-${BOOST_VERSION}
22 debug libboost_program_options-vc71-mt-sgd-${BOOST_VERSION})
23 set(BOOST_REGEX_LIBRARY
24 optimized libboost_regex-vc71-mt-s-${BOOST_VERSION}
25 debug libboost_regex-vc71-mt-sgd-${BOOST_VERSION})
26 set(BOOST_SIGNALS_LIBRARY
27 optimized libboost_signals-vc71-mt-s-${BOOST_VERSION}
28 debug libboost_signals-vc71-mt-sgd-${BOOST_VERSION})
29 else (MSVC71)
30 set(BOOST_PROGRAM_OPTIONS_LIBRARY
31 optimized libboost_program_options-vc80-mt-s-${BOOST_VERSION}
32 debug libboost_program_options-vc80-mt-sgd-${BOOST_VERSION})
33 set(BOOST_REGEX_LIBRARY
34 optimized libboost_regex-vc80-mt-s-${BOOST_VERSION}
35 debug libboost_regex-vc80-mt-sgd-${BOOST_VERSION})
36 set(BOOST_SIGNALS_LIBRARY
37 optimized libboost_signals-vc80-mt-s-${BOOST_VERSION}
38 debug libboost_signals-vc80-mt-sgd-${BOOST_VERSION})
39 endif (MSVC71)
40 elseif (DARWIN)
41 set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
42 set(BOOST_REGEX_LIBRARY boost_regex-mt)
43 set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
44 elseif (LINUX)
45 set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
46 set(BOOST_REGEX_LIBRARY boost_regex-mt)
47 set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
48 endif (WINDOWS)
49endif (STANDALONE)
diff --git a/linden/indra/cmake/BuildVersion.cmake b/linden/indra/cmake/BuildVersion.cmake
new file mode 100644
index 0000000..60a519c
--- /dev/null
+++ b/linden/indra/cmake/BuildVersion.cmake
@@ -0,0 +1,18 @@
1# -*- cmake -*-
2
3include(Python)
4
5macro (build_version _target)
6 execute_process(
7 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py
8 llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS}
9 OUTPUT_VARIABLE ${_target}_VERSION
10 OUTPUT_STRIP_TRAILING_WHITESPACE
11 )
12
13 if (${_target}_VERSION)
14 message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
15 else (${_target}_VERSION)
16 message(SEND_ERROR "Could not determine ${_target} version")
17 endif (${_target}_VERSION)
18endmacro (build_version)
diff --git a/linden/indra/cmake/CARes.cmake b/linden/indra/cmake/CARes.cmake
new file mode 100644
index 0000000..8a2dc01
--- /dev/null
+++ b/linden/indra/cmake/CARes.cmake
@@ -0,0 +1,23 @@
1# -*- cmake -*-
2include(Linking)
3include(Prebuilt)
4
5set(CARES_FIND_QUIETLY ON)
6set(CARES_FIND_REQUIRED ON)
7
8if (STANDALONE)
9 include(FindCARes)
10else (STANDALONE)
11 use_prebuilt_binary(ares)
12 if (WINDOWS)
13 set(CARES_LIBRARIES areslib)
14 elseif (DARWIN)
15 set(CARES_LIBRARIES
16 optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.a
17 debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcares.a
18 )
19 else (WINDOWS)
20 set(CARES_LIBRARIES cares)
21 endif (WINDOWS)
22 set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
23endif (STANDALONE)
diff --git a/linden/indra/cmake/CMakeCopyIfDifferent.cmake b/linden/indra/cmake/CMakeCopyIfDifferent.cmake
new file mode 100644
index 0000000..55e71ff
--- /dev/null
+++ b/linden/indra/cmake/CMakeCopyIfDifferent.cmake
@@ -0,0 +1,41 @@
1# -*- cmake -*-
2# Taken from http://www.cmake.org/Wiki/CMakeCopyIfDifferent
3# Generates a rule to copy each source file from source directory to destination directory.
4#
5# Typical use -
6#
7# SET(SRC_FILES head1.h head2.h head3.h)
8# COPY_IF_DIFFERENT( /from_dir /to_dir IncludeTargets ${SRC_FILES})
9# ADD_TARGET(CopyIncludes ALL DEPENDS ${IncludeTargets})
10
11MACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR TARGETS)
12# Macro to implement copy_if_different for a list of files
13# Arguments -
14# FROM_DIR - this is the source directory
15# TO_DIR - this is the destination directory
16# TARGETS - A variable to receive a list of targets
17# FILES - names of the files to copy
18# TODO: add globing.
19SET(AddTargets "")
20FOREACH(SRC ${ARGN})
21 GET_FILENAME_COMPONENT(SRCFILE ${SRC} NAME)
22 IF("${FROM_DIR}" STREQUAL "")
23 SET(FROM ${SRC})
24 ELSE("${FROM_DIR}" STREQUAL "")
25 SET(FROM ${FROM_DIR}/${SRC})
26 ENDIF("${FROM_DIR}" STREQUAL "")
27 IF("${TO_DIR}" STREQUAL "")
28 SET(TO ${SRCFILE})
29 ELSE("${TO_DIR}" STREQUAL "")
30 SET(TO ${TO_DIR}/${SRCFILE})
31 ENDIF("${TO_DIR}" STREQUAL "")
32 ADD_CUSTOM_COMMAND(
33 OUTPUT "${TO}"
34 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FROM} ${TO}
35 DEPENDS ${FROM}
36 COMMENT "Copying ${SRCFILE} ${TO_DIR}"
37 )
38 SET(AddTargets ${AddTargets} ${TO})
39ENDFOREACH(SRC ${ARGN})
40SET(${TARGETS} ${AddTargets})
41ENDMACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR TARGETS)
diff --git a/linden/indra/cmake/CSharpMacros.cmake b/linden/indra/cmake/CSharpMacros.cmake
new file mode 100644
index 0000000..a4dd815
--- /dev/null
+++ b/linden/indra/cmake/CSharpMacros.cmake
@@ -0,0 +1,142 @@
1# - This is a support module for easy Mono/C# handling with CMake
2# It defines the following macros:
3#
4# ADD_CS_LIBRARY (<target> <source>)
5# ADD_CS_EXECUTABLE (<target> <source>)
6# INSTALL_GAC (<target>)
7#
8# Note that the order of the arguments is important.
9#
10# You can optionally set the variable CS_FLAGS to tell the macros whether
11# to pass additional flags to the compiler. This is particularly useful to
12# set assembly references, unsafe code, etc... These flags are always reset
13# after the target was added so you don't have to care about that.
14#
15# copyright (c) 2007 Arno Rehn arno@arnorehn.de
16#
17# Redistribution and use is allowed according to the terms of the GPL license.
18
19
20# ----- support macros -----
21MACRO(GET_CS_LIBRARY_TARGET_DIR)
22 IF (NOT LIBRARY_OUTPUT_PATH)
23 SET(CS_LIBRARY_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
24 ELSE (NOT LIBRARY_OUTPUT_PATH)
25 SET(CS_LIBRARY_TARGET_DIR ${LIBRARY_OUTPUT_PATH})
26 ENDIF (NOT LIBRARY_OUTPUT_PATH)
27ENDMACRO(GET_CS_LIBRARY_TARGET_DIR)
28
29MACRO(GET_CS_EXECUTABLE_TARGET_DIR)
30 IF (NOT EXECUTABLE_OUTPUT_PATH)
31 SET(CS_EXECUTABLE_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
32 ELSE (NOT EXECUTABLE_OUTPUT_PATH)
33 SET(CS_EXECUTABLE_TARGET_DIR ${EXECUTABLE_OUTPUT_PATH})
34 ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
35ENDMACRO(GET_CS_EXECUTABLE_TARGET_DIR)
36
37MACRO(MAKE_PROPER_FILE_LIST)
38 FOREACH(file ${ARGN})
39 # first assume it's a relative path
40 FILE(GLOB globbed ${CMAKE_CURRENT_SOURCE_DIR}/${file})
41 IF(globbed)
42 FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file} native)
43 ELSE(globbed)
44 FILE(TO_NATIVE_PATH ${file} native)
45 ENDIF(globbed)
46 SET(proper_file_list ${proper_file_list} ${native})
47 SET(native "")
48 ENDFOREACH(file)
49ENDMACRO(MAKE_PROPER_FILE_LIST)
50# ----- end support macros -----
51
52MACRO(ADD_CS_LIBRARY target)
53 GET_CS_LIBRARY_TARGET_DIR()
54
55 SET(target_DLL "${CS_LIBRARY_TARGET_DIR}/${target}.dll")
56 MAKE_PROPER_FILE_LIST(${ARGN})
57 FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_DLL})
58
59 SET(target_KEY "${CMAKE_CURRENT_SOURCE_DIR}/${target}.key")
60 SET(target_CS_FLAGS "${CS_FLAGS}")
61 IF(${target}_CS_FLAGS)
62 LIST(APPEND target_CS_FLAGS ${${target}_CS_FLAGS})
63 ENDIF(${target}_CS_FLAGS)
64 IF(EXISTS ${target_KEY})
65 LIST(APPEND target_CS_FLAGS -keyfile:${target_KEY})
66 ENDIF(EXISTS ${target_KEY})
67
68 FOREACH(ref ${${target}_REFS})
69 SET(ref_DLL ${CMAKE_CURRENT_BINARY_DIR}/${ref}.dll)
70 IF(EXISTS ${ref_DLL})
71 LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
72 ELSE(EXISTS ${ref_DLL})
73 LIST(APPEND target_CS_FLAGS -r:${ref})
74 ENDIF(EXISTS ${ref_DLL})
75 ENDFOREACH(ref ${${target}_REFS})
76
77 ADD_CUSTOM_COMMAND (OUTPUT ${target_DLL}
78 COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_DLL} -target:library ${proper_file_list}
79 MAIN_DEPENDENCY ${proper_file_list}
80 DEPENDS ${ARGN}
81 COMMENT "Building ${relative_path}")
82 ADD_CUSTOM_TARGET (${target} ALL DEPENDS ${target_DLL})
83
84 FOREACH(ref ${${target}_REFS})
85 GET_TARGET_PROPERTY(is_target ${ref} TYPE)
86 IF(is_target)
87 ADD_DEPENDENCIES(${target} ${ref})
88 ENDIF(is_target)
89 ENDFOREACH(ref ${${target}_REFS})
90
91 SET(relative_path "")
92 SET(proper_file_list "")
93ENDMACRO(ADD_CS_LIBRARY)
94
95MACRO(ADD_CS_EXECUTABLE target)
96 GET_CS_EXECUTABLE_TARGET_DIR()
97
98 # Seems like cmake doesn't like the ".exe" ending for custom commands.
99 # If we call it ${target}.exe, 'make' will later complain about a missing rule.
100 # Create a fake target instead.
101 SET(target_EXE "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe")
102 SET(target_TOUCH "${CS_EXECUTABLE_TARGET_DIR}/${target}.exe-built")
103 GET_DIRECTORY_PROPERTY(clean ADDITIONAL_MAKE_CLEAN_FILES)
104 LIST(APPEND clean ${target}.exe)
105 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${clean}")
106 MAKE_PROPER_FILE_LIST(${ARGN})
107 FILE(RELATIVE_PATH relative_path ${CMAKE_BINARY_DIR} ${target_EXE})
108 SET(target_CS_FLAGS "${CS_FLAGS}")
109
110 FOREACH(ref ${${target}_REFS})
111 SET(ref_DLL ${CMAKE_CURRENT_SOURCE_DIR}/${ref}.dll)
112 IF(EXISTS ${ref_DLL})
113 LIST(APPEND target_CS_FLAGS -r:${ref_DLL})
114 ELSE(EXISTS ${ref_DLL})
115 LIST(APPEND target_CS_FLAGS -r:${ref})
116 ENDIF(EXISTS ${ref_DLL})
117 ENDFOREACH(ref ${${target}_REFS})
118
119 ADD_CUSTOM_COMMAND (OUTPUT "${target_TOUCH}"
120 COMMAND ${MCS_EXECUTABLE} ${target_CS_FLAGS} -out:${target_EXE} ${proper_file_list}
121 COMMAND ${CMAKE_COMMAND} -E touch ${target_TOUCH}
122 MAIN_DEPENDENCY ${ARGN}
123 DEPENDS ${ARGN}
124 COMMENT "Building ${relative_path}")
125 ADD_CUSTOM_TARGET ("${target}" ALL DEPENDS "${target_TOUCH}")
126
127 FOREACH(ref ${${target}_REFS})
128 GET_TARGET_PROPERTY(is_target ${ref} TYPE)
129 IF(is_target)
130 ADD_DEPENDENCIES(${target} ${ref})
131 ENDIF(is_target)
132 ENDFOREACH(ref ${${target}_REFS})
133
134 SET(relative_path "")
135 SET(proper_file_list "")
136ENDMACRO(ADD_CS_EXECUTABLE)
137
138MACRO(INSTALL_GAC target)
139 GET_CS_LIBRARY_TARGET_DIR()
140
141 INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GACUTIL_EXECUTABLE} -i ${CS_LIBRARY_TARGET_DIR}/${target}.dll -package 2.0)")
142ENDMACRO(INSTALL_GAC target)
diff --git a/linden/indra/cmake/CURL.cmake b/linden/indra/cmake/CURL.cmake
new file mode 100644
index 0000000..6e5fed4
--- /dev/null
+++ b/linden/indra/cmake/CURL.cmake
@@ -0,0 +1,19 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(CURL_FIND_QUIETLY ON)
5set(CURL_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindCURL)
9else (STANDALONE)
10 use_prebuilt_binary(curl)
11 if (WINDOWS)
12 set(CURL_LIBRARIES
13 debug libcurld
14 optimized libcurl)
15 else (WINDOWS)
16 set(CURL_LIBRARIES curl)
17 endif (WINDOWS)
18 set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
19endif (STANDALONE)
diff --git a/linden/indra/cmake/CommonMiscLibs.cmake b/linden/indra/cmake/CommonMiscLibs.cmake
new file mode 100644
index 0000000..513acf3
--- /dev/null
+++ b/linden/indra/cmake/CommonMiscLibs.cmake
@@ -0,0 +1,7 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (NOT STANDALONE)
5 use_prebuilt_binary(tut)
6endif(NOT STANDALONE)
7
diff --git a/linden/indra/cmake/CopyBackToSource.cmake b/linden/indra/cmake/CopyBackToSource.cmake
new file mode 100644
index 0000000..d217df9
--- /dev/null
+++ b/linden/indra/cmake/CopyBackToSource.cmake
@@ -0,0 +1,16 @@
1# -*- cmake -*-
2# Copies a binary back to the source directory
3
4MACRO(COPY_BACK_TO_SOURCE target)
5 GET_TARGET_PROPERTY(FROM ${target} LOCATION)
6 SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
7 #MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
8 ADD_CUSTOM_COMMAND(
9 TARGET ${target} POST_BUILD
10 COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}
11 DEPENDS ${FROM}
12 COMMENT "Copying ${target} to ${CMAKE_CURRENT_BINARY_DIR}"
13 )
14ENDMACRO(COPY_BACK_TO_SOURCE)
15
16
diff --git a/linden/indra/cmake/CopyWinLibs.cmake b/linden/indra/cmake/CopyWinLibs.cmake
new file mode 100644
index 0000000..345761a
--- /dev/null
+++ b/linden/indra/cmake/CopyWinLibs.cmake
@@ -0,0 +1,155 @@
1# -*- cmake -*-
2
3# The copy_win_libs folder contains file lists and a script used to
4# copy dlls, exes and such needed to run the SecondLife from within
5# VisualStudio.
6
7include(CMakeCopyIfDifferent)
8
9set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
10set(vivox_files
11 tntk.dll
12 libeay32.dll
13 SLVoice.exe
14 ssleay32.dll
15 SLVoiceAgent.exe
16 srtp.dll
17 alut.dll
18 vivoxsdk.dll
19 ortp.dll
20 wrap_oal.dll
21 )
22
23set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
24set(debug_files
25 freebl3.dll
26 gksvggdiplus.dll
27 js3250.dll
28 nspr4.dll
29 nss3.dll
30 nssckbi.dll
31 plc4.dll
32 plds4.dll
33 smime3.dll
34 softokn3.dll
35 ssl3.dll
36 xpcom.dll
37 xul.dll
38 openjpegd.dll
39 windbgdlg.exe
40 )
41
42copy_if_different(
43 ${debug_src_dir}
44 "${CMAKE_CURRENT_BINARY_DIR}/Debug"
45 out_targets
46 ${debug_files}
47 )
48set(all_targets ${all_targets} ${out_targets})
49
50copy_if_different(
51 ${vivox_src_dir}
52 "${CMAKE_CURRENT_BINARY_DIR}/Debug"
53 out_targets
54 ${vivox_files}
55 )
56set(all_targets ${all_targets} ${out_targets})
57
58set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
59set(release_files
60 freebl3.dll
61 gksvggdiplus.dll
62 js3250.dll
63 nspr4.dll
64 nss3.dll
65 nssckbi.dll
66 plc4.dll
67 plds4.dll
68 smime3.dll
69 softokn3.dll
70 ssl3.dll
71 xpcom.dll
72 xul.dll
73 openjpeg.dll
74 )
75
76copy_if_different(
77 ${release_src_dir}
78 "${CMAKE_CURRENT_BINARY_DIR}/Release"
79 out_targets
80 ${release_files}
81 )
82set(all_targets ${all_targets} ${out_targets})
83
84copy_if_different(
85 ${vivox_src_dir}
86 "${CMAKE_CURRENT_BINARY_DIR}/Release"
87 out_targets
88 ${vivox_files}
89 )
90set(all_targets ${all_targets} ${out_targets})
91
92copy_if_different(
93 ${release_src_dir}
94 "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
95 out_targets
96 ${release_files}
97 )
98set(all_targets ${all_targets} ${out_targets})
99
100copy_if_different(
101 ${vivox_src_dir}
102 "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
103 out_targets
104 ${vivox_files}
105 )
106set(all_targets ${all_targets} ${out_targets})
107
108set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
109if(EXISTS ${internal_llkdu_path})
110 set(internal_llkdu_src "${CMAKE_BINARY_DIR}/llkdu/${CMAKE_CFG_INTDIR}/llkdu.dll")
111 set(llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll")
112 ADD_CUSTOM_COMMAND(
113 OUTPUT ${llkdu_dst}
114 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${internal_llkdu_src} ${llkdu_dst}
115 DEPENDS ${internal_llkdu_src}
116 COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
117 )
118 set(all_targets ${all_targets} ${llkdu_dst})
119else(EXISTS ${internal_llkdu_path})
120 set(debug_llkdu_src "${debug_src_dir}/llkdu.dll")
121 set(debug_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Debug/llkdu.dll")
122 ADD_CUSTOM_COMMAND(
123 OUTPUT ${debug_llkdu_dst}
124 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst}
125 DEPENDS ${debug_llkdu_src}
126 COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Debug"
127 )
128 set(all_targets ${all_targets} ${debug_llkdu_dst})
129
130 set(release_llkdu_src "${release_src_dir}/llkdu.dll")
131 set(release_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/Release/llkdu.dll")
132 ADD_CUSTOM_COMMAND(
133 OUTPUT ${release_llkdu_dst}
134 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst}
135 DEPENDS ${release_llkdu_src}
136 COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release"
137 )
138 set(all_targets ${all_targets} ${release_llkdu_dst})
139
140 set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll")
141 ADD_CUSTOM_COMMAND(
142 OUTPUT ${relwithdebinfo_llkdu_dst}
143 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst}
144 DEPENDS ${release_llkdu_src}
145 COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
146 )
147 set(all_targets ${all_targets} ${relwithdebinfo_llkdu_dst})
148
149endif (EXISTS ${internal_llkdu_path})
150
151add_custom_target(copy_win_libs ALL DEPENDS ${all_targets})
152
153if(EXISTS ${internal_llkdu_path})
154 add_dependencies(copy_win_libs llkdu)
155endif(EXISTS ${internal_llkdu_path})
diff --git a/linden/indra/cmake/DirectX.cmake b/linden/indra/cmake/DirectX.cmake
new file mode 100644
index 0000000..4d2d5e0
--- /dev/null
+++ b/linden/indra/cmake/DirectX.cmake
@@ -0,0 +1,40 @@
1# -*- cmake -*-
2
3if (VIEWER AND WINDOWS)
4 find_path(DIRECTX_INCLUDE_DIR dxdiag.h
5 "$ENV{DXSDK_DIR}/Include"
6 "C:/Program Files/Microsoft DirectX SDK (June 2008)/Include"
7 "C:/Program Files/Microsoft DirectX SDK (March 2008)/Include"
8 "C:/Program Files/Microsoft DirectX SDK (November 2007)/Include"
9 "C:/Program Files/Microsoft DirectX SDK (August 2007)/Include"
10 "C:/DX90SDK/Include"
11 "C:/Program Files/DX90SDK/Include"
12 )
13 if (DIRECTX_INCLUDE_DIR)
14 include_directories(${DIRECTX_INCLUDE_DIR})
15 if (DIRECTX_FIND_QUIETLY)
16 message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}")
17 endif (DIRECTX_FIND_QUIETLY)
18 else (DIRECTX_INCLUDE_DIR)
19 message(FATAL_ERROR "Could not find DirectX SDK Include")
20 endif (DIRECTX_INCLUDE_DIR)
21
22
23 find_path(DIRECTX_LIBRARY_DIR dxguid.lib
24 "$ENV{DXSDK_DIR}/Lib/x86"
25 "C:/Program Files/Microsoft DirectX SDK (June 2008)/Lib/x86"
26 "C:/Program Files/Microsoft DirectX SDK (March 2008)/Lib/x86"
27 "C:/Program Files/Microsoft DirectX SDK (November 2007)/Lib/x86"
28 "C:/Program Files/Microsoft DirectX SDK (August 2007)/Lib/x86"
29 "C:/DX90SDK/Lib"
30 "C:/Program Files/DX90SDK/Lib"
31 )
32 if (DIRECTX_LIBRARY_DIR)
33 if (DIRECTX_FIND_QUIETLY)
34 message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}")
35 endif (DIRECTX_FIND_QUIETLY)
36 else (DIRECTX_LIBRARY_DIR)
37 message(FATAL_ERROR "Could not find DirectX SDK Libraries")
38 endif (DIRECTX_LIBRARY_DIR)
39
40endif (VIEWER AND WINDOWS)
diff --git a/linden/indra/cmake/ELFIO.cmake b/linden/indra/cmake/ELFIO.cmake
new file mode 100644
index 0000000..e51993b
--- /dev/null
+++ b/linden/indra/cmake/ELFIO.cmake
@@ -0,0 +1,19 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(ELFIO_FIND_QUIETLY ON)
5
6if (STANDALONE)
7 include(FindELFIO)
8elseif (LINUX)
9 use_prebuilt_binary(elfio)
10 set(ELFIO_LIBRARIES ELFIO)
11 set(ELFIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
12 set(ELFIO_FOUND "YES")
13endif (STANDALONE)
14
15if (ELFIO_FOUND)
16 add_definitions(-DLL_ELFBIN=1)
17else (ELFIO_FOUND)
18 set(ELFIO_INCLUDE_DIR "")
19endif (ELFIO_FOUND)
diff --git a/linden/indra/cmake/EXPAT.cmake b/linden/indra/cmake/EXPAT.cmake
new file mode 100644
index 0000000..acb15dc
--- /dev/null
+++ b/linden/indra/cmake/EXPAT.cmake
@@ -0,0 +1,17 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(EXPAT_FIND_QUIETLY ON)
5set(EXPAT_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindEXPAT)
9else (STANDALONE)
10 use_prebuilt_binary(expat)
11 if (WINDOWS)
12 set(EXPAT_LIBRARIES libexpatMT)
13 else (WINDOWS)
14 set(EXPAT_LIBRARIES expat)
15 endif (WINDOWS)
16 set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
17endif (STANDALONE)
diff --git a/linden/indra/cmake/FMOD.cmake b/linden/indra/cmake/FMOD.cmake
new file mode 100644
index 0000000..759b8f1
--- /dev/null
+++ b/linden/indra/cmake/FMOD.cmake
@@ -0,0 +1,64 @@
1# -*- cmake -*-
2
3include(Linking)
4
5if(INSTALL_PROPRIETARY)
6 include(Prebuilt)
7 use_prebuilt_binary(fmod)
8endif(INSTALL_PROPRIETARY)
9
10find_library(FMOD_LIBRARY_RELEASE
11 NAMES fmod fmodvc fmod-3.75
12 PATHS
13 ${ARCH_PREBUILT_DIRS_RELEASE}
14 )
15
16find_library(FMOD_LIBRARY_DEBUG
17 NAMES fmod fmodvc fmod-3.75
18 PATHS
19 ${ARCH_PREBUILT_DIRS_DEBUG}
20 )
21
22if (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
23 set(FMOD_LIBRARY
24 debug ${FMOD_LIBRARY_DEBUG}
25 optimized ${FMOD_LIBRARY_RELEASE})
26elseif (FMOD_LIBRARY_RELEASE)
27 set(FMOD_LIBRARY ${FMOD_LIBRARY_RELEASE})
28endif (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
29
30if (NOT FMOD_LIBRARY)
31 set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
32 if (FMOD_SDK_DIR)
33 find_library(FMOD_LIBRARY
34 NAMES fmodvc fmod-3.75 fmod
35 PATHS
36 ${FMOD_SDK_DIR}/api/lib
37 ${FMOD_SDK_DIR}/api
38 ${FMOD_SDK_DIR}/lib
39 ${FMOD_SDK_DIR}
40 )
41 endif (FMOD_SDK_DIR)
42endif (NOT FMOD_LIBRARY)
43
44find_path(FMOD_INCLUDE_DIR fmod.h
45 ${LIBS_PREBUILT_DIR}/include
46 ${FMOD_SDK_DIR}/api/inc
47 ${FMOD_SDK_DIR}/inc
48 ${FMOD_SDK_DIR}
49 )
50
51if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
52 set(FMOD ON CACHE BOOL "Use closed source FMOD sound library.")
53else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
54 set(FMOD_LIBRARY "")
55 set(FMOD_INCLUDE_DIR "")
56 if (FMOD)
57 message(STATUS "No support for FMOD audio (need to set FMOD_SDK_DIR?)")
58 endif (FMOD)
59 set(FMOD OFF CACHE BOOL "Use closed source FMOD sound library.")
60endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
61
62if (FMOD)
63 message(STATUS "Building with FMOD audio support")
64endif (FMOD)
diff --git a/linden/indra/cmake/FindAPR.cmake b/linden/indra/cmake/FindAPR.cmake
new file mode 100644
index 0000000..906b6c9
--- /dev/null
+++ b/linden/indra/cmake/FindAPR.cmake
@@ -0,0 +1,94 @@
1# -*- cmake -*-
2
3# - Find Apache Portable Runtime
4# Find the APR includes and libraries
5# This module defines
6# APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc.
7# APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR.
8# APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR.
9# also defined, but not for general use are
10# APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library.
11
12# APR first.
13
14FIND_PATH(APR_INCLUDE_DIR apr.h
15/usr/local/include/apr-1
16/usr/local/include/apr-1.0
17/usr/include/apr-1
18/usr/include/apr-1.0
19)
20
21SET(APR_NAMES ${APR_NAMES} apr-1)
22FIND_LIBRARY(APR_LIBRARY
23 NAMES ${APR_NAMES}
24 PATHS /usr/lib /usr/local/lib
25 )
26
27IF (APR_LIBRARY AND APR_INCLUDE_DIR)
28 SET(APR_LIBRARIES ${APR_LIBRARY})
29 SET(APR_FOUND "YES")
30ELSE (APR_LIBRARY AND APR_INCLUDE_DIR)
31 SET(APR_FOUND "NO")
32ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR)
33
34
35IF (APR_FOUND)
36 IF (NOT APR_FIND_QUIETLY)
37 MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}")
38 ENDIF (NOT APR_FIND_QUIETLY)
39ELSE (APR_FOUND)
40 IF (APR_FIND_REQUIRED)
41 MESSAGE(FATAL_ERROR "Could not find APR library")
42 ENDIF (APR_FIND_REQUIRED)
43ENDIF (APR_FOUND)
44
45# Deprecated declarations.
46SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} )
47GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH)
48
49MARK_AS_ADVANCED(
50 APR_LIBRARY
51 APR_INCLUDE_DIR
52 )
53
54# Next, APRUTIL.
55
56FIND_PATH(APRUTIL_INCLUDE_DIR apu.h
57/usr/local/include/apr-1
58/usr/local/include/apr-1.0
59/usr/include/apr-1
60/usr/include/apr-1.0
61)
62
63SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1)
64FIND_LIBRARY(APRUTIL_LIBRARY
65 NAMES ${APRUTIL_NAMES}
66 PATHS /usr/lib /usr/local/lib
67 )
68
69IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
70 SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY})
71 SET(APRUTIL_FOUND "YES")
72ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
73 SET(APRUTIL_FOUND "NO")
74ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
75
76
77IF (APRUTIL_FOUND)
78 IF (NOT APRUTIL_FIND_QUIETLY)
79 MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}")
80 ENDIF (NOT APRUTIL_FIND_QUIETLY)
81ELSE (APRUTIL_FOUND)
82 IF (APRUTIL_FIND_REQUIRED)
83 MESSAGE(FATAL_ERROR "Could not find APRUTIL library")
84 ENDIF (APRUTIL_FIND_REQUIRED)
85ENDIF (APRUTIL_FOUND)
86
87# Deprecated declarations.
88SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} )
89GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH)
90
91MARK_AS_ADVANCED(
92 APRUTIL_LIBRARY
93 APRUTIL_INCLUDE_DIR
94 )
diff --git a/linden/indra/cmake/FindBerkeleyDB.cmake b/linden/indra/cmake/FindBerkeleyDB.cmake
new file mode 100644
index 0000000..2d633c7
--- /dev/null
+++ b/linden/indra/cmake/FindBerkeleyDB.cmake
@@ -0,0 +1,50 @@
1# -*- cmake -*-
2
3# - Find BerkeleyDB
4# Find the BerkeleyDB includes and library
5# This module defines
6# DB_INCLUDE_DIR, where to find db.h, etc.
7# DB_LIBRARIES, the libraries needed to use BerkeleyDB.
8# DB_FOUND, If false, do not try to use BerkeleyDB.
9# also defined, but not for general use are
10# DB_LIBRARY, where to find the BerkeleyDB library.
11
12FIND_PATH(DB_INCLUDE_DIR db.h
13/usr/local/include/db4
14/usr/local/include
15/usr/include/db4
16/usr/include
17)
18
19SET(DB_NAMES ${DB_NAMES} db)
20FIND_LIBRARY(DB_LIBRARY
21 NAMES ${DB_NAMES}
22 PATHS /usr/lib /usr/local/lib
23 )
24
25IF (DB_LIBRARY AND DB_INCLUDE_DIR)
26 SET(DB_LIBRARIES ${DB_LIBRARY})
27 SET(DB_FOUND "YES")
28ELSE (DB_LIBRARY AND DB_INCLUDE_DIR)
29 SET(DB_FOUND "NO")
30ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR)
31
32
33IF (DB_FOUND)
34 IF (NOT DB_FIND_QUIETLY)
35 MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}")
36 ENDIF (NOT DB_FIND_QUIETLY)
37ELSE (DB_FOUND)
38 IF (DB_FIND_REQUIRED)
39 MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library")
40 ENDIF (DB_FIND_REQUIRED)
41ENDIF (DB_FOUND)
42
43# Deprecated declarations.
44SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} )
45GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH)
46
47MARK_AS_ADVANCED(
48 DB_LIBRARY
49 DB_INCLUDE_DIR
50 )
diff --git a/linden/indra/cmake/FindCARes.cmake b/linden/indra/cmake/FindCARes.cmake
new file mode 100644
index 0000000..1ed5b32
--- /dev/null
+++ b/linden/indra/cmake/FindCARes.cmake
@@ -0,0 +1,48 @@
1# -*- cmake -*-
2
3# - Find c-ares
4# Find the c-ares includes and library
5# This module defines
6# CARES_INCLUDE_DIR, where to find ares.h, etc.
7# CARES_LIBRARIES, the libraries needed to use c-ares.
8# CARES_FOUND, If false, do not try to use c-ares.
9# also defined, but not for general use are
10# CARES_LIBRARY, where to find the c-ares library.
11
12FIND_PATH(CARES_INCLUDE_DIR ares.h
13/usr/local/include
14/usr/include
15)
16
17SET(CARES_NAMES ${CARES_NAMES} cares)
18FIND_LIBRARY(CARES_LIBRARY
19 NAMES ${CARES_NAMES}
20 PATHS /usr/lib /usr/local/lib
21 )
22
23IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
24 SET(CARES_LIBRARIES ${CARES_LIBRARY})
25 SET(CARES_FOUND "YES")
26ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
27 SET(CARES_FOUND "NO")
28ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
29
30
31IF (CARES_FOUND)
32 IF (NOT CARES_FIND_QUIETLY)
33 MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
34 ENDIF (NOT CARES_FIND_QUIETLY)
35ELSE (CARES_FOUND)
36 IF (CARES_FIND_REQUIRED)
37 MESSAGE(FATAL_ERROR "Could not find c-ares library")
38 ENDIF (CARES_FIND_REQUIRED)
39ENDIF (CARES_FOUND)
40
41# Deprecated declarations.
42SET (NATIVE_CARES_INCLUDE_PATH ${CARES_INCLUDE_DIR} )
43GET_FILENAME_COMPONENT (NATIVE_CARES_LIB_PATH ${CARES_LIBRARY} PATH)
44
45MARK_AS_ADVANCED(
46 CARES_LIBRARY
47 CARES_INCLUDE_DIR
48 )
diff --git a/linden/indra/cmake/FindELFIO.cmake b/linden/indra/cmake/FindELFIO.cmake
new file mode 100644
index 0000000..8a5421a
--- /dev/null
+++ b/linden/indra/cmake/FindELFIO.cmake
@@ -0,0 +1,48 @@
1# -*- cmake -*-
2
3# - Find ELFIO
4# Find the ELFIO includes and library
5# This module defines
6# ELFIO_INCLUDE_DIR, where to find elfio.h, etc.
7# ELFIO_LIBRARIES, the libraries needed to use ELFIO.
8# ELFIO_FOUND, If false, do not try to use ELFIO.
9# also defined, but not for general use are
10# ELFIO_LIBRARY, where to find the ELFIO library.
11
12FIND_PATH(ELFIO_INCLUDE_DIR ELFIO/ELFIO.h
13/usr/local/include
14/usr/include
15)
16
17SET(ELFIO_NAMES ${ELFIO_NAMES} ELFIO)
18FIND_LIBRARY(ELFIO_LIBRARY
19 NAMES ${ELFIO_NAMES}
20 PATHS /usr/lib /usr/local/lib
21 )
22
23IF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
24 SET(ELFIO_LIBRARIES ${ELFIO_LIBRARY})
25 SET(ELFIO_FOUND "YES")
26ELSE (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
27 SET(ELFIO_FOUND "NO")
28ENDIF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
29
30
31IF (ELFIO_FOUND)
32 IF (NOT ELFIO_FIND_QUIETLY)
33 MESSAGE(STATUS "Found ELFIO: ${ELFIO_LIBRARIES}")
34 ENDIF (NOT ELFIO_FIND_QUIETLY)
35ELSE (ELFIO_FOUND)
36 IF (ELFIO_FIND_REQUIRED)
37 MESSAGE(FATAL_ERROR "Could not find ELFIO library")
38 ENDIF (ELFIO_FIND_REQUIRED)
39ENDIF (ELFIO_FOUND)
40
41# Deprecated declarations.
42SET (NATIVE_ELFIO_INCLUDE_PATH ${ELFIO_INCLUDE_DIR} )
43GET_FILENAME_COMPONENT (NATIVE_ELFIO_LIB_PATH ${ELFIO_LIBRARY} PATH)
44
45MARK_AS_ADVANCED(
46 ELFIO_LIBRARY
47 ELFIO_INCLUDE_DIR
48 )
diff --git a/linden/indra/cmake/FindGooglePerfTools.cmake b/linden/indra/cmake/FindGooglePerfTools.cmake
new file mode 100644
index 0000000..bb125d5
--- /dev/null
+++ b/linden/indra/cmake/FindGooglePerfTools.cmake
@@ -0,0 +1,66 @@
1# -*- cmake -*-
2
3# - Find Google perftools
4# Find the Google perftools includes and libraries
5# This module defines
6# GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc.
7# GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools.
8# also defined for general use are
9# TCMALLOC_LIBRARIES, where to find the tcmalloc library.
10# STACKTRACE_LIBRARIES, where to find the stacktrace library.
11# PROFILER_LIBRARIES, where to find the profiler library.
12
13FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h
14/usr/local/include
15/usr/include
16)
17
18SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc)
19FIND_LIBRARY(TCMALLOC_LIBRARY
20 NAMES ${TCMALLOC_NAMES}
21 PATHS /usr/lib /usr/local/lib
22 )
23
24IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
25 SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY})
26 SET(GOOGLE_PERFTOOLS_FOUND "YES")
27ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
28 SET(GOOGLE_PERFTOOLS_FOUND "NO")
29ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
30
31SET(STACKTRACE_NAMES ${STACKTRACE_NAMES} stacktrace)
32FIND_LIBRARY(STACKTRACE_LIBRARY
33 NAMES ${STACKTRACE_LIBRARY}
34 PATHS /usr/lib /usr/local/lib
35 )
36
37IF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
38 SET(STACKTRACE_LIBRARIES ${STACKTRACE_LIBRARY})
39ENDIF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
40
41SET(PROFILER_NAMES ${PROFILER_NAMES} profiler)
42FIND_LIBRARY(PROFILER_LIBRARY
43 NAMES ${PROFILER_LIBRARY}
44 PATHS /usr/lib /usr/local/lib
45 )
46
47IF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
48 SET(PROFILER_LIBRARIES ${PROFILER_LIBRARY})
49ENDIF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
50
51IF (GOOGLE_PERFTOOLS_FOUND)
52 IF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
53 MESSAGE(STATUS "Found Google perftools: ${GOOGLE_PERFTOOLS_LIBRARIES}")
54 ENDIF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
55ELSE (GOOGLE_PERFTOOLS_FOUND)
56 IF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
57 MESSAGE(FATAL_ERROR "Could not find Google perftools library")
58 ENDIF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
59ENDIF (GOOGLE_PERFTOOLS_FOUND)
60
61MARK_AS_ADVANCED(
62 TCMALLOC_LIBRARY
63 STACKTRACE_LIBRARY
64 PROFILER_LIBRARY
65 GOOGLE_PERFTOOLS_INCLUDE_DIR
66 )
diff --git a/linden/indra/cmake/FindMono.cmake b/linden/indra/cmake/FindMono.cmake
new file mode 100644
index 0000000..f0a0705
--- /dev/null
+++ b/linden/indra/cmake/FindMono.cmake
@@ -0,0 +1,68 @@
1# - Try to find the mono, mcs, gmcs and gacutil
2#
3# defines
4#
5# MONO_FOUND - system has mono, mcs, gmcs and gacutil
6# MONO_PATH - where to find 'mono'
7# MCS_PATH - where to find 'mcs'
8# GMCS_PATH - where to find 'gmcs'
9# GACUTIL_PATH - where to find 'gacutil'
10#
11# copyright (c) 2007 Arno Rehn arno@arnorehn.de
12#
13# Redistribution and use is allowed according to the terms of the GPL license.
14# Removed the check for gmcs
15
16FIND_PROGRAM (MONO_EXECUTABLE mono
17 "C:/Program Files/Mono-1.9.1/bin"
18 "C:/Program Files/Mono-1.2.6/bin"
19 /bin
20 /usr/bin
21 /usr/local/bin
22)
23FIND_PROGRAM (MCS_EXECUTABLE mcs
24 "C:/Program Files/Mono-1.9.1/bin"
25 "C:/Program Files/Mono-1.2.6/bin"
26 /bin
27 /usr/bin
28 /usr/local/bin
29)
30FIND_PROGRAM (GMCS_EXECUTABLE gmcs
31 "C:/Program Files/Mono-1.9.1/bin"
32 "C:/Program Files/Mono-1.2.6/bin"
33 /bin
34 /usr/bin
35 /usr/local/bin
36)
37FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
38 "C:/Program Files/Mono-1.9.1/bin"
39 "C:/Program Files/Mono-1.2.6/bin"
40 /bin
41 /usr/bin
42 /usr/local/bin
43)
44FIND_PROGRAM (ILASM_EXECUTABLE
45 ilasm
46 NO_DEFAULT_PATH
47 PATHS "C:/Program Files/Mono-1.9.1/bin" "C:/Apps/Mono-1.2.6/bin" "C:/Program Files/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
48)
49
50SET (MONO_FOUND FALSE)
51
52IF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
53 SET (MONO_FOUND TRUE)
54ENDIF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
55
56IF (MONO_FOUND)
57 IF (NOT Mono_FIND_QUIETLY)
58 MESSAGE(STATUS "Found mono: ${MONO_EXECUTABLE}")
59 MESSAGE(STATUS "Found mcs: ${MCS_EXECUTABLE}")
60 MESSAGE(STATUS "Found gacutil: ${GACUTIL_EXECUTABLE}")
61 ENDIF (NOT Mono_FIND_QUIETLY)
62ELSE (MONO_FOUND)
63 IF (Mono_FIND_REQUIRED)
64 MESSAGE(FATAL_ERROR "Could not find one or more of the following programs: mono, mcs, gacutil")
65 ENDIF (Mono_FIND_REQUIRED)
66ENDIF (MONO_FOUND)
67
68MARK_AS_ADVANCED(MONO_EXECUTABLE MCS_EXECUTABLE GACUTIL_EXECUTABLE)
diff --git a/linden/indra/cmake/FindMySQL.cmake b/linden/indra/cmake/FindMySQL.cmake
new file mode 100644
index 0000000..4319403
--- /dev/null
+++ b/linden/indra/cmake/FindMySQL.cmake
@@ -0,0 +1,48 @@
1# -*- cmake -*-
2
3# - Find MySQL
4# Find the MySQL includes and library
5# This module defines
6# MYSQL_INCLUDE_DIR, where to find mysql.h, etc.
7# MYSQL_LIBRARIES, the libraries needed to use Mysql.
8# MYSQL_FOUND, If false, do not try to use Mysql.
9# also defined, but not for general use are
10# MYSQL_LIBRARY, where to find the Mysql library.
11
12FIND_PATH(MYSQL_INCLUDE_DIR mysql/mysql.h
13/usr/local/include
14/usr/include
15)
16
17SET(MYSQL_NAMES ${MYSQL_NAMES} mysqlclient)
18FIND_LIBRARY(MYSQL_LIBRARY
19 NAMES ${MYSQL_NAMES}
20 PATHS /usr/lib/mysql /usr/lib /usr/local/lib/mysql /usr/local/lib
21 )
22
23IF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
24 SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
25 SET(MYSQL_FOUND "YES")
26ELSE (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
27 SET(MYSQL_FOUND "NO")
28ENDIF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
29
30
31IF (MYSQL_FOUND)
32 IF (NOT MYSQL_FIND_QUIETLY)
33 MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARIES}")
34 ENDIF (NOT MYSQL_FIND_QUIETLY)
35ELSE (MYSQL_FOUND)
36 IF (MYSQL_FIND_REQUIRED)
37 MESSAGE(FATAL_ERROR "Could not find MySQL library")
38 ENDIF (MYSQL_FIND_REQUIRED)
39ENDIF (MYSQL_FOUND)
40
41# Deprecated declarations.
42SET (NATIVE_MYSQL_INCLUDE_PATH ${MYSQL_INCLUDE_DIR} )
43GET_FILENAME_COMPONENT (NATIVE_MYSQL_LIB_PATH ${MYSQL_LIBRARY} PATH)
44
45MARK_AS_ADVANCED(
46 MYSQL_LIBRARY
47 MYSQL_INCLUDE_DIR
48 )
diff --git a/linden/indra/cmake/FindOpenJPEG.cmake b/linden/indra/cmake/FindOpenJPEG.cmake
new file mode 100644
index 0000000..949384e
--- /dev/null
+++ b/linden/indra/cmake/FindOpenJPEG.cmake
@@ -0,0 +1,50 @@
1# -*- cmake -*-
2
3# - Find OpenJPEG
4# Find the OpenJPEG includes and library
5# This module defines
6# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
7# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
8# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
9# also defined, but not for general use are
10# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
11
12FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
13/usr/local/include/openjpeg
14/usr/local/include
15/usr/include/openjpeg
16/usr/include
17)
18
19SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
20FIND_LIBRARY(OPENJPEG_LIBRARY
21 NAMES ${OPENJPEG_NAMES}
22 PATHS /usr/lib /usr/local/lib
23 )
24
25IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
26 SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
27 SET(OPENJPEG_FOUND "YES")
28ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
29 SET(OPENJPEG_FOUND "NO")
30ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
31
32
33IF (OPENJPEG_FOUND)
34 IF (NOT OPENJPEG_FIND_QUIETLY)
35 MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
36 ENDIF (NOT OPENJPEG_FIND_QUIETLY)
37ELSE (OPENJPEG_FOUND)
38 IF (OPENJPEG_FIND_REQUIRED)
39 MESSAGE(FATAL_ERROR "Could not find OpenJPEG library")
40 ENDIF (OPENJPEG_FIND_REQUIRED)
41ENDIF (OPENJPEG_FOUND)
42
43# Deprecated declarations.
44SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} )
45GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH)
46
47MARK_AS_ADVANCED(
48 OPENJPEG_LIBRARY
49 OPENJPEG_INCLUDE_DIR
50 )
diff --git a/linden/indra/cmake/FindSCP.cmake b/linden/indra/cmake/FindSCP.cmake
new file mode 100644
index 0000000..ea02102
--- /dev/null
+++ b/linden/indra/cmake/FindSCP.cmake
@@ -0,0 +1,40 @@
1# -*- cmake -*-
2#
3# Find the OpenSSH scp ("secure copy") or Putty pscp command.
4#
5# Input variables:
6# SCP_FIND_REQUIRED - set this if configuration should fail without scp
7#
8# Output variables:
9#
10# SCP_FOUND - set if scp was found
11# SCP_EXECUTABLE - path to scp or pscp executable
12# SCP_BATCH_FLAG - how to put scp/pscp into batch mode
13
14SET(SCP_EXECUTABLE)
15IF (WINDOWS)
16 FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe)
17ELSE (WINDOWS)
18 FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe)
19ENDIF (WINDOWS)
20
21IF (SCP_EXECUTABLE)
22 SET(SCP_FOUND ON)
23ELSE (SCP_EXECUTABLE)
24 SET(SCP_FOUND OFF)
25ENDIF (SCP_EXECUTABLE)
26
27IF (SCP_FOUND)
28 GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE)
29 IF (_scp_name STREQUAL scp)
30 SET(SCP_BATCH_FLAG -B)
31 ELSE (_scp_name STREQUAL scp)
32 SET(SCP_BATCH_FLAG -batch)
33 ENDIF (_scp_name STREQUAL scp)
34ELSE (SCP_FOUND)
35 IF (SCP_FIND_REQUIRED)
36 MESSAGE(FATAL_ERROR "Could not find scp or pscp executable")
37 ENDIF (SCP_FIND_REQUIRED)
38ENDIF (SCP_FOUND)
39
40MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG)
diff --git a/linden/indra/cmake/FindXmlRpcEpi.cmake b/linden/indra/cmake/FindXmlRpcEpi.cmake
new file mode 100644
index 0000000..ba217e7
--- /dev/null
+++ b/linden/indra/cmake/FindXmlRpcEpi.cmake
@@ -0,0 +1,48 @@
1# -*- cmake -*-
2
3# - Find XMLRPC-EPI
4# Find the XMLRPC-EPI includes and library
5# This module defines
6# XMLRPCEPI_INCLUDE_DIR, where to find jpeglib.h, etc.
7# XMLRPCEPI_LIBRARIES, the libraries needed to use XMLRPC-EPI.
8# XMLRPCEPI_FOUND, If false, do not try to use XMLRPC-EPI.
9# also defined, but not for general use are
10# XMLRPCEPI_LIBRARY, where to find the XMLRPC-EPI library.
11
12FIND_PATH(XMLRPCEPI_INCLUDE_DIR xmlrpc-epi/xmlrpc.h
13/usr/local/include
14/usr/include
15)
16
17SET(XMLRPCEPI_NAMES ${XMLRPCEPI_NAMES} xmlrpc-epi)
18FIND_LIBRARY(XMLRPCEPI_LIBRARY
19 NAMES ${XMLRPCEPI_NAMES}
20 PATHS /usr/lib /usr/local/lib
21 )
22
23IF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)
24 SET(XMLRPCEPI_LIBRARIES ${XMLRPCEPI_LIBRARY})
25 SET(XMLRPCEPI_FOUND "YES")
26ELSE (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)
27 SET(XMLRPCEPI_FOUND "NO")
28ENDIF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)
29
30
31IF (XMLRPCEPI_FOUND)
32 IF (NOT XMLRPCEPI_FIND_QUIETLY)
33 MESSAGE(STATUS "Found XMLRPC-EPI: ${XMLRPCEPI_LIBRARIES}")
34 ENDIF (NOT XMLRPCEPI_FIND_QUIETLY)
35ELSE (XMLRPCEPI_FOUND)
36 IF (XMLRPCEPI_FIND_REQUIRED)
37 MESSAGE(FATAL_ERROR "Could not find XMLRPC-EPI library")
38 ENDIF (XMLRPCEPI_FIND_REQUIRED)
39ENDIF (XMLRPCEPI_FOUND)
40
41# Deprecated declarations.
42SET (NATIVE_XMLRPCEPI_INCLUDE_PATH ${XMLRPCEPI_INCLUDE_DIR} )
43GET_FILENAME_COMPONENT (NATIVE_XMLRPCEPI_LIB_PATH ${XMLRPCEPI_LIBRARY} PATH)
44
45MARK_AS_ADVANCED(
46 XMLRPCEPI_LIBRARY
47 XMLRPCEPI_INCLUDE_DIR
48 )
diff --git a/linden/indra/cmake/FreeType.cmake b/linden/indra/cmake/FreeType.cmake
new file mode 100644
index 0000000..5f1aa26
--- /dev/null
+++ b/linden/indra/cmake/FreeType.cmake
@@ -0,0 +1,20 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (STANDALONE)
5 include(FindPkgConfig)
6
7 pkg_check_modules(FREETYPE REQUIRED freetype2)
8else (STANDALONE)
9 use_prebuilt_binary(freetype)
10 if (LINUX)
11 set(FREETYPE_INCLUDE_DIRS
12 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
13 else (LINUX)
14 set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
15 endif (LINUX)
16
17 set(FREETYPE_LIBRARIES freetype)
18endif (STANDALONE)
19
20link_directories(${FREETYPE_LIBRARY_DIRS})
diff --git a/linden/indra/cmake/GStreamer.cmake b/linden/indra/cmake/GStreamer.cmake
new file mode 100644
index 0000000..10d5207
--- /dev/null
+++ b/linden/indra/cmake/GStreamer.cmake
@@ -0,0 +1,38 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (STANDALONE)
5 include(FindPkgConfig)
6
7 pkg_check_modules(GSTREAMER REQUIRED gstreamer-0.10)
8 pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
9elseif (LINUX)
10 use_prebuilt_binary(gstreamer)
11 # possible libxml should have its own .cmake file instead
12 use_prebuilt_binary(libxml)
13 set(GSTREAMER_FOUND ON FORCE BOOL)
14 set(GSTREAMER_PLUGINS_BASE_FOUND ON FORCE BOOL)
15 set(GSTREAMER_INCLUDE_DIRS
16 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/gstreamer-0.10
17 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0
18 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libxml2
19 )
20 # We don't need to explicitly link against gstreamer itself, because
21 # LLMediaImplGStreamer probes for the system's copy at runtime.
22 set(GSTREAMER_LIBRARIES
23 gobject-2.0
24 gmodule-2.0
25 dl
26 gthread-2.0
27 rt
28 glib-2.0
29 )
30endif (STANDALONE)
31
32if (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND)
33 set(GSTREAMER ON CACHE BOOL "Build with GStreamer streaming media support.")
34endif (GSTREAMER_FOUND AND GSTREAMER_PLUGINS_BASE_FOUND)
35
36if (GSTREAMER)
37 add_definitions(-DLL_GSTREAMER_ENABLED=1)
38endif (GSTREAMER)
diff --git a/linden/indra/cmake/GooglePerfTools.cmake b/linden/indra/cmake/GooglePerfTools.cmake
new file mode 100644
index 0000000..9b3eca0
--- /dev/null
+++ b/linden/indra/cmake/GooglePerfTools.cmake
@@ -0,0 +1,28 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (STANDALONE)
5 include(FindGooglePerfTools)
6else (STANDALONE)
7 use_prebuilt_binary(google)
8 if (LINUX)
9 set(TCMALLOC_LIBRARIES tcmalloc)
10 set(STACKTRACE_LIBRARIES stacktrace)
11 set(PROFILER_LIBRARIES profiler)
12 set(GOOGLE_PERFTOOLS_INCLUDE_DIR
13 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
14 set(GOOGLE_PERFTOOLS_FOUND "YES")
15 endif (LINUX)
16endif (STANDALONE)
17
18if (GOOGLE_PERFTOOLS_FOUND)
19 set(USE_GOOGLE_PERFTOOLS ON CACHE BOOL "Build with Google PerfTools support.")
20endif (GOOGLE_PERFTOOLS_FOUND)
21
22if (USE_GOOGLE_PERFTOOLS)
23 set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
24 include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
25 set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES})
26else (USE_GOOGLE_PERFTOOLS)
27 set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
28endif (USE_GOOGLE_PERFTOOLS)
diff --git a/linden/indra/cmake/JPEG.cmake b/linden/indra/cmake/JPEG.cmake
new file mode 100644
index 0000000..5d0ee0d
--- /dev/null
+++ b/linden/indra/cmake/JPEG.cmake
@@ -0,0 +1,23 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4include(Linking)
5set(JPEG_FIND_QUIETLY ON)
6set(JPEG_FIND_REQUIRED ON)
7
8if (STANDALONE)
9 include(FindJPEG)
10else (STANDALONE)
11 use_prebuilt_binary(jpeglib)
12 if (LINUX)
13 set(JPEG_LIBRARIES jpeg)
14 elseif (DARWIN)
15 set(JPEG_LIBRARIES
16 optimized ${ARCH_PREBUILT_DIRS_RELEASE}/liblljpeg.a
17 debug ${ARCH_PREBUILT_DIRS_DEBUG}/liblljpeg.a
18 )
19 elseif (WINDOWS)
20 set(JPEG_LIBRARIES jpeglib_6b)
21 endif (LINUX)
22 set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
23endif (STANDALONE)
diff --git a/linden/indra/cmake/LLAudio.cmake b/linden/indra/cmake/LLAudio.cmake
new file mode 100644
index 0000000..7b9f254
--- /dev/null
+++ b/linden/indra/cmake/LLAudio.cmake
@@ -0,0 +1,15 @@
1# -*- cmake -*-
2
3include(Audio)
4
5set(LLAUDIO_INCLUDE_DIRS
6 ${LIBS_OPEN_DIR}/llaudio
7 )
8
9set(LLAUDIO_LIBRARIES
10 llaudio
11 ${VORBISENC_LIBRARIES}
12 ${VORBISFILE_LIBRARIES}
13 ${VORBIS_LIBRARIES}
14 ${OGG_LIBRARIES}
15 )
diff --git a/linden/indra/cmake/LLCharacter.cmake b/linden/indra/cmake/LLCharacter.cmake
new file mode 100644
index 0000000..c74092c
--- /dev/null
+++ b/linden/indra/cmake/LLCharacter.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLCHARACTER_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llcharacter
5 )
6
7set(LLCHARACTER_LIBRARIES
8 llcharacter
9 )
diff --git a/linden/indra/cmake/LLCommon.cmake b/linden/indra/cmake/LLCommon.cmake
new file mode 100644
index 0000000..f4b251e
--- /dev/null
+++ b/linden/indra/cmake/LLCommon.cmake
@@ -0,0 +1,21 @@
1# -*- cmake -*-
2
3include(APR)
4include(Boost)
5include(EXPAT)
6include(ZLIB)
7
8set(LLCOMMON_INCLUDE_DIRS
9 ${LIBS_OPEN_DIR}/llcommon
10 ${APRUTIL_INCLUDE_DIR}
11 ${APR_INCLUDE_DIR}
12 ${Boost_INCLUDE_DIRS}
13 )
14
15set(LLCOMMON_LIBRARIES
16 llcommon
17 ${APRUTIL_LIBRARIES}
18 ${APR_LIBRARIES}
19 ${EXPAT_LIBRARIES}
20 ${ZLIB_LIBRARIES}
21 )
diff --git a/linden/indra/cmake/LLCrashLogger.cmake b/linden/indra/cmake/LLCrashLogger.cmake
new file mode 100644
index 0000000..7b362d0
--- /dev/null
+++ b/linden/indra/cmake/LLCrashLogger.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLCRASHLOGGER_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llcrashlogger
5 )
6
7set(LLCRASHLOGGER_LIBRARIES
8 llcrashlogger
9 )
diff --git a/linden/indra/cmake/LLDatabase.cmake b/linden/indra/cmake/LLDatabase.cmake
new file mode 100644
index 0000000..c3cf622
--- /dev/null
+++ b/linden/indra/cmake/LLDatabase.cmake
@@ -0,0 +1,13 @@
1# -*- cmake -*-
2
3include(MySQL)
4
5set(LLDATABASE_INCLUDE_DIRS
6 ${LIBS_SERVER_DIR}/lldatabase
7 ${MYSQL_INCLUDE_DIR}
8 )
9
10set(LLDATABASE_LIBRARIES
11 lldatabase
12 ${MYSQL_LIBRARIES}
13 )
diff --git a/linden/indra/cmake/LLImage.cmake b/linden/indra/cmake/LLImage.cmake
new file mode 100644
index 0000000..8874fa5
--- /dev/null
+++ b/linden/indra/cmake/LLImage.cmake
@@ -0,0 +1,15 @@
1# -*- cmake -*-
2
3include(JPEG)
4include(PNG)
5
6set(LLIMAGE_INCLUDE_DIRS
7 ${LIBS_OPEN_DIR}/llimage
8 ${JPEG_INCLUDE_DIRS}
9 )
10
11set(LLIMAGE_LIBRARIES
12 llimage
13 ${JPEG_LIBRARIES}
14 ${PNG_LIBRARIES}
15 )
diff --git a/linden/indra/cmake/LLImageJ2COJ.cmake b/linden/indra/cmake/LLImageJ2COJ.cmake
new file mode 100644
index 0000000..91973e0
--- /dev/null
+++ b/linden/indra/cmake/LLImageJ2COJ.cmake
@@ -0,0 +1,8 @@
1# -*- cmake -*-
2
3include(OpenJPEG)
4
5set(LLIMAGEJ2COJ_LIBRARIES
6 llimagej2coj
7 ${OPENJPEG_LIBRARIES}
8 )
diff --git a/linden/indra/cmake/LLInventory.cmake b/linden/indra/cmake/LLInventory.cmake
new file mode 100644
index 0000000..7d5f492
--- /dev/null
+++ b/linden/indra/cmake/LLInventory.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLINVENTORY_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llinventory
5 )
6
7set(LLINVENTORY_LIBRARIES
8 llinventory
9 )
diff --git a/linden/indra/cmake/LLKDU.cmake b/linden/indra/cmake/LLKDU.cmake
new file mode 100644
index 0000000..a02b5d9
--- /dev/null
+++ b/linden/indra/cmake/LLKDU.cmake
@@ -0,0 +1,20 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
5 use_prebuilt_binary(kdu)
6 if (WINDOWS)
7 set(KDU_LIBRARY debug kdu_cored optimized kdu_core)
8 elseif (LINUX)
9 set(KDU_LIBRARY kdu_v42R)
10 else (WINDOWS)
11 set(KDU_LIBRARY kdu)
12 endif (WINDOWS)
13
14 set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
15
16 set(LLKDU_LIBRARY llkdu)
17 set(LLKDU_STATIC_LIBRARY llkdu_static)
18 set(LLKDU_LIBRARIES ${LLKDU_LIBRARY})
19 set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY})
20endif (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
diff --git a/linden/indra/cmake/LLMath.cmake b/linden/indra/cmake/LLMath.cmake
new file mode 100644
index 0000000..8afd45e
--- /dev/null
+++ b/linden/indra/cmake/LLMath.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLMATH_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llmath
5 )
6
7set(LLMATH_LIBRARIES
8 llmath
9 )
diff --git a/linden/indra/cmake/LLMedia.cmake b/linden/indra/cmake/LLMedia.cmake
new file mode 100644
index 0000000..b7bf11c
--- /dev/null
+++ b/linden/indra/cmake/LLMedia.cmake
@@ -0,0 +1,15 @@
1# -*- cmake -*-
2
3include(GStreamer)
4include(QuickTime)
5
6set(LLMEDIA_INCLUDE_DIRS
7 ${LIBS_OPEN_DIR}/llmedia
8 )
9
10set(LLMEDIA_LIBRARIES
11 llmedia
12 ${GSTREAMER_LIBRARIES}
13 ${GSTREAMER_PLUGINS_BASE_LIBRARIES}
14 ${QUICKTIME_LIBRARY}
15 )
diff --git a/linden/indra/cmake/LLMessage.cmake b/linden/indra/cmake/LLMessage.cmake
new file mode 100644
index 0000000..1cea03a
--- /dev/null
+++ b/linden/indra/cmake/LLMessage.cmake
@@ -0,0 +1,22 @@
1# -*- cmake -*-
2
3include(CARes)
4include(CURL)
5include(OpenSSL)
6include(XmlRpcEpi)
7
8set(LLMESSAGE_INCLUDE_DIRS
9 ${LIBS_OPEN_DIR}/llmessage
10 ${CARES_INCLUDE_DIRS}
11 ${CURL_INCLUDE_DIRS}
12 ${OPENSSL_INCLUDE_DIRS}
13 )
14
15set(LLMESSAGE_LIBRARIES
16 llmessage
17 ${CURL_LIBRARIES}
18 ${CARES_LIBRARIES}
19 ${OPENSSL_LIBRARIES}
20 ${CRYPTO_LIBRARIES}
21 ${XMLRPCEPI_LIBRARIES}
22 )
diff --git a/linden/indra/cmake/LLPhysics.cmake b/linden/indra/cmake/LLPhysics.cmake
new file mode 100644
index 0000000..3ae390e
--- /dev/null
+++ b/linden/indra/cmake/LLPhysics.cmake
@@ -0,0 +1,76 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4use_prebuilt_binary(havok)
5
6set(HAVOK_VERSION 460)
7
8set(LLPHYSICS_INCLUDE_DIRS
9 ${LIBS_SERVER_DIR}/llphysics
10 ${LIBS_PREBUILT_DIR}/include/havok/hk${HAVOK_VERSION}/common
11 ${LIBS_PREBUILT_DIR}/include/havok/hk${HAVOK_VERSION}/physics
12 )
13
14add_definitions(-DLL_CURRENT_HAVOK_VERSION=${HAVOK_VERSION})
15
16if (LINUX OR DARWIN)
17 if (DARWIN)
18 link_directories(
19 ${LIBS_PREBUILT_DIR}/universal-darwin/lib_release/havok/hk460
20 )
21 else (DARWIN)
22 link_directories(
23 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release/havok/hk460
24 )
25 endif (DARWIN)
26
27 set(LLPHYSICS_LIBRARIES
28 llphysics
29 hkcompat
30 hkutilities
31 hkvisualize
32 hkdynamics
33 hkvehicle
34 hkcollide
35 hkinternal
36 hkconstraintsolver
37 hkmath
38 hkscenedata
39 hkserialize
40 hkgraphicsogl
41 hkgraphicsbridge
42 hkgraphics
43 hkdemoframework
44 hkbase
45 )
46elseif (WINDOWS)
47 if (MSVC71)
48 set(HK_DEBUG ${WINLIBS_PREBUILT_DEBUG_DIR}/havok/hk460)
49 set(HK_RELEASE ${WINLIBS_PREBUILT_RELEASE_DIR}/havok/hk460)
50 else (MSVC71)
51 set(HK_DEBUG ${WINLIBS_PREBUILT_DEBUG_DIR}/havok/hk460_net_8-0)
52 set(HK_RELEASE ${WINLIBS_PREBUILT_RELEASE_DIR}/havok/hk460_net_8-0)
53 endif (MSVC71)
54
55 set(HAVOK_LIBS
56 hkbase
57 hkdynamics
58 hkmath
59 hkcollide
60 hkutilities
61 hkvisualize
62 hkinternal
63 hkconstraintsolver
64 hkcompat
65 hkserialize
66 hkvehicle
67 hkscenedata
68 )
69
70 set(LLPHYSICS_LIBRARIES llphysics)
71
72 foreach(lib ${HAVOK_LIBS})
73 list(APPEND LLPHYSICS_LIBRARIES
74 debug ${HK_DEBUG}/${lib} optimized ${HK_RELEASE}/${lib})
75 endforeach(lib)
76endif (LINUX OR DARWIN)
diff --git a/linden/indra/cmake/LLPrimitive.cmake b/linden/indra/cmake/LLPrimitive.cmake
new file mode 100644
index 0000000..0426ae5
--- /dev/null
+++ b/linden/indra/cmake/LLPrimitive.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLPRIMITIVE_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llprimitive
5 )
6
7set(LLPRIMITIVE_LIBRARIES
8 llprimitive
9 )
diff --git a/linden/indra/cmake/LLRender.cmake b/linden/indra/cmake/LLRender.cmake
new file mode 100644
index 0000000..bbcf4cd
--- /dev/null
+++ b/linden/indra/cmake/LLRender.cmake
@@ -0,0 +1,32 @@
1# -*- cmake -*-
2
3include(FreeType)
4
5set(LLRENDER_INCLUDE_DIRS
6 ${LIBS_OPEN_DIR}/llrender
7 )
8
9if (SERVER AND LINUX)
10 set(LLRENDER_LIBRARIES
11 llrenderheadless
12 )
13else (SERVER AND LINUX)
14set(LLRENDER_LIBRARIES
15 llrender
16 )
17endif (SERVER AND LINUX)
18
19# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set
20# differently for different object files.
21macro (copy_server_sources _copied_SOURCES)
22 foreach (PREFIX ${_copied_SOURCES})
23 add_custom_command(
24 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
25 COMMAND ${CMAKE_COMMAND}
26 ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
27 ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp
28 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp
29 )
30 list(APPEND server_SOURCE_FILES ${PREFIX}_server.cpp)
31 endforeach (PREFIX ${_copied_SOURCES})
32endmacro (copy_server_sources _copied_SOURCES)
diff --git a/linden/indra/cmake/LLScene.cmake b/linden/indra/cmake/LLScene.cmake
new file mode 100644
index 0000000..d1c32b3
--- /dev/null
+++ b/linden/indra/cmake/LLScene.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLSCENE_INCLUDE_DIRS
4 ${LIBS_SERVER_DIR}/llscene
5 )
6
7set(LLSCENE_LIBRARIES
8 llscene
9 )
diff --git a/linden/indra/cmake/LLUI.cmake b/linden/indra/cmake/LLUI.cmake
new file mode 100644
index 0000000..d1287de
--- /dev/null
+++ b/linden/indra/cmake/LLUI.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2
3set(LLUI_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llui
5 )
6
7set(LLUI_LIBRARIES
8 llui
9 )
diff --git a/linden/indra/cmake/LLVFS.cmake b/linden/indra/cmake/LLVFS.cmake
new file mode 100644
index 0000000..5ce3d25
--- /dev/null
+++ b/linden/indra/cmake/LLVFS.cmake
@@ -0,0 +1,13 @@
1# -*- cmake -*-
2
3set(LLVFS_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/llvfs
5 )
6
7set(LLVFS_LIBRARIES llvfs)
8
9if (DARWIN)
10 include(CMakeFindFrameworks)
11 find_library(CARBON_LIBRARY Carbon)
12 list(APPEND LLVFS_LIBRARIES ${CARBON_LIBRARY})
13endif (DARWIN)
diff --git a/linden/indra/cmake/LLWindow.cmake b/linden/indra/cmake/LLWindow.cmake
new file mode 100644
index 0000000..c0efa27
--- /dev/null
+++ b/linden/indra/cmake/LLWindow.cmake
@@ -0,0 +1,43 @@
1# -*- cmake -*-
2
3include(OpenGL)
4include(Prebuilt)
5
6if (STANDALONE)
7 include(FindSDL)
8
9 # This should be done by FindSDL. Sigh.
10 mark_as_advanced(
11 SDLMAIN_LIBRARY
12 SDL_INCLUDE_DIR
13 SDL_LIBRARY
14 )
15else (STANDALONE)
16 use_prebuilt_binary(SDL)
17 use_prebuilt_binary(mesa)
18 if (LINUX AND VIEWER)
19 set (SDL_FOUND TRUE)
20 set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
21 set (SDL_LIBRARY SDL)
22 endif (LINUX AND VIEWER)
23endif (STANDALONE)
24
25if (SDL_FOUND)
26 add_definitions(-DLL_SDL=1)
27 include_directories(${SDL_INCLUDE_DIR})
28endif (SDL_FOUND)
29
30set(LLWINDOW_INCLUDE_DIRS
31 ${GLEXT_INCLUDE_DIR}
32 ${LIBS_OPEN_DIR}/llwindow
33 )
34
35if (SERVER AND LINUX)
36 set(LLWINDOW_LIBRARIES
37 llwindowheadless
38 )
39else (SERVER AND LINUX)
40 set(LLWINDOW_LIBRARIES
41 llwindow
42 )
43endif (SERVER AND LINUX)
diff --git a/linden/indra/cmake/LLXML.cmake b/linden/indra/cmake/LLXML.cmake
new file mode 100644
index 0000000..1ce93c0
--- /dev/null
+++ b/linden/indra/cmake/LLXML.cmake
@@ -0,0 +1,13 @@
1# -*- cmake -*-
2
3include(EXPAT)
4
5set(LLXML_INCLUDE_DIRS
6 ${LIBS_OPEN_DIR}/llxml
7 ${EXPAT_INCLUDE_DIRS}
8 )
9
10set(LLXML_LIBRARIES
11 llxml
12 ${EXPAT_LIBRARIES}
13 )
diff --git a/linden/indra/cmake/LScript.cmake b/linden/indra/cmake/LScript.cmake
new file mode 100644
index 0000000..86bfcb7
--- /dev/null
+++ b/linden/indra/cmake/LScript.cmake
@@ -0,0 +1,16 @@
1# -*- cmake -*-
2
3set(LSCRIPT_INCLUDE_DIRS
4 ${LIBS_OPEN_DIR}/lscript
5 ${LIBS_OPEN_DIR}/lscript/lscript_compile
6 ${LIBS_OPEN_DIR}/lscript/lscript_execute
7 ${LIBS_OPEN_DIR}/lscript/lscript_execute_mono
8 )
9
10set(LSCRIPT_LIBRARIES
11 lscript_compile
12 lscript_execute
13 lscript_library
14 )
15
16set(LSCRIPT_EXECUTE_MONO_LIBRARIES lscript_execute_mono) \ No newline at end of file
diff --git a/linden/indra/cmake/Linking.cmake b/linden/indra/cmake/Linking.cmake
new file mode 100644
index 0000000..c9748e3
--- /dev/null
+++ b/linden/indra/cmake/Linking.cmake
@@ -0,0 +1,45 @@
1# -*- cmake -*-
2
3if (NOT STANDALONE)
4 if (WINDOWS)
5 set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
6 set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
7 set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
8 elseif (LINUX)
9 if (VIEWER)
10 set(ARCH_PREBUILT_DIRS
11 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
12 set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
13 set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
14 else (VIEWER)
15 set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
16 endif (VIEWER)
17 elseif (DARWIN)
18 set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
19 set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE})
20 endif (WINDOWS)
21endif (NOT STANDALONE)
22
23link_directories(${ARCH_PREBUILT_DIRS})
24
25if (LINUX)
26 set(DL_LIBRARY dl)
27 set(PTHREAD_LIBRARY pthread)
28else (LINUX)
29 set(DL_LIBRARY "")
30 set(PTHREAD_LIBRARY "")
31endif (LINUX)
32
33if (WINDOWS)
34 set(WINDOWS_LIBRARIES
35 ws2_32
36 mswsock
37 psapi
38 winmm
39 netapi32
40 )
41else (WINDOWS)
42 set(WINDOWS_LIBRARIES "")
43endif (WINDOWS)
44
45mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
diff --git a/linden/indra/cmake/MonoDeps.cmake b/linden/indra/cmake/MonoDeps.cmake
new file mode 100644
index 0000000..52d5491
--- /dev/null
+++ b/linden/indra/cmake/MonoDeps.cmake
@@ -0,0 +1,48 @@
1# -*- cmake -*-
2
3set(MONO_PREBUILT_LIBRARIES_DIR ${LIBS_PREBUILT_DIR}/mono/1.0)
4
5set(MONO_PREBUILT_LIBRARIES
6 Iesi.Collections.dll
7 Iesi.Collections.pdb
8 Mono.CompilerServices.SymbolWriter.dll
9 Mono.PEToolkit.dll
10 Mono.PEToolkit.pdb
11 Mono.Security.dll
12 PEAPI.dll
13 RAIL.dll
14 RAIL.pdb
15 )
16
17 set(MONO_CORE_LIBRARIES
18 System.dll
19 System.Xml.dll
20 mscorlib.dll)
21
22if(WINDOWS)
23 set(MONO_DEPENDENCIES
24 DomainCreator
25 DomainRegister
26 LslLibrary
27 LslUserScript
28 Script
29 ScriptTypes
30 TestFormat
31 UserScript
32 UThread
33 UThreadInjector
34 )
35else(WINDOWS)
36 set(MONO_DEPENDENCIES
37 DomainCreator_POST_BUILD
38 DomainRegister_POST_BUILD
39 LslLibrary_POST_BUILD
40 LslUserScript_POST_BUILD
41 Script_POST_BUILD
42 ScriptTypes_POST_BUILD
43 TestFormat_POST_BUILD
44 UserScript_POST_BUILD
45 UThread_POST_BUILD
46 UThreadInjector_POST_BUILD
47 )
48endif(WINDOWS)
diff --git a/linden/indra/cmake/MonoEmbed.cmake b/linden/indra/cmake/MonoEmbed.cmake
new file mode 100644
index 0000000..0f1f233
--- /dev/null
+++ b/linden/indra/cmake/MonoEmbed.cmake
@@ -0,0 +1,57 @@
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}/${LL_ARCH_DIR}/include)
41 SET(GLIB_2_0_PLATFORM_INCLUDE_DIR
42 ${LIBS_PREBUILT_DIR}/${LL_ARCH_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)
diff --git a/linden/indra/cmake/Mozlib.cmake b/linden/indra/cmake/Mozlib.cmake
new file mode 100644
index 0000000..e9555df
--- /dev/null
+++ b/linden/indra/cmake/Mozlib.cmake
@@ -0,0 +1,47 @@
1# -*- cmake -*-
2include(Linking)
3include(Prebuilt)
4
5if (STANDALONE)
6 set(MOZLIB OFF CACHE BOOL
7 "Enable Mozilla support in the viewer (requires llmozlib library).")
8else (STANDALONE)
9 use_prebuilt_binary(llmozlib)
10 set(MOZLIB ON CACHE BOOL
11 "Enable Mozilla support in the viewer (requires llmozlib library).")
12endif (STANDALONE)
13
14if (MOZLIB)
15 add_definitions(-DLL_LLMOZLIB_ENABLED=1)
16
17 if (LINUX)
18 link_directories(${CMAKE_SOURCE_DIR}/newview/app_settings/mozilla-runtime-linux-${ARCH})
19 set(MOZLIB_LIBRARIES
20 llmozlib2
21 mozjs
22 nspr4
23 plc4
24 plds4
25 xpcom
26 xul
27 profdirserviceprovider_s
28 )
29 elseif (WINDOWS)
30 if (MSVC71)
31 set(MOZLIB_LIBRARIES
32 debug llmozlib2d
33 optimized llmozlib2)
34 elseif (MSVC80 OR MSVC90)
35 set(MOZLIB_LIBRARIES
36 debug llmozlib2d-vc80
37 optimized llmozlib2-vc80)
38 endif (MSVC71)
39 else (LINUX)
40 set(MOZLIB_LIBRARIES
41 optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libllmozlib2.dylib
42 debug ${ARCH_PREBUILT_DIRS_DEBUG}/libllmozlib2.dylib
43 )
44 endif (LINUX)
45else (MOZLIB)
46 add_definitions(-DLL_LLMOZLIB_ENABLED=0)
47endif (MOZLIB)
diff --git a/linden/indra/cmake/MySQL.cmake b/linden/indra/cmake/MySQL.cmake
new file mode 100644
index 0000000..97dd091
--- /dev/null
+++ b/linden/indra/cmake/MySQL.cmake
@@ -0,0 +1,23 @@
1# -*- cmake -*-
2include(Linking)
3include(Prebuilt)
4# We don't prebuild our own MySQL client library.
5
6use_prebuilt_binary(mysql)
7
8set(MYSQL_FIND_QUIETLY ON)
9set(MYSQL_FIND_REQUIRED ON)
10
11if (WINDOWS)
12 set(MYSQL_LIBRARIES mysqlclient)
13 set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
14elseif (DARWIN)
15 set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
16 set(MYSQL_LIBRARIES
17 optimized ${LIBS_PREBUILT_DIRS_RELEASE}/libmysqlclient.a
18 debug ${LIBS_PREBUILT_DIRS_DEBUG}/libmysqlclient.a
19 )
20else (WINDOWS)
21 set(MYSQL_FIND_REQUIRED)
22 include(FindMySQL)
23endif (WINDOWS)
diff --git a/linden/indra/cmake/NDOF.cmake b/linden/indra/cmake/NDOF.cmake
new file mode 100644
index 0000000..3f715a2
--- /dev/null
+++ b/linden/indra/cmake/NDOF.cmake
@@ -0,0 +1,14 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4use_prebuilt_binary(ndofdev)
5
6if (WINDOWS OR DARWIN)
7 add_definitions(-DLIB_NDOF=1)
8endif (WINDOWS OR DARWIN)
9
10if (WINDOWS)
11 set(NDOF_LIBRARY libndofdev)
12elseif (DARWIN)
13 set(NDOF_LIBRARY ndofdev)
14endif (WINDOWS)
diff --git a/linden/indra/cmake/OpenGL.cmake b/linden/indra/cmake/OpenGL.cmake
new file mode 100644
index 0000000..6a2b681
--- /dev/null
+++ b/linden/indra/cmake/OpenGL.cmake
@@ -0,0 +1,9 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (NOT STANDALONE)
5 use_prebuilt_binary(GL)
6 # possible glh_linear should have its own .cmake file instead
7 use_prebuilt_binary(glh_linear)
8 set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
9endif (NOT STANDALONE)
diff --git a/linden/indra/cmake/OpenJPEG.cmake b/linden/indra/cmake/OpenJPEG.cmake
new file mode 100644
index 0000000..fcc82c2
--- /dev/null
+++ b/linden/indra/cmake/OpenJPEG.cmake
@@ -0,0 +1,22 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(OPENJPEG_FIND_QUIETLY ON)
5set(OPENJPEG_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindOpenJPEG)
9else (STANDALONE)
10 use_prebuilt_binary(openjpeg)
11
12 if(WINDOWS)
13 # Windows has differently named release and debug openjpeg(d) libs.
14 set(OPENJPEG_LIBRARIES
15 debug openjpegd
16 optimized openjpeg)
17 else(WINDOWS)
18 set(OPENJPEG_LIBRARIES openjpeg)
19 endif(WINDOWS)
20
21 set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
22endif (STANDALONE)
diff --git a/linden/indra/cmake/OpenSSL.cmake b/linden/indra/cmake/OpenSSL.cmake
new file mode 100644
index 0000000..81584c0
--- /dev/null
+++ b/linden/indra/cmake/OpenSSL.cmake
@@ -0,0 +1,23 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(OpenSSL_FIND_QUIETLY ON)
5set(OpenSSL_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindOpenSSL)
9else (STANDALONE)
10 use_prebuilt_binary(openSSL)
11 if (WINDOWS)
12 set(OPENSSL_LIBRARIES ssleay32 libeay32)
13 else (WINDOWS)
14 set(OPENSSL_LIBRARIES ssl)
15 endif (WINDOWS)
16 set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
17endif (STANDALONE)
18
19if (LINUX)
20 set(CRYPTO_LIBRARIES crypto)
21elseif (DARWIN)
22 set(CRYPTO_LIBRARIES llcrypto)
23endif (LINUX)
diff --git a/linden/indra/cmake/PNG.cmake b/linden/indra/cmake/PNG.cmake
new file mode 100644
index 0000000..4d0b7b2
--- /dev/null
+++ b/linden/indra/cmake/PNG.cmake
@@ -0,0 +1,13 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(PNG_FIND_QUIETLY ON)
5set(PNG_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindPNG)
9else (STANDALONE)
10 use_prebuilt_binary(libpng)
11 set(PNG_LIBRARIES png12)
12 set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
13endif (STANDALONE)
diff --git a/linden/indra/cmake/Prebuilt.cmake b/linden/indra/cmake/Prebuilt.cmake
new file mode 100644
index 0000000..a915192
--- /dev/null
+++ b/linden/indra/cmake/Prebuilt.cmake
@@ -0,0 +1,44 @@
1# -*- cmake -*-
2
3include(Python)
4include(FindSCP)
5
6macro (use_prebuilt_binary _binary)
7 if (NOT STANDALONE)
8 if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
9 if(INSTALL_PROPRIETARY)
10 include(FindSCP)
11 if(DEBUG_PREBUILT)
12 message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. --scp=${SCP_EXECUTABLE} ${_binary}")
13 endif(DEBUG_PREBUILT)
14 execute_process(COMMAND ${PYTHON_EXECUTABLE}
15 install.py
16 --install-dir=${CMAKE_SOURCE_DIR}/..
17 --scp=${SCP_EXECUTABLE}
18 ${_binary}
19 WORKING_DIRECTORY ${SCRIPTS_DIR}
20 RESULT_VARIABLE ${_binary}_installed
21 )
22 else(INSTALL_PROPRIETARY)
23 if(DEBUG_PREBUILT)
24 message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. ${_binary}")
25 endif(DEBUG_PREBUILT)
26 execute_process(COMMAND ${PYTHON_EXECUTABLE}
27 install.py
28 --install-dir=${CMAKE_SOURCE_DIR}/..
29 ${_binary}
30 WORKING_DIRECTORY ${SCRIPTS_DIR}
31 RESULT_VARIABLE ${_binary}_installed
32 )
33 endif(INSTALL_PROPRIETARY)
34 file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
35 else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
36 set(${_binary}_installed 0)
37 endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
38 if(NOT ${_binary}_installed EQUAL 0)
39 message(FATAL_ERROR
40 "Failed to download or unpack prebuilt '${_binary}'."
41 " Process returned ${${_binary}_installed}.")
42 endif (NOT ${_binary}_installed EQUAL 0)
43 endif (NOT STANDALONE)
44endmacro (use_prebuilt_binary _binary)
diff --git a/linden/indra/cmake/Python.cmake b/linden/indra/cmake/Python.cmake
new file mode 100644
index 0000000..e9505fb
--- /dev/null
+++ b/linden/indra/cmake/Python.cmake
@@ -0,0 +1,49 @@
1# -*- cmake -*-
2
3set(PYTHONINTERP_FOUND)
4
5if (WINDOWS)
6 # On Windows, explicitly avoid Cygwin Python.
7
8 find_program(PYTHON_EXECUTABLE
9 NAMES python25.exe python23.exe python.exe
10 NO_DEFAULT_PATH # added so that cmake does not find cygwin python
11 PATHS
12 [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
13 [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
14 [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
15 )
16elseif (EXISTS /etc/debian_version)
17 # On Debian and Ubuntu, avoid Python 2.4 if possible.
18
19 find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin)
20
21 if (PYTHON_EXECUTABLE)
22 set(PYTHONINTERP_FOUND ON)
23 endif (PYTHON_EXECUTABLE)
24elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
25 # On MAC OS X be sure to search standard locations first
26
27 string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}")
28 find_program(PYTHON_EXECUTABLE
29 NAMES python python25 python24 python23
30 NO_DEFAULT_PATH # Avoid searching non-standard locations first
31 PATHS
32 /bin
33 /usr/bin
34 /usr/local/bin
35 ${PATH_LIST}
36 )
37
38 if (PYTHON_EXECUTABLE)
39 set(PYTHONINTERP_FOUND ON)
40 endif (PYTHON_EXECUTABLE)
41else (WINDOWS)
42 include(FindPythonInterp)
43endif (WINDOWS)
44
45if (NOT PYTHON_EXECUTABLE)
46 message(FATAL_ERROR "No Python interpreter found")
47endif (NOT PYTHON_EXECUTABLE)
48
49mark_as_advanced(PYTHON_EXECUTABLE)
diff --git a/linden/indra/cmake/QuickTime.cmake b/linden/indra/cmake/QuickTime.cmake
new file mode 100644
index 0000000..b79ac11
--- /dev/null
+++ b/linden/indra/cmake/QuickTime.cmake
@@ -0,0 +1,33 @@
1# -*- cmake -*-
2
3if(INSTALL_PROPRIETARY)
4 include(Prebuilt)
5 use_prebuilt_binary(quicktime)
6endif(INSTALL_PROPRIETARY)
7
8if (DARWIN)
9 include(CMakeFindFrameworks)
10 find_library(QUICKTIME_LIBRARY QuickTime)
11elseif (WINDOWS)
12 set(QUICKTIME_SDK_DIR "C:\\Program Files\\QuickTime SDK"
13 CACHE PATH "Location of the QuickTime SDK.")
14 find_library(QUICKTIME_LIBRARY qtmlclient
15 PATHS
16 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release
17 "${QUICKTIME_SDK_DIR}\\libraries"
18 )
19 include_directories(
20 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime
21 "${QUICKTIME_SDK_DIR}\\CIncludes"
22 )
23endif (DARWIN)
24
25mark_as_advanced(QUICKTIME_LIBRARY)
26
27if (QUICKTIME_LIBRARY)
28 set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
29endif (QUICKTIME_LIBRARY)
30
31if (QUICKTIME)
32 add_definitions(-DLL_QUICKTIME_ENABLED=1)
33endif (QUICKTIME)
diff --git a/linden/indra/cmake/TemplateCheck.cmake b/linden/indra/cmake/TemplateCheck.cmake
new file mode 100644
index 0000000..3b73dc8
--- /dev/null
+++ b/linden/indra/cmake/TemplateCheck.cmake
@@ -0,0 +1,14 @@
1# -*- cmake -*-
2
3include(Python)
4
5macro (check_message_template _target)
6 add_custom_command(
7 TARGET ${_target}
8 PRE_LINK
9 COMMAND ${PYTHON_EXECUTABLE}
10 ARGS ${SCRIPTS_DIR}/template_verifier.py
11 --mode=development --cache_master
12 COMMENT "Verifying message template"
13 )
14endmacro (check_message_template)
diff --git a/linden/indra/cmake/UI.cmake b/linden/indra/cmake/UI.cmake
new file mode 100644
index 0000000..f529f5b
--- /dev/null
+++ b/linden/indra/cmake/UI.cmake
@@ -0,0 +1,64 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (STANDALONE)
5 include(FindPkgConfig)
6
7 if (LINUX)
8 set(PKGCONFIG_PACKAGES
9 atk
10 cairo
11 gdk-2.0
12 gdk-pixbuf-2.0
13 glib-2.0
14 gmodule-2.0
15 gtk+-2.0
16 gthread-2.0
17 libpng
18 pango
19 pangoft2
20 pangox
21 pangoxft
22 sdl
23 )
24 endif (LINUX)
25
26 foreach(pkg ${PKGCONFIG_PACKAGES})
27 pkg_check_modules(${pkg} REQUIRED ${pkg})
28 include_directories(${${pkg}_INCLUDE_DIRS})
29 link_directories(${${pkg}_LIBRARY_DIRS})
30 list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
31 add_definitions(${${pkg}_CFLAGS_OTHERS})
32 endforeach(pkg)
33else (STANDALONE)
34 use_prebuilt_binary(gtk-atk-pango-glib)
35 if (LINUX)
36 set(UI_LIBRARIES
37 atk-1.0
38 gdk-x11-2.0
39 gdk_pixbuf-2.0
40 Xinerama
41 glib-2.0
42 gmodule-2.0
43 gobject-2.0
44 gthread-2.0
45 gtk-x11-2.0
46 pango-1.0
47 pangoft2-1.0
48 pangox-1.0
49 pangoxft-1.0
50 )
51 endif (LINUX)
52
53 include_directories (
54 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
55 ${LIBS_PREBUILT_DIR}/include
56 )
57 foreach(include ${${LL_ARCH}_INCLUDES})
58 include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include})
59 endforeach(include)
60endif (STANDALONE)
61
62if (LINUX)
63 add_definitions(-DLL_GTK=1 -DLL_X11=1)
64endif (LINUX)
diff --git a/linden/indra/cmake/UnixInstall.cmake b/linden/indra/cmake/UnixInstall.cmake
new file mode 100644
index 0000000..139be0a
--- /dev/null
+++ b/linden/indra/cmake/UnixInstall.cmake
@@ -0,0 +1,31 @@
1if (NOT ${viewer_VERSION})
2 MESSAGE(FATAL_ERROR "Viewer version not known!")
3endif (NOT ${viewer_VERSION})
4
5set(INSTALL OFF CACHE BOOL
6 "Generate install target.")
7
8if (INSTALL)
9 set(INSTALL_PREFIX /usr CACHE PATH
10 "Top-level installation directory.")
11
12 if (EXISTS /lib64)
13 set(_LIB lib64)
14 else (EXISTS /lib64)
15 set(_LIB lib)
16 endif (EXISTS /lib64)
17
18 set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH
19 "Installation directory for read-only shared files.")
20
21 set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH
22 "Installation directory for read-only shared files.")
23
24 set(APP_BINARY_DIR ${INSTALL_LIBRARY_DIR}/secondlife-${viewer_VERSION}
25 CACHE PATH
26 "Installation directory for binaries.")
27
28 set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/secondlife-${viewer_VERSION}
29 CACHE PATH
30 "Installation directory for read-only data files.")
31endif (INSTALL)
diff --git a/linden/indra/cmake/Variables.cmake b/linden/indra/cmake/Variables.cmake
new file mode 100644
index 0000000..5868e4d
--- /dev/null
+++ b/linden/indra/cmake/Variables.cmake
@@ -0,0 +1,100 @@
1# -*- cmake -*-
2#
3# Definitions of variables used throughout the Second Life build
4# process.
5#
6# Platform variables:
7#
8# DARWIN - Mac OS X
9# LINUX - Linux
10# WINDOWS - Windows
11#
12# What to build:
13#
14# VIEWER - viewer and other viewer-side components
15# SERVER - simulator and other server-side bits
16
17
18# Relative and absolute paths to subtrees.
19
20set(LIBS_CLOSED_PREFIX)
21set(LIBS_OPEN_PREFIX)
22set(LIBS_SERVER_PREFIX)
23set(SCRIPTS_PREFIX ../scripts)
24set(SERVER_PREFIX)
25set(VIEWER_PREFIX)
26
27set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
28set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
29set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
30set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
31set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
32set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
33
34set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
35 "Location of prebuilt libraries.")
36
37if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
38 # We use this as a marker that you can try to use the proprietary libraries.
39 set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
40endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
41
42
43if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
44 set(WINDOWS ON BOOL FORCE)
45 set(ARCH i686)
46 set(LL_ARCH ${ARCH}_win32)
47 set(LL_ARCH_DIR ${ARCH}-win32)
48endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
49
50if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
51 set(LINUX ON BOOl FORCE)
52 execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
53 OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
54 set(LL_ARCH ${ARCH}_linux)
55 set(LL_ARCH_DIR ${ARCH}-linux)
56endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
57
58if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
59 set(DARWIN 1)
60 # set this dynamically from the build system now -
61 # NOTE: wont have a distributable build unless you add this on the configure line with:
62 # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
63 #set(CMAKE_OSX_ARCHITECTURES i386;ppc)
64 set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
65 if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
66 set(ARCH universal)
67 else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
68 if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
69 set(ARCH ppc)
70 else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
71 set(ARCH i386)
72 endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
73 endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
74 set(LL_ARCH ${ARCH}_darwin)
75 set(LL_ARCH_DIR universal-darwin)
76endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
77
78# Default deploy grid
79set(GRID agni CACHE STRING "Target Grid")
80
81set(VIEWER ON CACHE BOOL "Build Second Life viewer.")
82set(VIEWER_CHANNEL "Developer" CACHE STRING "Viewer Channel Name")
83set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
84
85set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
86
87if (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
88 set(SERVER ON CACHE BOOL "Build Second Life server software.")
89endif (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
90
91if (LINUX AND SERVER AND VIEWER)
92 MESSAGE(FATAL_ERROR "
93The indra source does not currently support building SERVER and VIEWER at the same time.
94Please set one of these values to OFF in your CMake cache file.
95(either by running ccmake or by editing CMakeCache.txt by hand)
96For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment
97 ")
98endif (LINUX AND SERVER AND VIEWER)
99
100source_group("CMake Rules" FILES CMakeLists.txt)
diff --git a/linden/indra/cmake/ViewerMiscLibs.cmake b/linden/indra/cmake/ViewerMiscLibs.cmake
new file mode 100644
index 0000000..68ee881
--- /dev/null
+++ b/linden/indra/cmake/ViewerMiscLibs.cmake
@@ -0,0 +1,10 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4if (NOT STANDALONE)
5 use_prebuilt_binary(libstdc++)
6 use_prebuilt_binary(libuuid)
7 use_prebuilt_binary(vivox)
8 use_prebuilt_binary(fontconfig)
9endif(NOT STANDALONE)
10
diff --git a/linden/indra/cmake/XmlRpcEpi.cmake b/linden/indra/cmake/XmlRpcEpi.cmake
new file mode 100644
index 0000000..107d192
--- /dev/null
+++ b/linden/indra/cmake/XmlRpcEpi.cmake
@@ -0,0 +1,17 @@
1# -*- cmake -*-
2include(Prebuilt)
3
4set(XMLRPCEPI_FIND_QUIETLY ON)
5set(XMLRPCEPI_FIND_REQUIRED ON)
6
7if (STANDALONE)
8 include(FindXmlRpcEpi)
9else (STANDALONE)
10 use_prebuilt_binary(xmlrpc-epi)
11 if (WINDOWS)
12 set(XMLRPCEPI_LIBRARIES xmlrpcepi)
13 else (WINDOWS)
14 set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
15 endif (WINDOWS)
16 set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
17endif (STANDALONE)
diff --git a/linden/indra/cmake/ZLIB.cmake b/linden/indra/cmake/ZLIB.cmake
new file mode 100644
index 0000000..80d4191
--- /dev/null
+++ b/linden/indra/cmake/ZLIB.cmake
@@ -0,0 +1,20 @@
1# -*- cmake -*-
2
3set(ZLIB_FIND_QUIETLY ON)
4set(ZLIB_FIND_REQUIRED ON)
5
6include(Prebuilt)
7
8if (STANDALONE)
9 include(FindZLIB)
10else (STANDALONE)
11 use_prebuilt_binary(zlib)
12 if (WINDOWS)
13 set(ZLIB_LIBRARIES zlib)
14 else (WINDOWS)
15 set(ZLIB_LIBRARIES z)
16 endif (WINDOWS)
17 if (WINDOWS OR LINUX)
18 set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/zlib)
19 endif (WINDOWS OR LINUX)
20endif (STANDALONE)