91 lines
2.9 KiB
CMake
91 lines
2.9 KiB
CMake
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
|
||
PROJECT(NV)
|
||
ENABLE_TESTING()
|
||
|
||
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
|
||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
|
||
|
||
OPTION(SQUISH_FULL_LIBRARY "Makes the whole squish library compiled, instead of just what's needed in NVTT. Please be aware that this build path is not officially maintained." OFF)
|
||
MARK_AS_ADVANCED(SQUISH_FULL_LIBRARY)
|
||
OPTION(INSTALL_SQUISH "Install the (internal) squish library alongside NVTT binaries." OFF)
|
||
MARK_AS_ADVANCED(INSTALL_SQUISH)
|
||
OPTION(INSTALL_BC6H "Install the (internal) BC6H library alongside NVTT binaries." OFF)
|
||
MARK_AS_ADVANCED(INSTALL_BC6H)
|
||
OPTION(INSTALL_BC7 "Install the (internal) BC7 library alongside NVTT binaries." OFF)
|
||
MARK_AS_ADVANCED(INSTALL_BC7)
|
||
|
||
# GCC check (needs -std:c++11 flag)
|
||
if(CMAKE_COMPILER_IS_GNUCC)
|
||
ADD_DEFINITIONS("-std=c++11")
|
||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||
|
||
IF(WIN32)
|
||
# gnuwin32 paths:
|
||
SET(GNUWIN32_PATH "${NV_SOURCE_DIR}/extern/gnuwin32")
|
||
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${GNUWIN32_PATH}/include")
|
||
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${GNUWIN32_PATH}/lib")
|
||
|
||
# Set GLUT path:
|
||
SET(GLUT_ROOT_DIR "${NV_SOURCE_DIR}/extern/glut")
|
||
|
||
# Set FreeImage path:
|
||
SET(FREEIMAGE_ROOT_DIR "${NV_SOURCE_DIR}/extern/FreeImage")
|
||
|
||
ENDIF(WIN32)
|
||
|
||
INCLUDE(${NV_CMAKE_DIR}/OptimalOptions.cmake)
|
||
MESSAGE(STATUS "Setting optimal options")
|
||
MESSAGE(STATUS " Processor: ${NV_SYSTEM_PROCESSOR}")
|
||
MESSAGE(STATUS " Compiler Flags: ${CMAKE_CXX_FLAGS}")
|
||
|
||
IF(CMAKE_BUILD_TYPE MATCHES "debug")
|
||
SET(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "Postfix for debug build libraries.")
|
||
ENDIF()
|
||
|
||
|
||
IF(NVTT_SHARED)
|
||
SET(NVCORE_SHARED TRUE)
|
||
SET(NVMATH_SHARED TRUE)
|
||
SET(NVIMAGE_SHARED TRUE)
|
||
ENDIF(NVTT_SHARED)
|
||
|
||
ADD_SUBDIRECTORY(extern)
|
||
|
||
ADD_SUBDIRECTORY(src)
|
||
|
||
# These files should only be installed when creating packages.
|
||
INSTALL(FILES
|
||
LICENSE
|
||
README.md
|
||
ChangeLog
|
||
DESTINATION share/doc/nvtt)
|
||
|
||
# Add packaging support
|
||
INCLUDE(InstallRequiredSystemLibraries)
|
||
|
||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||
SET(CPACK_GENERATOR "TGZ;DEB")
|
||
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||
|
||
SET(CPACK_PACKAGE_NAME "nvidia-texture-tools")
|
||
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
|
||
SET(CPACK_PACKAGE_VERSION_MINOR "1")
|
||
SET(CPACK_PACKAGE_VERSION_PATCH "0")
|
||
SET(CPACK_PACKAGE_VERSION "2.1.0")
|
||
SET(CPACK_PACKAGE_CONTACT "Ignacio Casta<74>o <icastano@nvidia.com>")
|
||
SET(CPACK_PACKAGE_VENDOR "NVIDIA Corporation")
|
||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GPU-accelerated Texture Tools with support for DirectX 10 texture formats")
|
||
|
||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${NV_SOURCE_DIR}/README.md")
|
||
SET(CPACK_RESOURCE_FILE_LICENSE "${NV_SOURCE_DIR}/LICENSE")
|
||
|
||
# NSIS options:
|
||
IF(WIN32)
|
||
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_VENDOR}\\\\NVIDIA Texture Tools 2.1")
|
||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\NVIDIA Texture Tools 2.1")
|
||
SET(CPACK_PACKAGE_ICON "${NV_SOURCE_DIR}\\\\project\\\\vc8\\\\nvcompress\\\\nvidia.ico")
|
||
ENDIF(WIN32)
|
||
|
||
INCLUDE(CPack)
|
||
|