Cleanup cmake files.
This commit is contained in:
@ -122,9 +122,6 @@ FIND_PACKAGE(Qt4)
|
|||||||
# Threads
|
# Threads
|
||||||
FIND_PACKAGE(Threads)
|
FIND_PACKAGE(Threads)
|
||||||
|
|
||||||
# gconftool-2
|
|
||||||
FIND_PROGRAM(GCONFTOOL2 gconftool-2)
|
|
||||||
|
|
||||||
# configuration file
|
# configuration file
|
||||||
INCLUDE(CheckIncludeFiles)
|
INCLUDE(CheckIncludeFiles)
|
||||||
|
|
||||||
@ -136,7 +133,3 @@ CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H)
|
|||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nvconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/nvconfig.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nvconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/nvconfig.h)
|
||||||
|
|
||||||
IF(GCONFTOOL2)
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nvtt/tools/nvtt-thumbnailer.schema.in ${CMAKE_CURRENT_BINARY_DIR}/nvtt/tools/nvtt-thumbnailer.schema)
|
|
||||||
ENDIF(GCONFTOOL2)
|
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ ADD_SUBDIRECTORY(squish)
|
|||||||
SET(NVTT_SRCS
|
SET(NVTT_SRCS
|
||||||
nvtt.h
|
nvtt.h
|
||||||
nvtt.cpp
|
nvtt.cpp
|
||||||
Compressor.h
|
Context.h
|
||||||
Compressor.cpp
|
Context.cpp
|
||||||
nvtt_wrapper.h
|
nvtt_wrapper.h
|
||||||
nvtt_wrapper.cpp
|
nvtt_wrapper.cpp
|
||||||
CompressDXT.h
|
CompressDXT.h
|
||||||
@ -60,77 +60,5 @@ INSTALL(TARGETS nvtt
|
|||||||
INSTALL(FILES nvtt.h DESTINATION include/nvtt)
|
INSTALL(FILES nvtt.h DESTINATION include/nvtt)
|
||||||
|
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(tools)
|
||||||
# test executables
|
ADD_SUBDIRECTORY(tests)
|
||||||
ADD_EXECUTABLE(nvcompress tools/compress.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvcompress nvcore nvmath nvimage nvtt)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvdecompress tools/decompress.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvdecompress nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvddsinfo tools/ddsinfo.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvddsinfo nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvimgdiff tools/imgdiff.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvimgdiff nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvassemble tools/assemble.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvassemble nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(filtertest tests/filtertest.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(filtertest nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvtestsuite tests/stress.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvtestsuite nvcore nvmath nvimage nvtt)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvzoom tools/resize.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nvzoom nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(driverapitest tests/driverapi.cpp)
|
|
||||||
TARGET_LINK_LIBRARIES(driverapitest nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
INSTALL(TARGETS nvcompress nvdecompress nvddsinfo nvimgdiff nvassemble nvzoom nvtestsuite driverapitest DESTINATION bin)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nv-gnome-thumbnailer tools/thumbnailer.cpp tools/cmdline.h)
|
|
||||||
TARGET_LINK_LIBRARIES(nv-gnome-thumbnailer nvcore nvmath nvimage)
|
|
||||||
|
|
||||||
INSTALL(TARGETS nvcompress nvdecompress nvddsinfo nvimgdiff nvassemble nvzoom nvtestsuite nv-gnome-thumbnailer DESTINATION bin)
|
|
||||||
|
|
||||||
IF(GCONFTOOL2)
|
|
||||||
INSTALL(CODE "MESSAGE(STATUS \"Installing thumbnailer schema\")")
|
|
||||||
#gconftool-2 --get-default-source
|
|
||||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GCONFTOOL2} --get-default-source OUTPUT_VARIABLE GCONF_CONFIG_SOURCE OUTPUT_STRIP_TRAILING_WHITESPACE)")
|
|
||||||
INSTALL(CODE "set(ENV{GCONF_CONFIG_SOURCE} \"\${GCONF_CONFIG_SOURCE}\")")
|
|
||||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GCONFTOOL2} --makefile-install-rule ${CMAKE_CURRENT_BINARY_DIR}/tools/nvtt-thumbnailer.schema)")
|
|
||||||
ENDIF(GCONFTOOL2)
|
|
||||||
|
|
||||||
#include_directories("/usr/include/ffmpeg/")
|
|
||||||
#ADD_EXECUTABLE(nvmpegenc tools/mpegenc.cpp tools/cmdline.h)
|
|
||||||
#TARGET_LINK_LIBRARIES(nvmpegenc nvcore nvmath nvimage avcodec z)
|
|
||||||
#INSTALL(TARGETS nvmpegenc DESTINATION bin)
|
|
||||||
|
|
||||||
# UI tools
|
|
||||||
IF(QT4_FOUND) # AND NOT MSVC)
|
|
||||||
SET(QT_USE_QTOPENGL TRUE)
|
|
||||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
SET(SRCS
|
|
||||||
tools/ui/main.cpp
|
|
||||||
tools/ui/configdialog.h
|
|
||||||
tools/ui/configdialog.cpp)
|
|
||||||
|
|
||||||
SET(LIBS
|
|
||||||
nvtt
|
|
||||||
${QT_QTCORE_LIBRARY}
|
|
||||||
${QT_QTGUI_LIBRARY}
|
|
||||||
${QT_QTOPENGL_LIBRARY})
|
|
||||||
|
|
||||||
QT4_WRAP_UI(UICS tools/ui/configdialog.ui)
|
|
||||||
QT4_WRAP_CPP(MOCS tools/ui/configdialog.h)
|
|
||||||
#QT4_ADD_RESOURCES(RCCS tools/ui/configdialog.rc)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(nvcompressui MACOSX_BUNDLE ${SRCS} ${UICS} ${MOCS})
|
|
||||||
TARGET_LINK_LIBRARIES(nvcompressui ${LIBS})
|
|
||||||
|
|
||||||
ENDIF(QT4_FOUND) # AND NOT MSVC)
|
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
#include "Context.h"
|
||||||
|
|
||||||
#include <nvtt/nvtt.h>
|
#include <nvtt/nvtt.h>
|
||||||
|
|
||||||
#include <nvcore/Memory.h>
|
#include <nvcore/Memory.h>
|
||||||
@ -37,7 +39,6 @@
|
|||||||
#include <nvimage/PixelFormat.h>
|
#include <nvimage/PixelFormat.h>
|
||||||
#include <nvimage/ColorSpace.h>
|
#include <nvimage/ColorSpace.h>
|
||||||
|
|
||||||
#include "Compressor.h"
|
|
||||||
#include "InputOptions.h"
|
#include "InputOptions.h"
|
||||||
#include "CompressionOptions.h"
|
#include "CompressionOptions.h"
|
||||||
#include "OutputOptions.h"
|
#include "OutputOptions.h"
|
@ -339,7 +339,7 @@ namespace nvtt
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Texture compressor.
|
/// Context.
|
||||||
struct Compressor
|
struct Compressor
|
||||||
{
|
{
|
||||||
NVTT_FORBID_COPY(Compressor);
|
NVTT_FORBID_COPY(Compressor);
|
||||||
@ -360,6 +360,9 @@ namespace nvtt
|
|||||||
NVTT_API void outputCompressed(const Texture & tex, const OutputOptions & outputOptions);
|
NVTT_API void outputCompressed(const Texture & tex, const OutputOptions & outputOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// "Compressor" is deprecated. This should have been called "Context"
|
||||||
|
typedef Compressor Context;
|
||||||
|
|
||||||
|
|
||||||
/// Texture data.
|
/// Texture data.
|
||||||
struct Texture
|
struct Texture
|
||||||
|
20
src/nvtt/tests/CMakeLists.txt
Normal file
20
src/nvtt/tests/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
ADD_EXECUTABLE(filtertest filtertest.cpp ../tools/cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(filtertest nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvtestsuite stress.cpp)
|
||||||
|
TARGET_LINK_LIBRARIES(nvtestsuite nvcore nvmath nvimage nvtt)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(driverapitest driverapi.cpp)
|
||||||
|
TARGET_LINK_LIBRARIES(driverapitest nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(imperativeapi imperativeapi.cpp)
|
||||||
|
TARGET_LINK_LIBRARIES(imperativeapi nvcore nvmath nvimage nvtt)
|
||||||
|
|
||||||
|
INSTALL(TARGETS nvtestsuite driverapitest DESTINATION bin)
|
||||||
|
|
||||||
|
#include_directories("/usr/include/ffmpeg/")
|
||||||
|
#ADD_EXECUTABLE(nvmpegenc tools/mpegenc.cpp tools/cmdline.h)
|
||||||
|
#TARGET_LINK_LIBRARIES(nvmpegenc nvcore nvmath nvimage avcodec z)
|
||||||
|
#INSTALL(TARGETS nvmpegenc DESTINATION bin)
|
||||||
|
|
34
src/nvtt/tests/imperativeapi.cpp
Normal file
34
src/nvtt/tests/imperativeapi.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person
|
||||||
|
// obtaining a copy of this software and associated documentation
|
||||||
|
// files (the "Software"), to deal in the Software without
|
||||||
|
// restriction, including without limitation the rights to use,
|
||||||
|
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following
|
||||||
|
// conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be
|
||||||
|
// included in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
#include <nvtt/nvtt.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
//using namespace nv;
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -265,8 +265,8 @@ int main(int argc, char *argv[])
|
|||||||
MyOutputHandler outputHandler;
|
MyOutputHandler outputHandler;
|
||||||
outputOptions.setOutputHandler(&outputHandler);
|
outputOptions.setOutputHandler(&outputHandler);
|
||||||
|
|
||||||
nvtt::Compressor compressor;
|
nvtt::Context context;
|
||||||
compressor.enableCudaAcceleration(!nocuda);
|
context.enableCudaAcceleration(!nocuda);
|
||||||
|
|
||||||
FileSystem::createDirectory(outPath);
|
FileSystem::createDirectory(outPath);
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
clock_t start = clock();
|
clock_t start = clock();
|
||||||
|
|
||||||
compressor.process(inputOptions, compressionOptions, outputOptions);
|
context.process(inputOptions, compressionOptions, outputOptions);
|
||||||
|
|
||||||
clock_t end = clock();
|
clock_t end = clock();
|
||||||
printf(" Time: \t%.3f sec\n", float(end-start) / CLOCKS_PER_SEC);
|
printf(" Time: \t%.3f sec\n", float(end-start) / CLOCKS_PER_SEC);
|
||||||
|
63
src/nvtt/tools/CMakeLists.txt
Normal file
63
src/nvtt/tools/CMakeLists.txt
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvcompress compress.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvcompress nvcore nvmath nvimage nvtt)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvdecompress decompress.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvdecompress nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvddsinfo ddsinfo.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvddsinfo nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvimgdiff imgdiff.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvimgdiff nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvassemble assemble.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvassemble nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvzoom resize.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nvzoom nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nv-gnome-thumbnailer thumbnailer.cpp cmdline.h)
|
||||||
|
TARGET_LINK_LIBRARIES(nv-gnome-thumbnailer nvcore nvmath nvimage)
|
||||||
|
|
||||||
|
INSTALL(TARGETS nvcompress nvdecompress nvddsinfo nvimgdiff nvassemble nvzoom nv-gnome-thumbnailer DESTINATION bin)
|
||||||
|
|
||||||
|
# Use gconftool-2 to install gnome thumbnailer
|
||||||
|
FIND_PROGRAM(GCONFTOOL2 gconftool-2)
|
||||||
|
|
||||||
|
IF(GCONFTOOL2)
|
||||||
|
CONFIGURE_FILE(nvtt-thumbnailer.schema.in ${CMAKE_CURRENT_BINARY_DIR}/nvtt-thumbnailer.schema)
|
||||||
|
|
||||||
|
INSTALL(CODE "MESSAGE(STATUS \"Installing thumbnailer schema\")")
|
||||||
|
#gconftool-2 --get-default-source
|
||||||
|
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GCONFTOOL2} --get-default-source OUTPUT_VARIABLE GCONF_CONFIG_SOURCE OUTPUT_STRIP_TRAILING_WHITESPACE)")
|
||||||
|
INSTALL(CODE "set(ENV{GCONF_CONFIG_SOURCE} \"\${GCONF_CONFIG_SOURCE}\")")
|
||||||
|
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${GCONFTOOL2} --makefile-install-rule ${CMAKE_CURRENT_BINARY_DIR}/nvtt-thumbnailer.schema)")
|
||||||
|
ENDIF(GCONFTOOL2)
|
||||||
|
|
||||||
|
# UI tools
|
||||||
|
IF(QT4_FOUND) # AND NOT MSVC)
|
||||||
|
SET(QT_USE_QTOPENGL TRUE)
|
||||||
|
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
SET(SRCS
|
||||||
|
ui/main.cpp
|
||||||
|
ui/configdialog.h
|
||||||
|
ui/configdialog.cpp)
|
||||||
|
|
||||||
|
SET(LIBS
|
||||||
|
nvtt
|
||||||
|
${QT_QTCORE_LIBRARY}
|
||||||
|
${QT_QTGUI_LIBRARY}
|
||||||
|
${QT_QTOPENGL_LIBRARY})
|
||||||
|
|
||||||
|
QT4_WRAP_UI(UICS ui/configdialog.ui)
|
||||||
|
QT4_WRAP_CPP(MOCS ui/configdialog.h)
|
||||||
|
#QT4_ADD_RESOURCES(RCCS ui/configdialog.rc)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(nvcompressui MACOSX_BUNDLE ${SRCS} ${UICS} ${MOCS})
|
||||||
|
TARGET_LINK_LIBRARIES(nvcompressui ${LIBS})
|
||||||
|
|
||||||
|
ENDIF(QT4_FOUND) # AND NOT MSVC)
|
||||||
|
|
@ -491,11 +491,11 @@ int main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nvtt::Compressor compressor;
|
nvtt::Context context;
|
||||||
compressor.enableCudaAcceleration(!nocuda);
|
context.enableCudaAcceleration(!nocuda);
|
||||||
|
|
||||||
printf("CUDA acceleration ");
|
printf("CUDA acceleration ");
|
||||||
if (compressor.isCudaAccelerationEnabled())
|
if (context.isCudaAccelerationEnabled())
|
||||||
{
|
{
|
||||||
printf("ENABLED\n\n");
|
printf("ENABLED\n\n");
|
||||||
}
|
}
|
||||||
@ -504,7 +504,7 @@ int main(int argc, char *argv[])
|
|||||||
printf("DISABLED\n\n");
|
printf("DISABLED\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
outputHandler.setTotal(compressor.estimateSize(inputOptions, compressionOptions));
|
outputHandler.setTotal(context.estimateSize(inputOptions, compressionOptions));
|
||||||
outputHandler.setDisplayProgress(!silent);
|
outputHandler.setDisplayProgress(!silent);
|
||||||
|
|
||||||
nvtt::OutputOptions outputOptions;
|
nvtt::OutputOptions outputOptions;
|
||||||
@ -524,7 +524,7 @@ int main(int argc, char *argv[])
|
|||||||
Timer timer;
|
Timer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
||||||
bool success = compressor.process(inputOptions, compressionOptions, outputOptions);
|
bool success = context.process(inputOptions, compressionOptions, outputOptions);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user