On Monday 30 January 2012, Brad King wrote: ... > You're running into the same can of worms I (now) remember running into > a few years ago when you first proposed handling imported targets with > try_compile. That's one reason it never got done. Let's just drop the > C++ side of this again. Your CMake-code-only solution is probably good > enough for typical use cases. Please refine that based on my original > comments and post again. I'm sorry for leading you on this goose chase.
Done, and pushed to stage. I added the prefix "cmake_" to the function, and added a test for it. Additionally some fixes and style changes. This is the test: include(CheckFunctionExists) set(CMAKE_REQUIRED_LIBRARIES exp_testLib2) check_function_exists(testLib1 HAVE_TESTLIB1_FUNCTION) if (NOT HAVE_TESTLIB1_FUNCTION) message(SEND_ERROR "Using imported target testLib2 failed !") endif() I.e. it uses the imported target exp_testLib2 in CMAKE_REQUIRED_LIBRARIES, and checks for a function from testLib1, which must have been pulled in transitively. Ok to merge ? Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
