diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2015-04-30 10:46:01 -0400 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2015-04-30 10:46:01 -0400 |
| commit | b427dcdda286603a06ed29b45f1090894e92074a (patch) | |
| tree | 734a0759fe9f1561a86f074396ec90d6f8011562 /cmake/FindUnibilium.cmake | |
| parent | 45b617afada9304cb265aad02645b22d76dfc2d5 (diff) | |
| parent | 8130eb1191aece52d8b2790302abf1bd09aaf90f (diff) | |
| download | rneovim-b427dcdda286603a06ed29b45f1090894e92074a.tar.gz rneovim-b427dcdda286603a06ed29b45f1090894e92074a.tar.bz2 rneovim-b427dcdda286603a06ed29b45f1090894e92074a.zip | |
Merge pull request #2465 from fwalch/fix-jemalloc
Force je_ prefix for jemalloc functions, small CMake fixes.
Diffstat (limited to 'cmake/FindUnibilium.cmake')
| -rw-r--r-- | cmake/FindUnibilium.cmake | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/cmake/FindUnibilium.cmake b/cmake/FindUnibilium.cmake new file mode 100644 index 0000000000..e1e0de9b7e --- /dev/null +++ b/cmake/FindUnibilium.cmake @@ -0,0 +1,47 @@ +# - Try to find unibilium +# Once done this will define +# UNIBILIUM_FOUND - System has unibilium +# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories +# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium + +if(NOT UNIBILIUM_USE_BUNDLED) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(PC_UNIBILIUM QUIET unibilium) + endif() +else() + set(PC_UNIBILIUM_INCLUDEDIR) + set(PC_UNIBILIUM_INCLUDE_DIRS) + set(PC_UNIBILIUM_LIBDIR) + set(PC_UNIBILIUM_LIBRARY_DIRS) + set(LIMIT_SEARCH NO_DEFAULT_PATH) +endif() + +set(UNIBILIUM_DEFINITIONS ${PC_UNIBILIUM_CFLAGS_OTHER}) + +find_path(UNIBILIUM_INCLUDE_DIR unibilium.h + PATHS ${PC_UNIBILIUM_INCLUDEDIR} ${PC_UNIBILIUM_INCLUDE_DIRS} + ${LIMIT_SEARCH}) + +# If we're asked to use static linkage, add libunibilium.a as a preferred library name. +if(UNIBILIUM_USE_STATIC) + list(APPEND UNIBILIUM_NAMES + "${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}") +endif() + +list(APPEND UNIBILIUM_NAMES unibilium) + +find_library(UNIBILIUM_LIBRARY NAMES ${UNIBILIUM_NAMES} + HINTS ${PC_UNIBILIUM_LIBDIR} ${PC_UNIBILIUM_LIBRARY_DIRS} + ${LIMIT_SEARCH}) + +set(UNIBILIUM_LIBRARIES ${UNIBILIUM_LIBRARY}) +set(UNIBILIUM_INCLUDE_DIRS ${UNIBILIUM_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set UNIBILIUM_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(unibilium DEFAULT_MSG + UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR) + +mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY) |
