force release for NVTT on Win32

This commit is contained in:
Stephen Birarda 2017-04-14 15:03:08 -07:00 committed by Atlante45
parent 5c12180b58
commit 3a217f75f4
3 changed files with 10 additions and 8 deletions

View file

@ -11,15 +11,19 @@ if (NOT ANDROID)
${EXTERNAL_NAME}
URL http://s3.amazonaws.com/hifi-public/dependencies/nvtt-win-2.1.0.zip
URL_MD5 3ea6eeadbcc69071acf9c49ba565760e
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD 1
)
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Release/x64/nvtt.lib CACHE FILEPATH "Path to NVTT static release library")
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${SOURCE_DIR}/Debug/x64/nvtt.lib CACHE FILEPATH "Path to NVTT static debug library")
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE PATH "Location of NVTT include directory")
set(${EXTERNAL_NAME_UPPER}_DLL_PATH "${SOURCE_DIR}/$<$<CONFIG:Debug>:Debug>$<$<NOT:$<CONFIG:Debug>>:Release>/x64" CACHE PATH "Location of NVTT DLL")
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Release/x64/nvtt.lib CACHE FILEPATH "Path to NVTT release library")
set(${EXTERNAL_NAME_UPPER}_DLL_PATH "${SOURCE_DIR}/Release/x64" CACHE PATH "Location of NVTT release DLL")
else ()
ExternalProject_Add(
${EXTERNAL_NAME}

View file

@ -27,15 +27,12 @@ if (WIN32)
find_library(NVTT_LIBRARY_RELEASE nvtt PATH_SUFFIXES "Release.x64/lib" HINTS ${NVTT_SEARCH_DIRS})
find_library(NVTT_LIBRARY_DEBUG nvtt PATH_SUFFIXES "Debug.x64/lib" HINTS ${NVTT_SEARCH_DIRS})
find_path(NVTT_RELEASE_DLL_PATH nvtt.dll PATH_SUFFIXES "Release.x64/bin" HINTS ${NVTT_SEARCH_DIRS})
find_path(NVTT_DEBUG_DLL_PATH nvtt.dll PATH_SUFFIXES "Debug.x64/lib" HINTS ${NVTT_SEARCH_DIRS})
find_path(NVTT_DLL_PATH nvtt.dll PATH_SUFFIXES "Release.x64/bin" HINTS ${NVTT_SEARCH_DIRS})
include(SelectLibraryConfigurations)
select_library_configurations(NVTT)
find_package_handle_standard_args(NVTT DEFAULT_MSG NVTT_INCLUDE_DIRS NVTT_LIBRARIES NVTT_RELEASE_DLL_PATH NVTT_DEBUG_DLL_PATH)
set(NVTT_DLL_PATH "$<$<NOT:$<CONFIG:Debug>>:${NVTT_RELEASE_DLL_PATH}>$<$<CONFIG:Debug>:${NVTT_DEBUG_DLL_PATH}>")
find_package_handle_standard_args(NVTT DEFAULT_MSG NVTT_INCLUDE_DIRS NVTT_LIBRARIES NVTT_DLL_PATH)
else ()
find_library(NVTT_BASE_LIBRARY nvtt PATH_SUFFIXES "lib/static" HINTS ${NVTT_SEARCH_DIRS})
find_library(NVTT_CORE_LIBRARY nvcore PATH_SUFFIXES "lib/static" HINTS ${NVTT_SEARCH_DIRS})

View file

@ -8,4 +8,5 @@ add_dependency_external_projects(nvtt)
find_package(NVTT REQUIRED)
target_include_directories(${TARGET_NAME} PRIVATE ${NVTT_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} ${NVTT_LIBRARIES})
message(${NVTT_DLL_PATH})
add_paths_to_fixup_libs(${NVTT_DLL_PATH})