Skip to content
This repository
Newer
Older
100644 70 lines (59 sloc) 1.738 kb
c3f1ab2f »
2010-02-18 Changes reqiured to open source HipHop
1 function(auto_sources RETURN_VALUE PATTERN SOURCE_SUBDIRS)
2
3 if ("${SOURCE_SUBDIRS}" STREQUAL "RECURSE")
4 SET(PATH ".")
5 if (${ARGC} EQUAL 4)
6 list(GET ARGV 3 PATH)
a819acc0 »
2010-12-02 Fix building projects where hphp is executed in a child directory.
7 endif ()
8 endif()
c3f1ab2f »
2010-02-18 Changes reqiured to open source HipHop
9
10 if ("${SOURCE_SUBDIRS}" STREQUAL "RECURSE")
a819acc0 »
2010-12-02 Fix building projects where hphp is executed in a child directory.
11 unset(${RETURN_VALUE})
12 file(GLOB SUBDIR_FILES "${PATH}/${PATTERN}")
13 list(APPEND ${RETURN_VALUE} ${SUBDIR_FILES})
14
15 file(GLOB subdirs RELATIVE ${PATH} ${PATH}/*)
16
17 foreach(DIR ${subdirs})
18 if (IS_DIRECTORY ${PATH}/${DIR})
19 if (NOT "${DIR}" STREQUAL "CMakeFiles")
20 file(GLOB_RECURSE SUBDIR_FILES "${PATH}/${DIR}/${PATTERN}")
21 list(APPEND ${RETURN_VALUE} ${SUBDIR_FILES})
22 endif()
23 endif()
24 endforeach()
25 else ()
c3f1ab2f »
2010-02-18 Changes reqiured to open source HipHop
26 file(GLOB ${RETURN_VALUE} "${PATTERN}")
27
28 foreach (PATH ${SOURCE_SUBDIRS})
29 file(GLOB SUBDIR_FILES "${PATH}/${PATTERN}")
30 list(APPEND ${RETURN_VALUE} ${SUBDIR_FILES})
31 endforeach(PATH ${SOURCE_SUBDIRS})
a819acc0 »
2010-12-02 Fix building projects where hphp is executed in a child directory.
32 endif ()
c3f1ab2f »
2010-02-18 Changes reqiured to open source HipHop
33
34 if (${FILTER_OUT})
35 list(REMOVE_ITEM ${RETURN_VALUE} ${FILTER_OUT})
a819acc0 »
2010-12-02 Fix building projects where hphp is executed in a child directory.
36 endif()
c3f1ab2f »
2010-02-18 Changes reqiured to open source HipHop
37
38 set(${RETURN_VALUE} ${${RETURN_VALUE}} PARENT_SCOPE)
39 endfunction(auto_sources)
40
90903dae »
2010-12-15 Fix cclient code when static library is used
41 function(CONTAINS_STRING FILE SEARCH RETURN_VALUE)
42 file(STRINGS ${FILE} FILE_CONTENTS REGEX ".*${SEARCH}.*")
43 if (FILE_CONTENTS)
44 set(${RETURN_VALUE} True PARENT_SCOPE)
45 endif()
46 endfunction(CONTAINS_STRING)
47
bf627141 »
2010-03-04 Add socket finding function for eventual use
48 macro(MYSQL_SOCKET_SEARCH)
49 foreach (i
50 /var/run/mysqld/mysqld.sock
51 /var/tmp/mysql.sock
52 /var/run/mysql/mysql.sock
53 /var/lib/mysql/mysql.sock
54 /var/mysql/mysql.sock
55 /usr/local/mysql/var/mysql.sock
56 /Private/tmp/mysql.sock
57 /private/tmp/mysql.sock
58 /tmp/mysql.sock
59 )
60 if (EXISTS ${i})
61 set(MYSQL_SOCK ${i})
62 break()
63 endif()
64 endforeach()
65
66 if (MYSQL_SOCK)
9d3392fb »
2010-11-09 Skip tcmalloc in debug builds and fix socket detection with MySQL
67 set(MYSQL_UNIX_SOCK_ADDR ${MYSQL_SOCK} CACHE STRING "Path to MySQL Socket")
bf627141 »
2010-03-04 Add socket finding function for eventual use
68 endif()
69 endmacro()
Something went wrong with that request. Please try again.