list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(CREATE_LINK "libsymlinked.a" "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlink.a" SYMBOLIC) find_library(SYMLINK_LIBRARY NAMES symlink PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib NO_DEFAULT_PATH ) message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlinked.a" "symlinked") find_library(SYMLINK_LIBRARY NAMES symlink PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib NO_DEFAULT_PATH ) message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'")