diff --git a/cmake/macros/AddPathToLibPaths.cmake b/cmake/macros/AddPathToLibPaths.cmake new file mode 100644 index 0000000000..397680a237 --- /dev/null +++ b/cmake/macros/AddPathToLibPaths.cmake @@ -0,0 +1,16 @@ +# +# AddPathToLibPaths.cmake +# cmake/macros +# +# Copyright 2015 High Fidelity, Inc. +# Created by Stephen Birarda on February 13, 2014 +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +macro(ADD_PATH_TO_LIB_PATHS _PATH) + set(TEMP_LIB_PATHS ${LIB_PATHS}) + list(APPEND TEMP_LIB_PATHS ${_PATH}) + set(LIB_PATHS ${TEMP_LIB_PATHS} CACHE TYPE LIST FORCE) +endmacro() \ No newline at end of file diff --git a/cmake/modules/FindSoxr.cmake b/cmake/modules/FindSoxr.cmake index 367022e9ec..cfe0428ebc 100644 --- a/cmake/modules/FindSoxr.cmake +++ b/cmake/modules/FindSoxr.cmake @@ -24,6 +24,11 @@ hifi_library_search_hints("soxr") find_path(SOXR_INCLUDE_DIRS soxr.h PATH_SUFFIXES include HINTS ${SOXR_SEARCH_DIRS}) find_library(SOXR_LIBRARIES NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS}) +if (NOT DEFINED SOXR_LIB_PATH) + get_filename_component(SOXR_LIB_PATH ${SOXR_LIBRARIES} DIRECTORY CACHE) + add_path_to_lib_paths(${SOXR_LIB_PATH}) +endif () + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(SOXR DEFAULT_MSG SOXR_INCLUDE_DIRS SOXR_LIBRARIES) diff --git a/cmake/scripts/FixupBundlePostBuild.cmake b/cmake/scripts/FixupBundlePostBuild.cmake index e41d5cbc45..826033d791 100644 --- a/cmake/scripts/FixupBundlePostBuild.cmake +++ b/cmake/scripts/FixupBundlePostBuild.cmake @@ -10,4 +10,4 @@ # include(BundleUtilities) -fixup_bundle("${BUNDLE_EXECUTABLE}" "" "${LIB_SEARCH_DIRS}") \ No newline at end of file +fixup_bundle("${BUNDLE_EXECUTABLE}" "" "${LIB_PATHS}") \ No newline at end of file diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 746f08e0d6..fd13aa7092 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -240,14 +240,13 @@ else (APPLE) endif (APPLE) if (WIN32) - list(APPEND LIB_SEARCH_DIRS ${EXTERNALS_BINARY_DIR}) # add a post-build command to copy DLLs beside the interface executable add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -DBUNDLE_EXECUTABLE=$ - -DLIB_SEARCH_DIRS=${LIB_SEARCH_DIRS} + -DLIB_PATHS=${LIB_PATHS} -P ${HIFI_CMAKE_DIR}/scripts/FixupBundlePostBuild.cmake ) endif ()