update nvtt external to build from source

This commit is contained in:
Stephen Birarda 2017-04-14 11:29:19 -07:00 committed by Atlante45
parent 94e1cbbc95
commit ee62e7dcb8
3 changed files with 44 additions and 13 deletions

View file

@ -8,29 +8,29 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
if (NOT ANDROID)
ExternalProject_Add(
${EXTERNAL_NAME}
URL "https://s3-us-west-1.amazonaws.com/hifi-content/clement/dev/nvtt.zip"
URL_MD5 "3ea6eeadbcc69071acf9c49ba565760e"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
URL http://hifi-public.s3.amazonaws.com/dependencies/nvidia-texture-tools-2.1.0.zip
URL_MD5 79842ea185c8c95aaa70cee91e77f032
CONFIGURE_COMMAND CMAKE_ARGS ${ANDROID_CMAKE_ARGS} -DNVTT_SHARED=0 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
)
# Hide this external target (for IDE users)
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE PATH "Location of NVTT include directory")
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${INSTALL_DIR}/include CACHE PATH "Location of NVTT include directory")
if (WIN32)
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/x64/nvtt.lib CACHE FILEPATH "Path to NVTT library")
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${SOURCE_DIR}/Release/x64 CACHE PATH "Location of NVTT DLL")
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${INSTALL_DIR}/Debug/x64/nvtt.lib CACHE FILEPATH "Path to NVTT Debug library")
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/Release/x64/nvtt.lib CACHE FILEPATH "Path to NVTT Release library")
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${INSTALL_DIR}/Release/x64 CACHE PATH "Location of NVTT DLL")
add_paths_to_fixup_libs(${${EXTERNAL_NAME_UPPER}_DLL_PATH})
else (APPLE)
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/lib/static/libnvtt.a CACHE FILEPATH "Path to NVTT static library")
elseif ()
set(${EXTERNAL_NAME_UPPER}_LIBRARY_TEMP ${INSTALL_DIR}/lib/nvtt.so CACHE FILEPATH "Path to NVTT library")
else ()
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/lib/static/libnvtt.a CACHE FILEPATH "Path to NVTT static library")
endif ()
endif()

View file

@ -0,0 +1,30 @@
#
# FindNVTT.cmake
#
# Try to find NVIDIA texture tools library and include path.
# Once done this will define
#
# NVTT_FOUND
# NVTT_INCLUDE_DIRS
# NVTT_LIBRARIES
#
# Created on 4/14/2017 by Stephen Birarda
# Copyright 2017 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
hifi_library_search_hints("nvtt")
find_path(NVTT_INCLUDE_DIRS nvtt/nvtt.h PATH_SUFFIXES include HINTS ${NVTT_SEARCH_DIRS})
find_library(NVTT_LIBRARY_RELEASE nvtt PATH_SUFFIXES "lib/static" "Release/x64" HINTS ${NVTT_SEARCH_DIRS})
find_library(NVTT_LIBRARY_DEBUG nvtt PATH_SUFFIXES "Debug/x64" HINTS ${NVTT_SEARCH_DIRS})
include(SelectLibraryConfigurations)
select_library_configurations(NVTT)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NVTT DEFAULT_MSG NVTT_INCLUDE_DIRS NVTT_LIBRARIES)

View file

@ -5,5 +5,6 @@ link_hifi_libraries(shared gpu)
target_glm()
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})