mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 18:02:13 +02:00
use a cache variable to pass around lib paths
This commit is contained in:
parent
250b25154c
commit
767601de4f
4 changed files with 23 additions and 3 deletions
16
cmake/macros/AddPathToLibPaths.cmake
Normal file
16
cmake/macros/AddPathToLibPaths.cmake
Normal file
|
@ -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()
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
#
|
||||
|
||||
include(BundleUtilities)
|
||||
fixup_bundle("${BUNDLE_EXECUTABLE}" "" "${LIB_SEARCH_DIRS}")
|
||||
fixup_bundle("${BUNDLE_EXECUTABLE}" "" "${LIB_PATHS}")
|
|
@ -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=$<TARGET_FILE:${TARGET_NAME}>
|
||||
-DLIB_SEARCH_DIRS=${LIB_SEARCH_DIRS}
|
||||
-DLIB_PATHS=${LIB_PATHS}
|
||||
-P ${HIFI_CMAKE_DIR}/scripts/FixupBundlePostBuild.cmake
|
||||
)
|
||||
endif ()
|
||||
|
|
Loading…
Reference in a new issue