diff --git a/cmake/Modules/FindNeon.cmake b/cmake/Modules/FindNeon.cmake index 8b12a5c21..5c1f85bfe 100644 --- a/cmake/Modules/FindNeon.cmake +++ b/cmake/Modules/FindNeon.cmake @@ -14,52 +14,33 @@ # -if (NEON_LIBRARIES AND NEON_INCLUDE_DIRS) - # in cache already - set(NEON_FOUND TRUE) -else (NEON_LIBRARIES AND NEON_INCLUDE_DIRS) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) +find_package(PkgConfig) +if (PKG_CONFIG_FOUND) pkg_check_modules(_NEON neon) - endif (PKG_CONFIG_FOUND) +endif (PKG_CONFIG_FOUND) - find_path(NEON_INCLUDE_DIR - NAMES - neon/ne_basic.h - PATHS - ${_NEON_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /sw/include - ) +include(GNUInstallDirs) - find_library(NEON_LIBRARY - NAMES - neon - PATHS - ${_NEON_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) +find_path(NEON_INCLUDE_DIRS +NAMES + neon/ne_basic.h +HINTS + ${_NEON_INCLUDEDIR} + ${CMAKE_INSTALL_INCLUDEDIR} +) - set(NEON_INCLUDE_DIRS - ${NEON_INCLUDE_DIR} - ) +find_library(NEON_LIBRARIES +NAMES + neon +HINTS + ${_NEON_LIBDIR} + ${CMAKE_INSTALL_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 +) - if (NEON_LIBRARY) - set(NEON_LIBRARIES - ${NEON_LIBRARIES} - ${NEON_LIBRARY} - ) - endif (NEON_LIBRARY) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Neon DEFAULT_MSG NEON_LIBRARIES NEON_INCLUDE_DIRS) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Neon DEFAULT_MSG NEON_LIBRARIES NEON_INCLUDE_DIRS) - - # show the NEON_INCLUDE_DIRS and NEON_LIBRARIES variables only in the advanced view - mark_as_advanced(NEON_INCLUDE_DIRS NEON_LIBRARIES) - -endif (NEON_LIBRARIES AND NEON_INCLUDE_DIRS) +# show the NEON_INCLUDE_DIRS and NEON_LIBRARIES variables only in the advanced view +mark_as_advanced(NEON_INCLUDE_DIRS NEON_LIBRARIES)