Merging r50522 through r50572 from trunk into soc-2011-tomato
[blender.git] / build_files / cmake / macros.cmake
index f14e92047329d7c8a3ab7f59d86f4ef5e9b1fb24..ad5e3155368d0566d62f01c7039d142cea4787d7 100644 (file)
@@ -27,7 +27,10 @@ macro(list_insert_after
        list_id item_check item_add
        )
        set(_index)
-       list(FIND ${list_id} "${item_check}" _index)
+       list(FIND "${list_id}" "${item_check}" _index)
+       if("${_index}" MATCHES "-1")
+               message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
+       endif()
        math(EXPR _index "${_index} + 1")
        list(INSERT ${list_id} "${_index}" ${item_add})
        unset(_index)
@@ -37,7 +40,10 @@ macro(list_insert_before
        list_id item_check item_add
        )
        set(_index)
-       list(FIND ${list_id} "${item_check}" _index)
+       list(FIND "${list_id}" "${item_check}" _index)
+       if("${_index}" MATCHES "-1")
+               message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
+       endif()
        list(INSERT ${list_id} "${_index}" ${item_add})
        unset(_index)
 endmacro()
@@ -373,6 +379,9 @@ macro(setup_liblinks
        if(WITH_MOD_CLOTH_ELTOPO)
                target_link_libraries(${target} ${LAPACK_LIBRARIES})
        endif()
+       if(WITH_CYCLES_OSL)
+               target_link_libraries(${target} ${OSL_LIBRARIES})
+       endif()
        if(WIN32 AND NOT UNIX)
                target_link_libraries(${target} ${PTHREADS_LIBRARIES})
        endif()