Permalink
Browse files

Find Onigruma propery and tidy up a little of the other library detec…

…tion code.
  • Loading branch information...
1 parent d3b1145 commit b2228f4acbe2adaa517a38f9919bef1b7ff3300c @scottmac scottmac committed Mar 4, 2010
Showing with 42 additions and 12 deletions.
  1. +30 −0 CMake/FindONIGURUMA.cmake
  2. +12 −12 CMake/HPHPFindLibs.cmake
View
30 CMake/FindONIGURUMA.cmake
@@ -0,0 +1,30 @@
+# - Find oniguruma
+# Find the native Oniguruma includes and library
+#
+# ONIGURUMA_INCLUDE_DIRS - where to find oniguruma.h, etc.
+# ONIGURUMA_LIBRARIES - List of libraries when using oniguruma.
+# ONIGURUMA_FOUND - True if oniguruma found.
+
+
+IF (ONIGURUMA_INCLUDE_DIRS)
+ # Already in cache, be silent
+ SET(ONIGURUMA_FIND_QUIETLY TRUE)
+ENDIF ()
+
+FIND_PATH(ONIGURUMA_INCLUDE_DIR oniguruma.h)
+
+SET(ONIGURUMA_NAMES onig)
+FIND_LIBRARY(ONIGURUMA_LIBRARY NAMES ${ONIGURUMA_NAMES} )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ONIGURUMA DEFAULT_MSG ONIGURUMA_LIBRARY ONIGURUMA_INCLUDE_DIR)
+
+IF(ONIGURUMA_FOUND)
+ SET( ONIGURUMA_LIBRARIES ${ONIGURUMA_LIBRARY} )
+ SET( ONIGURUMA_INCLUDE_DIRS ${ONIGURUMA_INCLUDE_DIR} )
+ELSE()
+ SET( ONIGURUMA_LIBRARIES )
+ SET( PONIGURUMA_INCLUDE_DIRS )
+ENDIF()
+
+MARK_AS_ADVANCED( ONIGURUMA_LIBRARIES ONIGURUMA_INCLUDE_DIRS )
View
24 CMake/HPHPFindLibs.cmake
@@ -114,11 +114,12 @@ if (ICU_FOUND)
endif (ICU_FOUND)
# (google heap OR cpu profiler) AND libunwind
+FIND_LIBRARY(UNWIND_LIB unwind)
# Google tmalloc
-
-# xhplibs
-
+FIND_LIBRARY(GOOGLE_TCMALLOC_LIB tcmalloc)
+FIND_LIBRARY(GOOGLE_TCMALLOC_MINIMAL_LIB tcmalloc_minimal)
+FIND_LIBRARY(GOOGLE_PROFILER_LIB profiler)
# tbb libs
find_package(TBB REQUIRED)
@@ -144,10 +145,8 @@ find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})
#oniguruma
-FIND_LIBRARY(ONIG_LIB onig)
-if (ONIG_LIB STREQUAL "ONIG_LIB-NOTFOUND")
- message(FATAL_ERROR "You need to install libonig")
-endif()
+find_package(ONIGURUMA REQUIRED)
+include_directories(${ONIGURUMA_INCLUDE_DIRS})
#LINK_LIBS = -lpthread $(BFD_LIBS) -lrt -lstdc++ -lresolv
#-lcrypto -lcrypt
@@ -199,14 +198,15 @@ macro(hphp_link target)
target_link_libraries(${target} ${OPENSSL_LIBRARIES})
target_link_libraries(${target} ${ZLIB_LIBRARIES})
+ target_link_libraries(${target} ${LIBXML2_LIBRARIES})
+ target_link_libraries(${target} ${EXPAT_LIBRARY})
+ target_link_libraries(${target} ${ONIGURUMA_LIBRARIES})
+ target_link_libraries(${target} ${Mcrypt_LIB})
+ target_link_libraries(${target} ${GD_LIBRARY})
+
target_link_libraries(${target} timelib)
target_link_libraries(${target} sqlite3)
target_link_libraries(${target} xhp)
target_link_libraries(${target} afdt)
target_link_libraries(${target} mbfl)
- target_link_libraries(${target} ${LIBXML2_LIBRARIES})
- target_link_libraries(${target} ${EXPAT_LIBRARY})
- target_link_libraries(${target} ${ONIG_LIB})
- target_link_libraries(${target} ${Mcrypt_LIB})
- target_link_libraries(${target} ${GD_LIBRARY})
endmacro()

0 comments on commit b2228f4

Please sign in to comment.