+SET(
+ _all_libs
+ ${cpPlugins_tinyxml2_LIB}
+ ${cpExtensions_LIB}
+ ${cpPlugins_LIB}
+ ${cpBaseQtApplication_LIB}
+ ${cpPlugins_Instances}
+ )
+
+SET(_l_locations)
+FOREACH(_l ${_all_libs})
+ SET(cpPlugins_library_location)
+ IF(MSVC)
+ FIND_LIBRARY(
+ cpPlugins_library_location_${_l} NAMES ${_l}
+ HINTS
+ @PROJECT_BINARY_DIR@/$(ConfigurationName)
+ @CMAKE_INSTALL_PREFIX@/bin
+ @CMAKE_INSTALL_PREFIX@/lib
+ )
+ ELSE(MSVC)
+ FIND_LIBRARY(
+ cpPlugins_library_location_${_l} NAMES ${_l}
+ HINTS
+ @PROJECT_BINARY_DIR@
+ @CMAKE_INSTALL_PREFIX@/bin
+ @CMAKE_INSTALL_PREFIX@/lib
+ )
+ ENDIF(MSVC)
+ MARK_AS_ADVANCED(FORCE cpPlugins_library_location_${_l})
+ IF(cpPlugins_library_location_${_l})
+ GET_FILENAME_COMPONENT(_dir ${cpPlugins_library_location_${_l}} DIRECTORY)
+ LIST(APPEND _l_locations ${_dir})
+ ENDIF(cpPlugins_library_location_${_l})
+ENDFOREACH(_l)
+IF(_l_locations)
+ LIST(REMOVE_DUPLICATES _l_locations)
+ LINK_DIRECTORIES(${_l_locations})
+ENDIF(_l_locations)