Hi, I am running 3.2.2 and also get the error with 3.1.0 on a mac. I have the particular curl library in a custom path. The following snippet fetches the library correctly for mac and iOS, but not for iOS-simulator. I also tried to change find_library to find_path using the real (platform dependent) library name.
TARGET_OS is our custom string for switching between different target platforms. message(STATUS "Searching for CURL library in ${SEARCH_BASE}/lib") unset(CURL_LIBRARY CACHE) if(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Mac/iOS method find_library") find_library(CURL_LIBRARY NAMES curl PATHS ${SEARCH_BASE} PATH_SUFFIXES lib NO_DEFAULT_PATH) else(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Non-Mac method find_library") find_library(CURL_LIBRARY NAMES curl PATHS ${SEARCH_BASE} PATH_SUFFIXES lib NO_CMAKE_FIND_ROOT_PATH) endif(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Curl Library: ${CURL_LIBRARY}") if(CURL_LIBRARY) message(STATUS "Curl library found") list(APPEND CURL_LIBRARIES ${CURL_LIBRARY} z) else(CURL_LIBRARY) message(STATUS "Curl library not found") endif(CURL_LIBRARY) When running cmake in the console, I get the following (for iOS Simulator only): -- Searching for CURL library in /Users/blaschnas/src/project/build/ios-x86-clang-libcxx/libs/curl/lib -- Mac/iOS method find_library -- Curl Library: CURL_LIBRARY-NOTFOUND -- Curl library not found When I look into the directory of the library, I can see libcurl.a lying exactly there. Does find_library test for architecture, like deeply inspect the library or is it basically composing the correct prefix and suffix and then behaves like find_path? Thanks for your help. /jochen
signature.asc
Description: Message signed with OpenPGP using GPGMail
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake