From fb7805d875922a829cf75b4b07f22c18a19fba48 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 18 Nov 2014 17:07:26 -0500 Subject: [PATCH] Bring CMake integration up to date. - Add a way to generate a FasTCConfig.cmake file so that you can use cmake without having to install it. - Add install paths for users that want to install it. - Hide all public headers in FasTC/ qualified include path, this way we know what files are public directly from the source. Also, it lets us define build-tree and install-tree include directories a lot easier. --- ASTCEncoder/CMakeLists.txt | 16 ++++- .../include/{ => FasTC}/ASTCCompressor.h | 2 +- ASTCEncoder/src/Decompressor.cpp | 10 +-- ASTCEncoder/src/IntegerEncoding.cpp | 12 ++-- ASTCEncoder/src/IntegerEncoding.h | 2 +- ASTCEncoder/src/Utils.h | 8 +-- ASTCEncoder/test/CMakeLists.txt | 1 + ASTCEncoder/test/TestASTCDecompression.cpp | 6 +- BPTCEncoder/CMakeLists.txt | 29 +++++--- .../include/{ => FasTC}/BPTCCompressor.h | 5 +- BPTCEncoder/include/{ => FasTC}/Shapes.h | 0 BPTCEncoder/src/CompressNVTT.cpp | 7 +- BPTCEncoder/src/Compressor.cpp | 16 +++-- BPTCEncoder/src/ParallelStage.h | 2 +- BPTCEncoder/src/RGBAEndpoints.cpp | 5 +- BPTCEncoder/src/RGBAEndpoints.h | 10 +-- Base/CMakeLists.txt | 60 ++++++++++------ .../{FasTCBaseConfig.h.in => BaseConfig.h.in} | 0 Base/include/{ => FasTC}/BitStream.h | 0 Base/include/{ => FasTC}/Bits.h | 0 Base/include/{ => FasTC}/Color.h | 0 Base/include/{ => FasTC}/CompressionFormat.h | 2 +- Base/include/{ => FasTC}/CompressionJob.h | 4 +- Base/include/{ => FasTC}/IPixel.h | 0 Base/include/{ => FasTC}/Image.h | 4 +- Base/include/{ => FasTC}/ImageFwd.h | 0 Base/include/{ => FasTC}/Matrix2x2.h | 0 Base/include/{ => FasTC}/Matrix3x3.h | 0 Base/include/{ => FasTC}/Matrix4x4.h | 0 Base/include/{ => FasTC}/MatrixBase.h | 0 Base/include/{ => FasTC}/MatrixSquare.h | 0 Base/include/{ => FasTC}/Pixel.h | 0 Base/include/{ => FasTC}/ScopedAllocator.h | 0 Base/include/{ => FasTC}/TexCompTypes.h | 2 +- Base/include/{ => FasTC}/Vector2.h | 0 Base/include/{ => FasTC}/Vector3.h | 0 Base/include/{ => FasTC}/Vector4.h | 0 Base/include/{ => FasTC}/VectorBase.h | 0 Base/src/Color.cpp | 2 +- Base/src/CompressionJob.cpp | 2 +- Base/src/IPixel.cpp | 4 +- Base/src/Image.cpp | 8 +-- Base/src/Pixel.cpp | 4 +- Base/test/TestBits.cpp | 2 +- Base/test/TestColor.cpp | 2 +- Base/test/TestImage.cpp | 6 +- Base/test/TestMatrix.cpp | 10 +-- Base/test/TestPixel.cpp | 2 +- Base/test/TestVector.cpp | 8 +-- Base/test/Utils.h | 2 +- CLTool/CMakeLists.txt | 5 +- CLTool/src/compare.cpp | 8 +-- CLTool/src/decomp.cpp | 8 +-- CLTool/src/tc.cpp | 8 +-- CMakeLists.txt | 63 ++++++++++++++++- CMakeModules/FasTCConfig.cmake.in | 29 ++++++++ CMakeModules/FasTCVersion.cmake.in | 11 +++ Core/CMakeLists.txt | 70 +++++++++++-------- Core/include/{ => FasTC}/CompressedImage.h | 6 +- Core/include/{ => FasTC}/ReferenceCounter.h | 0 Core/include/{ => FasTC}/StopWatch.h | 0 Core/include/{ => FasTC}/TexComp.h | 6 +- .../include/{ => FasTC}/ThreadSafeStreambuf.h | 0 Core/src/CompressedImage.cpp | 16 ++--- Core/src/CompressionFuncs.h | 2 +- Core/src/StopWatchOSX.cpp | 4 +- Core/src/StopWatchUnix.cpp | 4 +- Core/src/StopWatchWin32.cpp | 4 +- Core/src/TexComp.cpp | 17 ++--- Core/src/Thread.h | 2 +- Core/src/ThreadGroup.cpp | 2 +- Core/src/ThreadGroup.h | 3 +- Core/src/ThreadSafeStreambuf.cpp | 2 +- Core/src/WorkerQueue.cpp | 2 +- Core/src/WorkerQueue.h | 5 +- DXTEncoder/CMakeLists.txt | 25 ++++--- .../include/{ => FasTC}/DXTCompressor.h | 4 +- .../src/{DXTCompressor.cpp => Compressor.cpp} | 2 +- .../{DXTDecompressor.cpp => Decompressor.cpp} | 5 +- ETCEncoder/CMakeLists.txt | 21 ++++-- .../include/{ => FasTC}/ETCCompressor.h | 4 +- ETCEncoder/src/Compressor.cpp | 3 +- ETCEncoder/src/Decompressor.cpp | 3 +- IO/CMakeLists.txt | 37 ++++++---- IO/config/ImageLoader.h.in | 6 +- IO/config/ImageWriter.h.in | 4 +- IO/include/{ => FasTC}/FileStream.h | 2 +- IO/include/{ => FasTC}/ImageFile.h | 5 +- IO/include/{ => FasTC}/ImageFileFormat.h | 0 IO/src/FileStreamUnix.cpp | 2 +- IO/src/FileStreamWin32.cpp | 2 +- IO/src/ImageFile.cpp | 12 ++-- IO/src/ImageLoader.cpp | 4 +- IO/src/ImageLoaderASTC.cpp | 10 +-- IO/src/ImageLoaderASTC.h | 2 +- IO/src/ImageLoaderKTX.cpp | 8 +-- IO/src/ImageLoaderKTX.h | 4 +- IO/src/ImageLoaderPNG.h | 2 +- IO/src/ImageLoaderPVR.cpp | 2 +- IO/src/ImageLoaderPVR.h | 2 +- IO/src/ImageLoaderTGA.cpp | 2 +- IO/src/ImageLoaderTGA.h | 2 +- IO/src/ImageWriter.cpp | 4 +- IO/src/ImageWriterKTX.cpp | 7 +- IO/src/ImageWriterKTX.h | 4 +- IO/src/ImageWriterPNG.cpp | 4 +- IO/src/ImageWriterPNG.h | 4 +- PVRTCEncoder/CMakeLists.txt | 23 ++++-- .../include/{ => FasTC}/PVRTCCompressor.h | 4 +- PVRTCEncoder/src/Block.h | 4 +- PVRTCEncoder/src/Compressor.cpp | 7 +- PVRTCEncoder/src/CompressorPVRLib.cpp | 2 +- PVRTCEncoder/src/Decompressor.cpp | 5 +- PVRTCEncoder/src/PVRTCImage.cpp | 2 +- PVRTCEncoder/src/PVRTCImage.h | 7 +- PVRTCEncoder/test/CMakeLists.txt | 4 +- PVRTCEncoder/test/DecompTestPVR.cpp | 2 +- PVRTCEncoder/test/DecompressorTest.cpp | 2 +- PVRTCEncoder/test/ImageTest.cpp | 2 +- PVRTCEncoder/test/TestUtils.h | 2 +- 120 files changed, 500 insertions(+), 296 deletions(-) rename ASTCEncoder/include/{ => FasTC}/ASTCCompressor.h (98%) rename BPTCEncoder/include/{ => FasTC}/BPTCCompressor.h (99%) rename BPTCEncoder/include/{ => FasTC}/Shapes.h (100%) rename Base/config/{FasTCBaseConfig.h.in => BaseConfig.h.in} (100%) rename Base/include/{ => FasTC}/BitStream.h (100%) rename Base/include/{ => FasTC}/Bits.h (100%) rename Base/include/{ => FasTC}/Color.h (100%) rename Base/include/{ => FasTC}/CompressionFormat.h (99%) rename Base/include/{ => FasTC}/CompressionJob.h (99%) rename Base/include/{ => FasTC}/IPixel.h (100%) rename Base/include/{ => FasTC}/Image.h (98%) rename Base/include/{ => FasTC}/ImageFwd.h (100%) rename Base/include/{ => FasTC}/Matrix2x2.h (100%) rename Base/include/{ => FasTC}/Matrix3x3.h (100%) rename Base/include/{ => FasTC}/Matrix4x4.h (100%) rename Base/include/{ => FasTC}/MatrixBase.h (100%) rename Base/include/{ => FasTC}/MatrixSquare.h (100%) rename Base/include/{ => FasTC}/Pixel.h (100%) rename Base/include/{ => FasTC}/ScopedAllocator.h (100%) rename Base/include/{ => FasTC}/TexCompTypes.h (99%) rename Base/include/{ => FasTC}/Vector2.h (100%) rename Base/include/{ => FasTC}/Vector3.h (100%) rename Base/include/{ => FasTC}/Vector4.h (100%) rename Base/include/{ => FasTC}/VectorBase.h (100%) create mode 100644 CMakeModules/FasTCConfig.cmake.in create mode 100644 CMakeModules/FasTCVersion.cmake.in rename Core/include/{ => FasTC}/CompressedImage.h (97%) rename Core/include/{ => FasTC}/ReferenceCounter.h (100%) rename Core/include/{ => FasTC}/StopWatch.h (100%) rename Core/include/{ => FasTC}/TexComp.h (98%) rename Core/include/{ => FasTC}/ThreadSafeStreambuf.h (100%) rename DXTEncoder/include/{ => FasTC}/DXTCompressor.h (91%) rename DXTEncoder/src/{DXTCompressor.cpp => Compressor.cpp} (97%) rename DXTEncoder/src/{DXTDecompressor.cpp => Decompressor.cpp} (95%) rename ETCEncoder/include/{ => FasTC}/ETCCompressor.h (97%) rename IO/include/{ => FasTC}/FileStream.h (99%) rename IO/include/{ => FasTC}/ImageFile.h (98%) rename IO/include/{ => FasTC}/ImageFileFormat.h (100%) rename PVRTCEncoder/include/{ => FasTC}/PVRTCCompressor.h (98%) diff --git a/ASTCEncoder/CMakeLists.txt b/ASTCEncoder/CMakeLists.txt index e25e836..c7e978f 100644 --- a/ASTCEncoder/CMakeLists.txt +++ b/ASTCEncoder/CMakeLists.txt @@ -51,12 +51,15 @@ INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/ASTCEncoder/include) INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/ASTCEncoder/include) - INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) +SET( LIBRARY_HEADERS + "include/FasTC/ASTCCompressor.h" +) + SET( HEADERS - include/ASTCCompressor.h + ${LIBRARY_HEADERS} src/IntegerEncoding.h ) @@ -75,5 +78,12 @@ ADD_LIBRARY( ASTCEncoder ${SOURCES} ) +INSTALL( + TARGETS ASTCEncoder + EXPORT FasTCTargets + ARCHIVE DESTINATION lib COMPONENT lib) +INSTALL( + FILES ${LIBRARY_HEADERS} + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC COMPONENT dev) + TARGET_LINK_LIBRARIES( ASTCEncoder FasTCBase ) -TARGET_LINK_LIBRARIES( ASTCEncoder FasTCIO ) diff --git a/ASTCEncoder/include/ASTCCompressor.h b/ASTCEncoder/include/FasTC/ASTCCompressor.h similarity index 98% rename from ASTCEncoder/include/ASTCCompressor.h rename to ASTCEncoder/include/FasTC/ASTCCompressor.h index 1ff3baf..27c2854 100644 --- a/ASTCEncoder/include/ASTCCompressor.h +++ b/ASTCEncoder/include/FasTC/ASTCCompressor.h @@ -53,7 +53,7 @@ #ifndef ASTCENCODER_INCLUDE_ASTCCOMPRESSOR_H_ #define ASTCENCODER_INCLUDE_ASTCCOMPRESSOR_H_ -#include "CompressionJob.h" +#include "FasTC/CompressionJob.h" namespace ASTCC { diff --git a/ASTCEncoder/src/Decompressor.cpp b/ASTCEncoder/src/Decompressor.cpp index c0d9b75..ced4592 100644 --- a/ASTCEncoder/src/Decompressor.cpp +++ b/ASTCEncoder/src/Decompressor.cpp @@ -50,7 +50,7 @@ * */ -#include "ASTCCompressor.h" +#include "FasTC/ASTCCompressor.h" #include #include @@ -60,13 +60,13 @@ #include "Utils.h" #include "IntegerEncoding.h" -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" -#include "Bits.h" -#include "BitStream.h" +#include "FasTC/Bits.h" +#include "FasTC/BitStream.h" using FasTC::BitStreamReadOnly; -#include "Pixel.h" +#include "FasTC/Pixel.h" namespace ASTCC { diff --git a/ASTCEncoder/src/IntegerEncoding.cpp b/ASTCEncoder/src/IntegerEncoding.cpp index 48026d1..330405b 100644 --- a/ASTCEncoder/src/IntegerEncoding.cpp +++ b/ASTCEncoder/src/IntegerEncoding.cpp @@ -50,22 +50,22 @@ * */ -#include "ASTCCompressor.h" +#include "FasTC/ASTCCompressor.h" #include #include #include #include -#include "Utils.h" -#include "IntegerEncoding.h" - -#include "Bits.h" +#include "FasTC/Bits.h" using FasTC::Bits; -#include "BitStream.h" +#include "FasTC/BitStream.h" using FasTC::BitStreamReadOnly; +#include "Utils.h" +#include "IntegerEncoding.h" + namespace ASTCC { // Returns the number of bits required to encode nVals values. diff --git a/ASTCEncoder/src/IntegerEncoding.h b/ASTCEncoder/src/IntegerEncoding.h index 6a7e2d1..1700ca4 100644 --- a/ASTCEncoder/src/IntegerEncoding.h +++ b/ASTCEncoder/src/IntegerEncoding.h @@ -53,7 +53,7 @@ #ifndef _ASTCENCODER_SRC_INTEGERENCODING_H_ #define _ASTCENCODER_SRC_INTEGERENCODING_H_ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" // Forward declares namespace FasTC { diff --git a/ASTCEncoder/src/Utils.h b/ASTCEncoder/src/Utils.h index f10b7ab..52cb261 100644 --- a/ASTCEncoder/src/Utils.h +++ b/ASTCEncoder/src/Utils.h @@ -53,11 +53,11 @@ #ifndef ASTCENCODER_SRC_UTILS_H_ #define ASTCENCODER_SRC_UTILS_H_ -#include "ASTCCompressor.h" +#include "FasTC/ASTCCompressor.h" -#include "TexCompTypes.h" -#include "CompressionFormat.h" -#include "Pixel.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/CompressionFormat.h" +#include "FasTC/Pixel.h" namespace ASTCC { diff --git a/ASTCEncoder/test/CMakeLists.txt b/ASTCEncoder/test/CMakeLists.txt index 4856238..4159140 100644 --- a/ASTCEncoder/test/CMakeLists.txt +++ b/ASTCEncoder/test/CMakeLists.txt @@ -105,6 +105,7 @@ ENDFOREACH() INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include ) INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include ) INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include ) # HACK for MSVC 2012... IF(MSVC) diff --git a/ASTCEncoder/test/TestASTCDecompression.cpp b/ASTCEncoder/test/TestASTCDecompression.cpp index 789c017..9ba6b6a 100644 --- a/ASTCEncoder/test/TestASTCDecompression.cpp +++ b/ASTCEncoder/test/TestASTCDecompression.cpp @@ -53,10 +53,10 @@ #include "gtest/gtest.h" // This is our library header -#include "ASTCCompressor.h" +#include "FasTC/ASTCCompressor.h" -#include "ImageFile.h" -#include "Image.h" +#include "FasTC/ImageFile.h" +#include "FasTC/Image.h" #include diff --git a/BPTCEncoder/CMakeLists.txt b/BPTCEncoder/CMakeLists.txt index 738b03c..4b24a8e 100644 --- a/BPTCEncoder/CMakeLists.txt +++ b/BPTCEncoder/CMakeLists.txt @@ -40,12 +40,6 @@ # # -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) - -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/BPTCEncoder/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/BPTCEncoder/include) - IF(NOT "" STREQUAL "${AVPCLLIB_ROOT}") INCLUDE_DIRECTORIES(${AVPCLLIB_INCLUDE_DIR}) SET(FOUND_NVTT_BPTC_EXPORT TRUE) @@ -100,16 +94,20 @@ ENDIF() CONFIGURE_FILE( "config/BPTCConfig.h.in" - "include/BPTCConfig.h" + "include/FasTC/BPTCConfig.h" +) + +SET(LIBRARY_HEADERS + "include/FasTC/BPTCCompressor.h" + "include/FasTC/Shapes.h" ) SET( HEADERS config/BPTCConfig.h.in - include/BPTCCompressor.h - include/Shapes.h src/CompressionMode.h src/RGBAEndpoints.h src/ParallelStage.h + ${LIBRARY_HEADERS} ) SET( SOURCES @@ -162,11 +160,24 @@ IF(NOT "" STREQUAL "${AVPCLLIB_ROOT}") ) ENDIF() +SET(BPTC_INCLUDES_DIR ${FasTC_BINARY_DIR}/BPTCEncoder/include/FasTC) + +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/BPTCEncoder/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/BPTCEncoder/include) + ADD_LIBRARY( BPTCEncoder ${HEADERS} ${SOURCES} ) +INSTALL(TARGETS BPTCEncoder EXPORT FasTCTargets ARCHIVE DESTINATION lib COMPONENT lib) +INSTALL( + FILES ${LIBRARY_HEADERS} "${BPTC_INCLUDES_DIR}/BPTCConfig.h" + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC + COMPONENT dev) + TARGET_LINK_LIBRARIES( BPTCEncoder FasTCBase ) IF(NOT "" STREQUAL "${AVPCLLIB_ROOT}") diff --git a/BPTCEncoder/include/BPTCCompressor.h b/BPTCEncoder/include/FasTC/BPTCCompressor.h similarity index 99% rename from BPTCEncoder/include/BPTCCompressor.h rename to BPTCEncoder/include/FasTC/BPTCCompressor.h index b37a4a3..13014f6 100755 --- a/BPTCEncoder/include/BPTCCompressor.h +++ b/BPTCEncoder/include/FasTC/BPTCCompressor.h @@ -76,8 +76,9 @@ #ifndef BPTCENCODER_INCLUDE_BPTCCOMPRESSOR_H_ #define BPTCENCODER_INCLUDE_BPTCCOMPRESSOR_H_ -#include "BPTCConfig.h" -#include "CompressionJob.h" +#include "FasTC/CompressionJob.h" + +#include "FasTC/BPTCConfig.h" #include diff --git a/BPTCEncoder/include/Shapes.h b/BPTCEncoder/include/FasTC/Shapes.h similarity index 100% rename from BPTCEncoder/include/Shapes.h rename to BPTCEncoder/include/FasTC/Shapes.h diff --git a/BPTCEncoder/src/CompressNVTT.cpp b/BPTCEncoder/src/CompressNVTT.cpp index d7737e9..055a329 100644 --- a/BPTCEncoder/src/CompressNVTT.cpp +++ b/BPTCEncoder/src/CompressNVTT.cpp @@ -50,11 +50,12 @@ * */ -#include "BPTCCompressor.h" +#include "FasTC/BPTCCompressor.h" + #include "CompressionMode.h" #undef DBL_MAX -#include "BitStream.h" -#include "TexCompTypes.h" +#include "FasTC/BitStream.h" +#include "FasTC/TexCompTypes.h" #include #include diff --git a/BPTCEncoder/src/Compressor.cpp b/BPTCEncoder/src/Compressor.cpp index 2c8d928..465c313 100755 --- a/BPTCEncoder/src/Compressor.cpp +++ b/BPTCEncoder/src/Compressor.cpp @@ -73,18 +73,20 @@ // //------------------------------------------------------------------------------ -#include "BPTCCompressor.h" -#include "CompressionMode.h" +#include "FasTC/BPTCCompressor.h" -#include "TexCompTypes.h" -#include "BCLookupTables.h" -#include "RGBAEndpoints.h" -#include "Shapes.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/BitStream.h" -#include "BitStream.h" using FasTC::BitStream; using FasTC::BitStreamReadOnly; +#include "FasTC/Shapes.h" + +#include "CompressionMode.h" +#include "BCLookupTables.h" +#include "RGBAEndpoints.h" + #ifdef HAS_MSVC_ATOMICS # include "Windows.h" #endif diff --git a/BPTCEncoder/src/ParallelStage.h b/BPTCEncoder/src/ParallelStage.h index 6e9c892..8a8a027 100644 --- a/BPTCEncoder/src/ParallelStage.h +++ b/BPTCEncoder/src/ParallelStage.h @@ -50,7 +50,7 @@ * */ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" enum BPTCParallelStage { eParallelStage_Uniform, diff --git a/BPTCEncoder/src/RGBAEndpoints.cpp b/BPTCEncoder/src/RGBAEndpoints.cpp index 18041da..20ba9a2 100755 --- a/BPTCEncoder/src/RGBAEndpoints.cpp +++ b/BPTCEncoder/src/RGBAEndpoints.cpp @@ -73,9 +73,10 @@ // //------------------------------------------------------------------------------ -#include "BPTCConfig.h" +#include "FasTC/BPTCConfig.h" +#include "FasTC/BPTCCompressor.h" + #include "RGBAEndpoints.h" -#include "BPTCCompressor.h" #include "CompressionMode.h" #include diff --git a/BPTCEncoder/src/RGBAEndpoints.h b/BPTCEncoder/src/RGBAEndpoints.h index 786b6a7..4fea068 100755 --- a/BPTCEncoder/src/RGBAEndpoints.h +++ b/BPTCEncoder/src/RGBAEndpoints.h @@ -66,9 +66,11 @@ #ifndef __RGBA_ENDPOINTS_H__ #define __RGBA_ENDPOINTS_H__ -#include "TexCompTypes.h" -#include "Vector4.h" -#include "Matrix4x4.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/Vector4.h" +#include "FasTC/Matrix4x4.h" + +#include "FasTC/Shapes.h" #include #include @@ -77,8 +79,6 @@ #include #include -#include "Shapes.h" - static const uint32 kNumColorChannels = 4; static const uint32 kMaxNumDataPoints = 16; diff --git a/Base/CMakeLists.txt b/Base/CMakeLists.txt index a9d7629..9cbe4ea 100644 --- a/Base/CMakeLists.txt +++ b/Base/CMakeLists.txt @@ -67,8 +67,8 @@ CHECK_CXX_SOURCE_COMPILES(" ) CONFIGURE_FILE( - "config/FasTCBaseConfig.h.in" - "include/FasTCBaseConfig.h" + "config/BaseConfig.h.in" + "include/FasTC/BaseConfig.h" ) SET( SOURCES @@ -79,34 +79,50 @@ SET( SOURCES "src/Color.cpp" ) +SET( LIBRARY_HEADERS + "include/FasTC/Image.h" + "include/FasTC/ImageFwd.h" + "include/FasTC/Pixel.h" + "include/FasTC/TexCompTypes.h" + "include/FasTC/CompressionFormat.h" + "include/FasTC/CompressionJob.h" + "include/FasTC/IPixel.h" + "include/FasTC/Color.h" + "include/FasTC/Bits.h" + "include/FasTC/BitStream.h" + "include/FasTC/MatrixBase.h" + "include/FasTC/MatrixSquare.h" + "include/FasTC/Matrix3x3.h" + "include/FasTC/Matrix4x4.h" + "include/FasTC/ScopedAllocator.h" + "include/FasTC/VectorBase.h" + "include/FasTC/Vector2.h" + "include/FasTC/Vector3.h" + "include/FasTC/Vector4.h") + SET( HEADERS - "include/Bits.h" - "include/BitStream.h" - "include/Color.h" - "include/CompressionJob.h" - "config/FasTCBaseConfig.h.in" - "include/IPixel.h" - "include/Image.h" - "include/MatrixBase.h" - "include/MatrixSquare.h" - "include/Matrix3x3.h" - "include/Pixel.h" - "include/ScopedAllocator.h" - "include/TexCompTypes.h" - "include/VectorBase.h" - "include/Vector2.h" - "include/Vector3.h" - "include/Vector4.h" + ${LIBRARY_HEADERS} + "${FasTC_BINARY_DIR}/Base/include/FasTC/BaseConfig.h" + "config/BaseConfig.h.in" ) INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) ADD_LIBRARY( FasTCBase - ${HEADERS} - ${SOURCES} + ${HEADERS} + ${SOURCES} ) +INSTALL( + TARGETS FasTCBase + EXPORT FasTCTargets + ARCHIVE DESTINATION lib COMPONENT lib) + +INSTALL( + FILES ${LIBRARY_HEADERS} "${FasTC_BINARY_DIR}/Base/include/FasTC/BaseConfig.h" + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC COMPONENT dev) + IF( NOT WIN32 AND NOT APPLE ) - TARGET_LINK_LIBRARIES( FasTCBase rt ) + TARGET_LINK_LIBRARIES( FasTCBase rt ) ENDIF() diff --git a/Base/config/FasTCBaseConfig.h.in b/Base/config/BaseConfig.h.in similarity index 100% rename from Base/config/FasTCBaseConfig.h.in rename to Base/config/BaseConfig.h.in diff --git a/Base/include/BitStream.h b/Base/include/FasTC/BitStream.h similarity index 100% rename from Base/include/BitStream.h rename to Base/include/FasTC/BitStream.h diff --git a/Base/include/Bits.h b/Base/include/FasTC/Bits.h similarity index 100% rename from Base/include/Bits.h rename to Base/include/FasTC/Bits.h diff --git a/Base/include/Color.h b/Base/include/FasTC/Color.h similarity index 100% rename from Base/include/Color.h rename to Base/include/FasTC/Color.h diff --git a/Base/include/CompressionFormat.h b/Base/include/FasTC/CompressionFormat.h similarity index 99% rename from Base/include/CompressionFormat.h rename to Base/include/FasTC/CompressionFormat.h index 03e42be..03e26a6 100644 --- a/Base/include/CompressionFormat.h +++ b/Base/include/FasTC/CompressionFormat.h @@ -53,7 +53,7 @@ #ifndef _BASE_INCLUDE_COMPRESSIONFORMAT_H_ #define _BASE_INCLUDE_COMPRESSIONFORMAT_H_ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" namespace FasTC { diff --git a/Base/include/CompressionJob.h b/Base/include/FasTC/CompressionJob.h similarity index 99% rename from Base/include/CompressionJob.h rename to Base/include/FasTC/CompressionJob.h index d9ef8e6..c9d9da1 100755 --- a/Base/include/CompressionJob.h +++ b/Base/include/FasTC/CompressionJob.h @@ -53,8 +53,8 @@ #ifndef __COMPRESSION_JOBS_H__ #define __COMPRESSION_JOBS_H__ -#include "TexCompTypes.h" -#include "CompressionFormat.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/CompressionFormat.h" #ifdef _MSC_VER # define ALIGN(x) __declspec( align(x) ) diff --git a/Base/include/IPixel.h b/Base/include/FasTC/IPixel.h similarity index 100% rename from Base/include/IPixel.h rename to Base/include/FasTC/IPixel.h diff --git a/Base/include/Image.h b/Base/include/FasTC/Image.h similarity index 98% rename from Base/include/Image.h rename to Base/include/FasTC/Image.h index 1cddb8b..6554604 100644 --- a/Base/include/Image.h +++ b/Base/include/FasTC/Image.h @@ -44,8 +44,8 @@ #ifndef FASTC_BASE_INCLUDE_IMAGE_H_ #define FASTC_BASE_INCLUDE_IMAGE_H_ -#include "TexCompTypes.h" -#include "ImageFwd.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/ImageFwd.h" namespace FasTC { diff --git a/Base/include/ImageFwd.h b/Base/include/FasTC/ImageFwd.h similarity index 100% rename from Base/include/ImageFwd.h rename to Base/include/FasTC/ImageFwd.h diff --git a/Base/include/Matrix2x2.h b/Base/include/FasTC/Matrix2x2.h similarity index 100% rename from Base/include/Matrix2x2.h rename to Base/include/FasTC/Matrix2x2.h diff --git a/Base/include/Matrix3x3.h b/Base/include/FasTC/Matrix3x3.h similarity index 100% rename from Base/include/Matrix3x3.h rename to Base/include/FasTC/Matrix3x3.h diff --git a/Base/include/Matrix4x4.h b/Base/include/FasTC/Matrix4x4.h similarity index 100% rename from Base/include/Matrix4x4.h rename to Base/include/FasTC/Matrix4x4.h diff --git a/Base/include/MatrixBase.h b/Base/include/FasTC/MatrixBase.h similarity index 100% rename from Base/include/MatrixBase.h rename to Base/include/FasTC/MatrixBase.h diff --git a/Base/include/MatrixSquare.h b/Base/include/FasTC/MatrixSquare.h similarity index 100% rename from Base/include/MatrixSquare.h rename to Base/include/FasTC/MatrixSquare.h diff --git a/Base/include/Pixel.h b/Base/include/FasTC/Pixel.h similarity index 100% rename from Base/include/Pixel.h rename to Base/include/FasTC/Pixel.h diff --git a/Base/include/ScopedAllocator.h b/Base/include/FasTC/ScopedAllocator.h similarity index 100% rename from Base/include/ScopedAllocator.h rename to Base/include/FasTC/ScopedAllocator.h diff --git a/Base/include/TexCompTypes.h b/Base/include/FasTC/TexCompTypes.h similarity index 99% rename from Base/include/TexCompTypes.h rename to Base/include/FasTC/TexCompTypes.h index 779c91b..b49e2fe 100644 --- a/Base/include/TexCompTypes.h +++ b/Base/include/FasTC/TexCompTypes.h @@ -57,7 +57,7 @@ #ifndef _TEX_COMP_TYPES_H_ #define _TEX_COMP_TYPES_H_ -#include "FasTCBaseConfig.h" +#include "FasTC/BaseConfig.h" // Do we support C++11? #ifdef FASTC_BASE_HAS_CPP11_TYPES diff --git a/Base/include/Vector2.h b/Base/include/FasTC/Vector2.h similarity index 100% rename from Base/include/Vector2.h rename to Base/include/FasTC/Vector2.h diff --git a/Base/include/Vector3.h b/Base/include/FasTC/Vector3.h similarity index 100% rename from Base/include/Vector3.h rename to Base/include/FasTC/Vector3.h diff --git a/Base/include/Vector4.h b/Base/include/FasTC/Vector4.h similarity index 100% rename from Base/include/Vector4.h rename to Base/include/FasTC/Vector4.h diff --git a/Base/include/VectorBase.h b/Base/include/FasTC/VectorBase.h similarity index 100% rename from Base/include/VectorBase.h rename to Base/include/FasTC/VectorBase.h diff --git a/Base/src/Color.cpp b/Base/src/Color.cpp index 5db3b89..854e1e0 100644 --- a/Base/src/Color.cpp +++ b/Base/src/Color.cpp @@ -50,7 +50,7 @@ * */ -#include "Color.h" +#include "FasTC/Color.h" namespace FasTC { diff --git a/Base/src/CompressionJob.cpp b/Base/src/CompressionJob.cpp index 9ef2f34..9755cd1 100755 --- a/Base/src/CompressionJob.cpp +++ b/Base/src/CompressionJob.cpp @@ -41,7 +41,7 @@ * */ -#include "CompressionJob.h" +#include "FasTC/CompressionJob.h" #include #include diff --git a/Base/src/IPixel.cpp b/Base/src/IPixel.cpp index 78e5ae3..b0bb22a 100644 --- a/Base/src/IPixel.cpp +++ b/Base/src/IPixel.cpp @@ -50,8 +50,8 @@ * */ -#include "Pixel.h" -#include "IPixel.h" +#include "FasTC/Pixel.h" +#include "FasTC/IPixel.h" namespace FasTC { diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index 7240e7a..681b97d 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -41,7 +41,7 @@ * */ -#include "Image.h" +#include "FasTC/Image.h" #include #include @@ -50,9 +50,9 @@ #include #include -#include "Color.h" -#include "Pixel.h" -#include "IPixel.h" +#include "FasTC/Color.h" +#include "FasTC/Pixel.h" +#include "FasTC/IPixel.h" template static inline T sad( const T &a, const T &b ) { diff --git a/Base/src/Pixel.cpp b/Base/src/Pixel.cpp index 0ee8a87..f332a5e 100644 --- a/Base/src/Pixel.cpp +++ b/Base/src/Pixel.cpp @@ -50,13 +50,13 @@ * */ -#include "Pixel.h" +#include "FasTC/Pixel.h" #include #include #include -#include "Bits.h" +#include "FasTC/Bits.h" template static inline T Clamp(const T &v, const T &_min, const T &_max) { diff --git a/Base/test/TestBits.cpp b/Base/test/TestBits.cpp index 3f3b94a..789cf05 100644 --- a/Base/test/TestBits.cpp +++ b/Base/test/TestBits.cpp @@ -51,7 +51,7 @@ */ #include "gtest/gtest.h" -#include "Bits.h" +#include "FasTC/Bits.h" TEST(Bits, Replicate) { uint32 xv = 3; diff --git a/Base/test/TestColor.cpp b/Base/test/TestColor.cpp index f4920db..8bcfe92 100644 --- a/Base/test/TestColor.cpp +++ b/Base/test/TestColor.cpp @@ -51,7 +51,7 @@ */ #include "gtest/gtest.h" -#include "Color.h" +#include "FasTC/Color.h" static const float kEpsilon = 1e-6f; diff --git a/Base/test/TestImage.cpp b/Base/test/TestImage.cpp index 3a63b13..a874a31 100644 --- a/Base/test/TestImage.cpp +++ b/Base/test/TestImage.cpp @@ -51,9 +51,9 @@ */ #include "gtest/gtest.h" -#include "Image.h" -#include "IPixel.h" -#include "Pixel.h" +#include "FasTC/Image.h" +#include "FasTC/IPixel.h" +#include "FasTC/Pixel.h" #include "Utils.h" #include diff --git a/Base/test/TestMatrix.cpp b/Base/test/TestMatrix.cpp index dbd51c9..eac946e 100644 --- a/Base/test/TestMatrix.cpp +++ b/Base/test/TestMatrix.cpp @@ -51,7 +51,7 @@ */ #include "gtest/gtest.h" -#include "MatrixBase.h" +#include "FasTC/MatrixBase.h" static const float kEpsilon = 1e-6f; @@ -221,7 +221,7 @@ TEST(MatrixBase, VectorMultiplication) { //////////////////////////////////////////////////////////////////////////////// -#include "MatrixSquare.h" +#include "FasTC/MatrixSquare.h" TEST(MatrixSquare, Constructors) { FasTC::MatrixBase m; @@ -262,7 +262,7 @@ TEST(MatrixSquare, PowerMethod) { //////////////////////////////////////////////////////////////////////////////// -#include "Matrix2x2.h" +#include "FasTC/Matrix2x2.h" TEST(Matrix2x2, Constructors) { FasTC::MatrixBase m; @@ -292,7 +292,7 @@ TEST(Matrix2x2, Constructors) { //////////////////////////////////////////////////////////////////////////////// -#include "Matrix3x3.h" +#include "FasTC/Matrix3x3.h" TEST(Matrix3x3, Constructors) { FasTC::MatrixBase m; @@ -323,7 +323,7 @@ TEST(Matrix3x3, Constructors) { //////////////////////////////////////////////////////////////////////////////// -#include "Matrix4x4.h" +#include "FasTC/Matrix4x4.h" TEST(Matrix4x4, Constructors) { FasTC::MatrixBase m; diff --git a/Base/test/TestPixel.cpp b/Base/test/TestPixel.cpp index 71a3be3..6218dd6 100644 --- a/Base/test/TestPixel.cpp +++ b/Base/test/TestPixel.cpp @@ -51,7 +51,7 @@ */ #include "gtest/gtest.h" -#include "Pixel.h" +#include "FasTC/Pixel.h" TEST(Pixel, DefaultConstructor) { FasTC::Pixel p; diff --git a/Base/test/TestVector.cpp b/Base/test/TestVector.cpp index e66b660..2c6d46c 100644 --- a/Base/test/TestVector.cpp +++ b/Base/test/TestVector.cpp @@ -51,7 +51,7 @@ */ #include "gtest/gtest.h" -#include "VectorBase.h" +#include "FasTC/VectorBase.h" static const float kEpsilon = 1e-6f; @@ -249,7 +249,7 @@ TEST(VectorBase, Addition) { // //////////////////////////////////////////////////////////////////////////////// -#include "Vector2.h" +#include "FasTC/Vector2.h" TEST(Vector2, BaseFunctionality) { FasTC::Vec2f v2f; @@ -307,7 +307,7 @@ TEST(Vector2, Swizzle) { // //////////////////////////////////////////////////////////////////////////////// -#include "Vector3.h" +#include "FasTC/Vector3.h" TEST(Vector3, BaseFunctionality) { FasTC::Vec3f vf; @@ -393,7 +393,7 @@ TEST(Vector3, CrossProduct) { // //////////////////////////////////////////////////////////////////////////////// -#include "Vector4.h" +#include "FasTC/Vector4.h" TEST(Vector4, BaseFunctionality) { FasTC::Vec4f vf; diff --git a/Base/test/Utils.h b/Base/test/Utils.h index 9c371d3..bab4c3e 100644 --- a/Base/test/Utils.h +++ b/Base/test/Utils.h @@ -53,7 +53,7 @@ #ifndef PVRTCENCODER_TEST_TESTUTILS_H_ #define PVRTCENCODER_TEST_TESTUTILS_H_ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" class PixelPrinter { private: diff --git a/CLTool/CMakeLists.txt b/CLTool/CMakeLists.txt index be2d66a..4dd9e1a 100644 --- a/CLTool/CMakeLists.txt +++ b/CLTool/CMakeLists.txt @@ -76,5 +76,8 @@ TARGET_LINK_LIBRARIES( tc FasTCCore ) TARGET_LINK_LIBRARIES( compare FasTCBase ) TARGET_LINK_LIBRARIES( compare FasTCIO ) -TARGET_LINK_LIBRARIES( compare FasTCBase ) +TARGET_LINK_LIBRARIES( decomp FasTCBase ) TARGET_LINK_LIBRARIES( decomp FasTCIO ) + +INSTALL(TARGETS tc compare decomp EXPORT FasTCTargets + RUNTIME DESTINATION bin COMPONENT bin) diff --git a/CLTool/src/compare.cpp b/CLTool/src/compare.cpp index 46c91db..4ed6f79 100644 --- a/CLTool/src/compare.cpp +++ b/CLTool/src/compare.cpp @@ -54,10 +54,10 @@ # include #endif -#include "Image.h" -#include "ImageFile.h" -#include "TexComp.h" -#include "ThreadSafeStreambuf.h" +#include "FasTC/Image.h" +#include "FasTC/ImageFile.h" +#include "FasTC/TexComp.h" +#include "FasTC/ThreadSafeStreambuf.h" int main(int argc, char **argv) { if(argc != 3) { diff --git a/CLTool/src/decomp.cpp b/CLTool/src/decomp.cpp index e808acf..b694f3d 100644 --- a/CLTool/src/decomp.cpp +++ b/CLTool/src/decomp.cpp @@ -54,10 +54,10 @@ # include #endif -#include "Image.h" -#include "ImageFile.h" -#include "TexComp.h" -#include "ThreadSafeStreambuf.h" +#include "FasTC/Image.h" +#include "FasTC/ImageFile.h" +#include "FasTC/TexComp.h" +#include "FasTC/ThreadSafeStreambuf.h" void PrintUsage() { fprintf(stderr, "Usage: decomp \n"); diff --git a/CLTool/src/tc.cpp b/CLTool/src/tc.cpp index cbfd14e..d5942ed 100644 --- a/CLTool/src/tc.cpp +++ b/CLTool/src/tc.cpp @@ -67,10 +67,10 @@ # undef max #endif -#include "Image.h" -#include "ImageFile.h" -#include "TexComp.h" -#include "ThreadSafeStreambuf.h" +#include "FasTC/Image.h" +#include "FasTC/ImageFile.h" +#include "FasTC/TexComp.h" +#include "FasTC/ThreadSafeStreambuf.h" void PrintUsage() { fprintf(stderr, "Usage: tc [OPTIONS] imagefile\n"); diff --git a/CMakeLists.txt b/CMakeLists.txt index b8865ec..086c5bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,12 @@ # CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) -PROJECT(FasTC) +PROJECT(FasTC CXX C) + +SET(FasTC_MAJOR_VERSION 0) +SET(FasTC_MINOR_VERSION 0) +SET(FasTC_PATCH_VERSION 1) +SET(FasTC_VERSION ${FasTC_MAJOR_VERSION}.${FasTC_MINOR_VERSION}.${FasTC_PATCH_VERSION}) OPTION(TREAT_WARNINGS_AS_ERRORS "Treat compiler warnings as errors. We use the highest warnings levels for compilers." OFF) @@ -104,6 +109,16 @@ SET(CMAKE_MODULE_PATH "${FasTC_SOURCE_DIR}/CMakeModules" ${CMAKE_MODULE_PATH}) FIND_PACKAGE(PVRTexLib) FIND_PACKAGE(BC7Export) +###################################################################### +## +## Package definitions +## +###################################################################### + +SET(INCLUDE_INSTALL_DIR include CACHE INTERNAL "") +SET(LIB_INSTALL_DIR lib CACHE INTERNAL "") +SET(BIN_INSTALL_DIR bin CACHE INTERNAL "") + SET(FASTC_DIRECTORIES Base Core IO BPTCEncoder PVRTCEncoder DXTEncoder ETCEncoder ASTCEncoder ) @@ -111,12 +126,56 @@ SET(FASTC_DIRECTORIES FOREACH(DIR ${FASTC_DIRECTORIES}) ADD_SUBDIRECTORY(${DIR}) ENDFOREACH() +ADD_SUBDIRECTORY(CLTool) + +SET(FasTC_LIBRARIES FasTCBase FasTCIO FasTCCore BPTCEncoder PVRTCEncoder DXTEncoder ETCEncoder ASTCEncoder) +SET(FasTC_EXECUTABLES tc compare decomp) + +###################################################################### +## +## Config +## +###################################################################### + +INCLUDE(CMakePackageConfigHelpers) +CONFIGURE_PACKAGE_CONFIG_FILE( + "${FasTC_SOURCE_DIR}/CMakeModules/FasTCConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/FasTCConfig.cmake" + INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/FasTC + PATH_VARS INCLUDE_INSTALL_DIR BIN_INSTALL_DIR LIB_INSTALL_DIR) + +WRITE_BASIC_PACKAGE_VERSION_FILE( + "${CMAKE_CURRENT_BINARY_DIR}/FasTCConfigVersion.cmake" + VERSION ${FasTC_VERSION} + COMPATIBILITY SameMajorVersion) + +INSTALL( + FILES "${CMAKE_CURRENT_BINARY_DIR}/FasTCConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/FasTCConfig.cmake" + DESTINATION ${LIB_INSTALL_DIR}/cmake/FasTC + COMPONENT dev) + +EXPORT( + TARGETS ${FasTC_LIBRARIES} ${FasTC_EXECUTABLES} + FILE "${CMAKE_CURRENT_BINARY_DIR}/FasTCTargets.cmake") +EXPORT(PACKAGE FasTC) + +INSTALL( + EXPORT FasTCTargets + FILE FasTCTargets.cmake + DESTINATION ${LIB_INSTALL_DIR}/cmake/FasTC) + +###################################################################### +## +## Testing +## +###################################################################### ENABLE_TESTING() IF(MSVC) SET(gtest_force_shared_crt TRUE) ENDIF(MSVC) + ADD_SUBDIRECTORY(GTest) FOREACH(DIR ${FASTC_DIRECTORIES}) SET(TESTDIR ${FasTC_SOURCE_DIR}/${DIR}/test) @@ -124,5 +183,3 @@ FOREACH(DIR ${FASTC_DIRECTORIES}) ADD_SUBDIRECTORY(${TESTDIR}) ENDIF() ENDFOREACH() - -ADD_SUBDIRECTORY(CLTool) diff --git a/CMakeModules/FasTCConfig.cmake.in b/CMakeModules/FasTCConfig.cmake.in new file mode 100644 index 0000000..71f0264 --- /dev/null +++ b/CMakeModules/FasTCConfig.cmake.in @@ -0,0 +1,29 @@ +SET(FASTC_VERSION @FasTC_VERSION@) + +@PACKAGE_INIT@ + +SET(FasTC_LIBRARIES FasTCBase FasTCIO FasTCCore BPTCEncoder PVRTCEncoder DXTEncoder ETCEncoder ASTCEncoder) + +IF(NOT TARGET FasTCBase) + # We're coming from a build tree -- include all of the targets + # from the project and try to make sure that our includes are set properly + INCLUDE("${CMAKE_CURRENT_LIST_DIR}/FasTCTargets.cmake") + + FOREACH(LIB ${FasTC_LIBRARIES}) + STRING(REPLACE "FasTC" "" DIR "${LIB}") + SET(CURRENT_DIR "${CMAKE_CURRENT_LIST_DIR}/${DIR}/include") + IF( EXISTS "${CURRENT_DIR}/" ) + SET(FasTC_INCLUDE_DIRS ${FasTC_INCLUDE_DIRS} ${CURRENT_DIR}) + ENDIF() + ENDFOREACH() + + SET(FasTC_EXECUTABLES tc compare decomp) + +ELSE() + + # This is an install tree -- everything should be a lot easier.... + SET_AND_CHECK(FasTC_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@/FasTC") + SET_AND_CHECK(FasTC_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@") + SET_AND_CHECK(FasTC_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@") + +ENDIF() diff --git a/CMakeModules/FasTCVersion.cmake.in b/CMakeModules/FasTCVersion.cmake.in new file mode 100644 index 0000000..0055512 --- /dev/null +++ b/CMakeModules/FasTCVersion.cmake.in @@ -0,0 +1,11 @@ +SET(PACKAGE_VERSION "@FasTC_VERSION@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() \ No newline at end of file diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 551b8ec..e164723 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -49,23 +49,25 @@ # # -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Base/include ) -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Base/include ) - SET( SOURCES - "src/TexComp.cpp" - "src/CompressedImage.cpp" + "src/TexComp.cpp" + "src/CompressedImage.cpp" +) + +SET( LIBRARY_HEADERS + "include/FasTC/CompressedImage.h" + "include/FasTC/ReferenceCounter.h" + "include/FasTC/StopWatch.h" + "include/FasTC/TexComp.h" + "include/FasTC/ThreadSafeStreambuf.h" ) SET( HEADERS - "include/TexComp.h" - "include/CompressedImage.h" - "src/CompressionFuncs.h" + ${LIBRARY_HEADERS} + "src/CompressionFuncs.h" ) # Make sure to add the appropriate stopwatch files... -SET( HEADERS ${HEADERS} "include/StopWatch.h" ) - IF( WIN32 ) SET( SOURCES ${SOURCES} "src/StopWatchWin32.cpp" ) ELSEIF( APPLE ) @@ -77,23 +79,6 @@ ELSE() SET( LINK_FLAGS -lrt ${LINK_FLAGS} ) ENDIF() -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR} ) - -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ASTCEncoder/include ) -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ETCEncoder/include ) -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/DXTEncoder/include ) - -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/PVRTCEncoder/include ) -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/PVRTCEncoder/include) - -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/BPTCEncoder/include ) -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/BPTCEncoder/include ) - -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include ) -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include ) - -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include ) - ###### Find Threads.... IF( MSVC ) SET( SOURCES ${SOURCES} "src/ThreadWin32.cpp" ) @@ -106,8 +91,8 @@ ELSE() ENDIF() ENDIF() +# Add internal sources SET( HEADERS ${HEADERS} "src/Thread.h" ) -SET( HEADERS ${HEADERS} "include/ThreadSafeStreambuf.h" ) SET( HEADERS ${HEADERS} "src/ThreadGroup.h" ) SET( HEADERS ${HEADERS} "src/WorkerQueue.h" ) @@ -116,11 +101,40 @@ SET( SOURCES ${SOURCES} "src/Thread.cpp" ) SET( SOURCES ${SOURCES} "src/ThreadGroup.cpp" ) SET( SOURCES ${SOURCES} "src/WorkerQueue.cpp" ) +# Dependencies... +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Base/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Base/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include ) + +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ASTCEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/ASTCEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ETCEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/ETCEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/DXTEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/DXTEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/PVRTCEncoder/include) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/PVRTCEncoder/include) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/BPTCEncoder/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/BPTCEncoder/include ) + ADD_LIBRARY( FasTCCore ${HEADERS} ${SOURCES} ) +INSTALL( + TARGETS FasTCCore + EXPORT FasTCTargets + ARCHIVE DESTINATION lib COMPONENT lib +) + +INSTALL( + FILES ${LIBRARY_HEADERS} + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC COMPONENT dev) + TARGET_LINK_LIBRARIES( FasTCCore FasTCBase ) TARGET_LINK_LIBRARIES( FasTCCore FasTCIO ) TARGET_LINK_LIBRARIES( FasTCCore ETCEncoder ) diff --git a/Core/include/CompressedImage.h b/Core/include/FasTC/CompressedImage.h similarity index 97% rename from Core/include/CompressedImage.h rename to Core/include/FasTC/CompressedImage.h index 71f8fbf..fc2d881 100644 --- a/Core/include/CompressedImage.h +++ b/Core/include/FasTC/CompressedImage.h @@ -44,9 +44,9 @@ #ifndef _COMPRESSED_IMAGE_H_ #define _COMPRESSED_IMAGE_H_ -#include "TexCompTypes.h" -#include "CompressionFormat.h" -#include "Image.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/CompressionFormat.h" +#include "FasTC/Image.h" class CompressedImage : public FasTC::Image { private: diff --git a/Core/include/ReferenceCounter.h b/Core/include/FasTC/ReferenceCounter.h similarity index 100% rename from Core/include/ReferenceCounter.h rename to Core/include/FasTC/ReferenceCounter.h diff --git a/Core/include/StopWatch.h b/Core/include/FasTC/StopWatch.h similarity index 100% rename from Core/include/StopWatch.h rename to Core/include/FasTC/StopWatch.h diff --git a/Core/include/TexComp.h b/Core/include/FasTC/TexComp.h similarity index 98% rename from Core/include/TexComp.h rename to Core/include/FasTC/TexComp.h index 7eede5e..f15d559 100644 --- a/Core/include/TexComp.h +++ b/Core/include/FasTC/TexComp.h @@ -44,11 +44,11 @@ #ifndef _TEX_COMP_H_ #define _TEX_COMP_H_ -#include "CompressedImage.h" -#include "CompressionJob.h" +#include "FasTC/CompressedImage.h" +#include "FasTC/CompressionJob.h" #include -#include "ImageFwd.h" +#include "FasTC/ImageFwd.h" // Forward declarations class ImageFile; diff --git a/Core/include/ThreadSafeStreambuf.h b/Core/include/FasTC/ThreadSafeStreambuf.h similarity index 100% rename from Core/include/ThreadSafeStreambuf.h rename to Core/include/FasTC/ThreadSafeStreambuf.h diff --git a/Core/src/CompressedImage.cpp b/Core/src/CompressedImage.cpp index 097dd94..b48b503 100644 --- a/Core/src/CompressedImage.cpp +++ b/Core/src/CompressedImage.cpp @@ -50,21 +50,21 @@ * */ -#include "CompressedImage.h" +#include "FasTC/CompressedImage.h" #include #include #include #include -#include "Pixel.h" +#include "FasTC/Pixel.h" -#include "TexCompTypes.h" -#include "BPTCCompressor.h" -#include "PVRTCCompressor.h" -#include "DXTCompressor.h" -#include "ETCCompressor.h" -#include "ASTCCompressor.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/BPTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" +#include "FasTC/DXTCompressor.h" +#include "FasTC/ETCCompressor.h" +#include "FasTC/ASTCCompressor.h" using FasTC::CompressionJob; using FasTC::DecompressionJob; diff --git a/Core/src/CompressionFuncs.h b/Core/src/CompressionFuncs.h index 265757a..a9fc6f7 100644 --- a/Core/src/CompressionFuncs.h +++ b/Core/src/CompressionFuncs.h @@ -53,7 +53,7 @@ #ifndef CORE_SRC_COMPRESSIONFUNCS_H_ #define CORE_SRC_COMPRESSIONFUNCS_H_ -#include "CompressionJob.h" +#include "FasTC/CompressionJob.h" #include // A compression function format. It takes the raw data and image dimensions and diff --git a/Core/src/StopWatchOSX.cpp b/Core/src/StopWatchOSX.cpp index 063828a..5955161 100644 --- a/Core/src/StopWatchOSX.cpp +++ b/Core/src/StopWatchOSX.cpp @@ -41,8 +41,8 @@ * */ -#include "StopWatch.h" -#include "TexCompTypes.h" +#include "FasTC/StopWatch.h" +#include "FasTC/TexCompTypes.h" #include #include diff --git a/Core/src/StopWatchUnix.cpp b/Core/src/StopWatchUnix.cpp index 4b17f6b..b80830f 100644 --- a/Core/src/StopWatchUnix.cpp +++ b/Core/src/StopWatchUnix.cpp @@ -41,8 +41,8 @@ * */ -#include "StopWatch.h" -#include "TexCompTypes.h" +#include "FasTC/StopWatch.h" +#include "FasTC/TexCompTypes.h" #include #include diff --git a/Core/src/StopWatchWin32.cpp b/Core/src/StopWatchWin32.cpp index 245fff1..da66815 100755 --- a/Core/src/StopWatchWin32.cpp +++ b/Core/src/StopWatchWin32.cpp @@ -63,8 +63,8 @@ // //-------------------------------------------------------------------------------------- -#include "StopWatch.h" -#include "TexCompTypes.h" +#include "FasTC/StopWatch.h" +#include "FasTC/TexCompTypes.h" #include #include diff --git a/Core/src/TexComp.cpp b/Core/src/TexComp.cpp index 0a4d92a..fb0f286 100644 --- a/Core/src/TexComp.cpp +++ b/Core/src/TexComp.cpp @@ -41,7 +41,7 @@ * */ -#include "TexComp.h" +#include "FasTC/TexComp.h" #include #include @@ -50,14 +50,15 @@ #include #include -#include "BPTCCompressor.h" -#include "CompressionFormat.h" +#include "FasTC/BPTCCompressor.h" +#include "FasTC/CompressionFormat.h" +#include "FasTC/DXTCompressor.h" +#include "FasTC/ETCCompressor.h" +#include "FasTC/ImageFile.h" +#include "FasTC/Pixel.h" +#include "FasTC/PVRTCCompressor.h" + #include "CompressionFuncs.h" -#include "DXTCompressor.h" -#include "ETCCompressor.h" -#include "ImageFile.h" -#include "Pixel.h" -#include "PVRTCCompressor.h" #include "Thread.h" #include "ThreadGroup.h" #include "WorkerQueue.h" diff --git a/Core/src/Thread.h b/Core/src/Thread.h index 392f43e..3de80b9 100644 --- a/Core/src/Thread.h +++ b/Core/src/Thread.h @@ -44,7 +44,7 @@ #ifndef __TEX_COMP_THREAD_H__ #define __TEX_COMP_THREAD_H__ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" //!HACK! Apparently MSVC has issues with Yield()...???? #ifdef _MSC_VER diff --git a/Core/src/ThreadGroup.cpp b/Core/src/ThreadGroup.cpp index 4b90a46..6d1de5a 100644 --- a/Core/src/ThreadGroup.cpp +++ b/Core/src/ThreadGroup.cpp @@ -42,7 +42,7 @@ */ #include "ThreadGroup.h" -#include "BPTCCompressor.h" +#include "FasTC/BPTCCompressor.h" #include #include diff --git a/Core/src/ThreadGroup.h b/Core/src/ThreadGroup.h index 3956444..571ab3e 100644 --- a/Core/src/ThreadGroup.h +++ b/Core/src/ThreadGroup.h @@ -44,9 +44,10 @@ #ifndef _THREAD_GROUP_H_ #define _THREAD_GROUP_H_ +#include "FasTC/StopWatch.h" + #include "CompressionFuncs.h" #include "Thread.h" -#include "StopWatch.h" #include diff --git a/Core/src/ThreadSafeStreambuf.cpp b/Core/src/ThreadSafeStreambuf.cpp index 89316ce..2cff1d0 100644 --- a/Core/src/ThreadSafeStreambuf.cpp +++ b/Core/src/ThreadSafeStreambuf.cpp @@ -50,7 +50,7 @@ * */ -#include "ThreadSafeStreambuf.h" +#include "FasTC/ThreadSafeStreambuf.h" #include #include diff --git a/Core/src/WorkerQueue.cpp b/Core/src/WorkerQueue.cpp index a5e9b81..2938e76 100644 --- a/Core/src/WorkerQueue.cpp +++ b/Core/src/WorkerQueue.cpp @@ -49,7 +49,7 @@ #include #include -#include "BPTCCompressor.h" +#include "FasTC/BPTCCompressor.h" using FasTC::CompressionJob; diff --git a/Core/src/WorkerQueue.h b/Core/src/WorkerQueue.h index b5067f9..75fdec7 100644 --- a/Core/src/WorkerQueue.h +++ b/Core/src/WorkerQueue.h @@ -48,9 +48,10 @@ class WorkerQueue; // Necessary includes... -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/StopWatch.h" + #include "Thread.h" -#include "StopWatch.h" #include "CompressionFuncs.h" #include diff --git a/DXTEncoder/CMakeLists.txt b/DXTEncoder/CMakeLists.txt index 015bd96..d8d3ff9 100755 --- a/DXTEncoder/CMakeLists.txt +++ b/DXTEncoder/CMakeLists.txt @@ -40,24 +40,29 @@ # # -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) - -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/DXTEncoder/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/DXTEncoder/include) - -SET( HEADERS - include/DXTCompressor.h +SET( LIBRARY_HEADERS + "include/FasTC/DXTCompressor.h" ) SET( SOURCES - src/DXTCompressor.cpp - src/DXTDecompressor.cpp + "src/Compressor.cpp" + "src/Decompressor.cpp" ) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/DXTEncoder/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/DXTEncoder/include) + ADD_LIBRARY( DXTEncoder ${HEADERS} ${SOURCES} ) +INSTALL(TARGETS DXTEncoder EXPORT FasTCTargets ARCHIVE DESTINATION lib COMPONENT lib) +INSTALL( + FILES ${LIBRARY_HEADERS} + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC + COMPONENT dev) + TARGET_LINK_LIBRARIES( DXTEncoder FasTCBase ) diff --git a/DXTEncoder/include/DXTCompressor.h b/DXTEncoder/include/FasTC/DXTCompressor.h similarity index 91% rename from DXTEncoder/include/DXTCompressor.h rename to DXTEncoder/include/FasTC/DXTCompressor.h index cf8dedc..897eb41 100755 --- a/DXTEncoder/include/DXTCompressor.h +++ b/DXTEncoder/include/FasTC/DXTCompressor.h @@ -10,8 +10,8 @@ Lesser General Public License for more details. */ -#include "TexCompTypes.h" -#include "CompressionJob.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/CompressionJob.h" namespace DXTC { diff --git a/DXTEncoder/src/DXTCompressor.cpp b/DXTEncoder/src/Compressor.cpp similarity index 97% rename from DXTEncoder/src/DXTCompressor.cpp rename to DXTEncoder/src/Compressor.cpp index 2f1ccd1..c5c1d7c 100755 --- a/DXTEncoder/src/DXTCompressor.cpp +++ b/DXTEncoder/src/Compressor.cpp @@ -13,7 +13,7 @@ // Refer to "Real-Time DXT Compression" by J.M.P. van Waveren for a more thorough discussion of the // algorithms used in this code. -#include "DXTCompressor.h" +#include "FasTC/DXTCompressor.h" #include #include #include diff --git a/DXTEncoder/src/DXTDecompressor.cpp b/DXTEncoder/src/Decompressor.cpp similarity index 95% rename from DXTEncoder/src/DXTDecompressor.cpp rename to DXTEncoder/src/Decompressor.cpp index 2d57e13..46ed919 100644 --- a/DXTEncoder/src/DXTDecompressor.cpp +++ b/DXTEncoder/src/Decompressor.cpp @@ -50,12 +50,13 @@ * */ -#include "DXTCompressor.h" +#include "FasTC/DXTCompressor.h" + #include #include #include -#include "Pixel.h" +#include "FasTC/Pixel.h" namespace DXTC { diff --git a/ETCEncoder/CMakeLists.txt b/ETCEncoder/CMakeLists.txt index f23bc82..2f4cd05 100644 --- a/ETCEncoder/CMakeLists.txt +++ b/ETCEncoder/CMakeLists.txt @@ -40,14 +40,12 @@ # # -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) - -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/ETCEncoder/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/ETCEncoder/include) +SET( LIBRARY_HEADERS + "include/FasTC/ETCCompressor.h" +) SET( HEADERS - include/ETCCompressor.h + ${LIBRARY_HEADERS} src/rg_etc1.h ) @@ -57,9 +55,20 @@ SET( SOURCES src/rg_etc1.cpp ) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/ETCEncoder/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/ETCEncoder/include) + ADD_LIBRARY( ETCEncoder ${HEADERS} ${SOURCES} ) +INSTALL(TARGETS ETCEncoder EXPORT FasTCTargets ARCHIVE DESTINATION lib COMPONENT lib) +INSTALL( + FILES ${LIBRARY_HEADERS} + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC + COMPONENT dev) + TARGET_LINK_LIBRARIES( ETCEncoder FasTCBase ) diff --git a/ETCEncoder/include/ETCCompressor.h b/ETCEncoder/include/FasTC/ETCCompressor.h similarity index 97% rename from ETCEncoder/include/ETCCompressor.h rename to ETCEncoder/include/FasTC/ETCCompressor.h index 6ce210d..c628ebb 100644 --- a/ETCEncoder/include/ETCCompressor.h +++ b/ETCEncoder/include/FasTC/ETCCompressor.h @@ -53,8 +53,8 @@ #ifndef ETCENCODER_INCLUDE_ETCCOMPRESSOR_H_ #define ETCENCODER_INCLUDE_ETCCOMPRESSOR_H_ -#include "CompressionJob.h" -#include "TexCompTypes.h" +#include "FasTC/CompressionJob.h" +#include "FasTC/TexCompTypes.h" namespace ETCC { diff --git a/ETCEncoder/src/Compressor.cpp b/ETCEncoder/src/Compressor.cpp index 5afbb14..9393fc1 100644 --- a/ETCEncoder/src/Compressor.cpp +++ b/ETCEncoder/src/Compressor.cpp @@ -50,8 +50,9 @@ * */ +#include "FasTC/ETCCompressor.h" + #include "rg_etc1.h" -#include "ETCCompressor.h" #include #include diff --git a/ETCEncoder/src/Decompressor.cpp b/ETCEncoder/src/Decompressor.cpp index 92c8b93..c196b0a 100644 --- a/ETCEncoder/src/Decompressor.cpp +++ b/ETCEncoder/src/Decompressor.cpp @@ -50,8 +50,9 @@ * */ +#include "FasTC/ETCCompressor.h" + #include "rg_etc1.h" -#include "ETCCompressor.h" namespace ETCC { diff --git a/IO/CMakeLists.txt b/IO/CMakeLists.txt index 0c5c6da..87e89e5 100644 --- a/IO/CMakeLists.txt +++ b/IO/CMakeLists.txt @@ -40,23 +40,22 @@ # # -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Base/include ) -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Base/include) - -INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include ) -INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include ) - SET( SOURCES "src/ImageWriter.cpp" "src/ImageLoader.cpp" "src/ImageFile.cpp" ) +SET( LIBRARY_HEADERS + "include/FasTC/ImageFile.h" + "include/FasTC/ImageFileFormat.h" + "include/FasTC/FileStream.h" +) + SET( HEADERS "config/ImageWriter.h.in" "config/ImageLoader.h.in" - "include/ImageFile.h" - "include/FileStream.h" + ${LIBRARY_HEADERS} ) IF( WIN32 ) @@ -111,20 +110,32 @@ ENDIF(OPENGL_FOUND) CONFIGURE_FILE( "config/ImageLoader.h.in" - "include/ImageLoader.h" + "include/FasTC/ImageLoader.h" ) CONFIGURE_FILE( "config/ImageWriter.h.in" - "include/ImageWriter.h" + "include/FasTC/ImageWriter.h" ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Base/include) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Base/include) INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/include ) +INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/IO/include ) -ADD_LIBRARY(FasTCIO - ${SOURCES} - ${HEADERS} +ADD_LIBRARY(FasTCIO ${SOURCES} ${HEADERS}) + +INSTALL(TARGETS FasTCIO EXPORT FasTCTargets ARCHIVE DESTINATION lib COMPONENT lib) +SET(EXPORT_HEADERS + ${LIBRARY_HEADERS} + "${FasTC_BINARY_DIR}/IO/include/FasTC/ImageWriter.h" + "${FasTC_BINARY_DIR}/IO/include/FasTC/ImageLoader.h" ) +INSTALL( + FILES ${EXPORT_HEADERS} + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC COMPONENT dev) TARGET_LINK_LIBRARIES( FasTCIO FasTCBase ) TARGET_LINK_LIBRARIES( FasTCIO FasTCCore ) diff --git a/IO/config/ImageLoader.h.in b/IO/config/ImageLoader.h.in index 8273087..f44b281 100644 --- a/IO/config/ImageLoader.h.in +++ b/IO/config/ImageLoader.h.in @@ -44,9 +44,9 @@ #ifndef _IMAGE_LOADER_H_ #define _IMAGE_LOADER_H_ -#include "ImageFileFormat.h" -#include "TexCompTypes.h" -#include "ImageFwd.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/ImageFwd.h" +#include "FasTC/ImageFileFormat.h" class ImageLoader { diff --git a/IO/config/ImageWriter.h.in b/IO/config/ImageWriter.h.in index 60ea2a4..62eb099 100644 --- a/IO/config/ImageWriter.h.in +++ b/IO/config/ImageWriter.h.in @@ -44,8 +44,8 @@ #ifndef _IMAGE_WRITER_H_ #define _IMAGE_WRITER_H_ -#include "ImageFileFormat.h" -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/ImageFileFormat.h" namespace FasTC { class Pixel; diff --git a/IO/include/FileStream.h b/IO/include/FasTC/FileStream.h similarity index 99% rename from IO/include/FileStream.h rename to IO/include/FasTC/FileStream.h index 58caef5..e0954d0 100644 --- a/IO/include/FileStream.h +++ b/IO/include/FasTC/FileStream.h @@ -44,7 +44,7 @@ #ifndef __FILE_STREAM_H__ #define __FILE_STREAM_H__ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" enum EFileMode { eFileMode_Read, diff --git a/IO/include/ImageFile.h b/IO/include/FasTC/ImageFile.h similarity index 98% rename from IO/include/ImageFile.h rename to IO/include/FasTC/ImageFile.h index 033f51b..d5c7976 100644 --- a/IO/include/ImageFile.h +++ b/IO/include/FasTC/ImageFile.h @@ -44,9 +44,10 @@ #ifndef _IMAGE_FILE_H_ #define _IMAGE_FILE_H_ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/ImageFwd.h" + #include "ImageFileFormat.h" -#include "ImageFwd.h" // Forward declare class CompressedImage; diff --git a/IO/include/ImageFileFormat.h b/IO/include/FasTC/ImageFileFormat.h similarity index 100% rename from IO/include/ImageFileFormat.h rename to IO/include/FasTC/ImageFileFormat.h diff --git a/IO/src/FileStreamUnix.cpp b/IO/src/FileStreamUnix.cpp index 775175a..81de191 100644 --- a/IO/src/FileStreamUnix.cpp +++ b/IO/src/FileStreamUnix.cpp @@ -41,7 +41,7 @@ * */ -#include "FileStream.h" +#include "FasTC/FileStream.h" #include #include diff --git a/IO/src/FileStreamWin32.cpp b/IO/src/FileStreamWin32.cpp index 5042eb6..63e165b 100755 --- a/IO/src/FileStreamWin32.cpp +++ b/IO/src/FileStreamWin32.cpp @@ -50,7 +50,7 @@ * */ -#include "FileStream.h" +#include "FasTC/FileStream.h" #define _CRT_SECURE_NO_WARNINGS #define WIN32_LEAN_AND_MEAN diff --git a/IO/src/ImageFile.cpp b/IO/src/ImageFile.cpp index 36298c1..f18dd4f 100644 --- a/IO/src/ImageFile.cpp +++ b/IO/src/ImageFile.cpp @@ -41,7 +41,7 @@ * */ -#include "ImageFile.h" +#include "FasTC/ImageFile.h" #include #include @@ -50,11 +50,11 @@ #include #include -#include "ImageWriter.h" -#include "ImageLoader.h" -#include "CompressedImage.h" -#include "Image.h" -#include "FileStream.h" +#include "FasTC/ImageWriter.h" +#include "FasTC/ImageLoader.h" +#include "FasTC/CompressedImage.h" +#include "FasTC/Image.h" +#include "FasTC/FileStream.h" #ifdef PNG_FOUND # include "ImageLoaderPNG.h" diff --git a/IO/src/ImageLoader.cpp b/IO/src/ImageLoader.cpp index 5349263..06b0baf 100644 --- a/IO/src/ImageLoader.cpp +++ b/IO/src/ImageLoader.cpp @@ -41,14 +41,14 @@ * */ -#include "ImageLoader.h" +#include "FasTC/ImageLoader.h" +#include "FasTC/Image.h" #include #include #include #include -#include "Image.h" /////////////////////////////////////////////////////////////////////////////// // // Static helper functions diff --git a/IO/src/ImageLoaderASTC.cpp b/IO/src/ImageLoaderASTC.cpp index ebf81c0..caf3309 100644 --- a/IO/src/ImageLoaderASTC.cpp +++ b/IO/src/ImageLoaderASTC.cpp @@ -58,13 +58,13 @@ #include #include -#include "TexCompTypes.h" -#include "CompressionFormat.h" -#include "ScopedAllocator.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/Image.h" +#include "FasTC/CompressionFormat.h" +#include "FasTC/ScopedAllocator.h" #include "GLDefines.h" -#include "Image.h" -#include "CompressedImage.h" +#include "FasTC/CompressedImage.h" static bool GetFormatForBlockDimensions(FasTC::ECompressionFormat &out, uint32 blockWidth, uint32 blockHeight) { diff --git a/IO/src/ImageLoaderASTC.h b/IO/src/ImageLoaderASTC.h index 529e1b8..2ddac1b 100644 --- a/IO/src/ImageLoaderASTC.h +++ b/IO/src/ImageLoaderASTC.h @@ -53,7 +53,7 @@ #ifndef _IO_SRC_IMAGE_LOADER_ASTC_H_ #define _IO_SRC_IMAGE_LOADER_ASTC_H_ -#include "ImageLoader.h" +#include "FasTC/ImageLoader.h" class ImageLoaderASTC : public ImageLoader { private: diff --git a/IO/src/ImageLoaderKTX.cpp b/IO/src/ImageLoaderKTX.cpp index 20ddc34..f4ce1d5 100644 --- a/IO/src/ImageLoaderKTX.cpp +++ b/IO/src/ImageLoaderKTX.cpp @@ -58,12 +58,12 @@ #include #include -#include "TexCompTypes.h" -#include "ScopedAllocator.h" +#include "FasTC/Image.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/CompressedImage.h" +#include "FasTC/ScopedAllocator.h" #include "GLDefines.h" -#include "Image.h" -#include "CompressedImage.h" class ByteReader { private: diff --git a/IO/src/ImageLoaderKTX.h b/IO/src/ImageLoaderKTX.h index 64dc74a..596c28e 100644 --- a/IO/src/ImageLoaderKTX.h +++ b/IO/src/ImageLoaderKTX.h @@ -53,8 +53,8 @@ #ifndef _IO_SRC_IMAGE_LOADER_KTX_H_ #define _IO_SRC_IMAGE_LOADER_KTX_H_ -#include "ImageLoader.h" -#include "CompressionFormat.h" +#include "FasTC/ImageLoader.h" +#include "FasTC/CompressionFormat.h" class ImageLoaderKTX : public ImageLoader { public: diff --git a/IO/src/ImageLoaderPNG.h b/IO/src/ImageLoaderPNG.h index 4b8dd2a..976c64b 100644 --- a/IO/src/ImageLoaderPNG.h +++ b/IO/src/ImageLoaderPNG.h @@ -44,7 +44,7 @@ #ifndef _IMAGE_LOADER_PNG_H_ #define _IMAGE_LOADER_PNG_H_ -#include "ImageLoader.h" +#include "FasTC/ImageLoader.h" class ImageLoaderPNG : public ImageLoader { public: diff --git a/IO/src/ImageLoaderPVR.cpp b/IO/src/ImageLoaderPVR.cpp index 5ec9e98..61dfbf3 100644 --- a/IO/src/ImageLoaderPVR.cpp +++ b/IO/src/ImageLoaderPVR.cpp @@ -48,7 +48,7 @@ #include #include -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" #include "PVRTextureUtilities.h" diff --git a/IO/src/ImageLoaderPVR.h b/IO/src/ImageLoaderPVR.h index 365566a..2e8ef03 100644 --- a/IO/src/ImageLoaderPVR.h +++ b/IO/src/ImageLoaderPVR.h @@ -44,7 +44,7 @@ #ifndef _IMAGE_LOADER_PVR_H_ #define _IMAGE_LOADER_PVR_H_ -#include "ImageLoader.h" +#include "FasTC/ImageLoader.h" class ImageLoaderPVR : public ImageLoader { public: diff --git a/IO/src/ImageLoaderTGA.cpp b/IO/src/ImageLoaderTGA.cpp index ccae736..a0698e3 100644 --- a/IO/src/ImageLoaderTGA.cpp +++ b/IO/src/ImageLoaderTGA.cpp @@ -57,7 +57,7 @@ #include #include -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" #include "targa.h" diff --git a/IO/src/ImageLoaderTGA.h b/IO/src/ImageLoaderTGA.h index df68db0..c50ad46 100644 --- a/IO/src/ImageLoaderTGA.h +++ b/IO/src/ImageLoaderTGA.h @@ -53,7 +53,7 @@ #ifndef IO_SRC_IMAGELOADERTGA_H_ #define IO_SRC_IMAGELOADERTGA_H_ -#include "ImageLoader.h" +#include "FasTC/ImageLoader.h" class ImageLoaderTGA : public ImageLoader { public: diff --git a/IO/src/ImageWriter.cpp b/IO/src/ImageWriter.cpp index 9df3901..3b159ae 100644 --- a/IO/src/ImageWriter.cpp +++ b/IO/src/ImageWriter.cpp @@ -41,8 +41,8 @@ * */ -#include "ImageWriter.h" -#include "Pixel.h" +#include "FasTC/ImageWriter.h" +#include "FasTC/Pixel.h" uint32 ImageWriter::GetChannelForPixel(uint32 x, uint32 y, uint32 ch) { return m_Pixels[y * GetWidth() + x].Component((ch+1) % 4); diff --git a/IO/src/ImageWriterKTX.cpp b/IO/src/ImageWriterKTX.cpp index 7603eac..f54fe5f 100644 --- a/IO/src/ImageWriterKTX.cpp +++ b/IO/src/ImageWriterKTX.cpp @@ -56,10 +56,11 @@ #include #include -#include "Image.h" -#include "Pixel.h" +#include "FasTC/Image.h" +#include "FasTC/Pixel.h" + +#include "FasTC/CompressedImage.h" -#include "CompressedImage.h" #include "GLDefines.h" ImageWriterKTX::ImageWriterKTX(FasTC::Image<> &im) diff --git a/IO/src/ImageWriterKTX.h b/IO/src/ImageWriterKTX.h index 2bc3d37..05eeef7 100644 --- a/IO/src/ImageWriterKTX.h +++ b/IO/src/ImageWriterKTX.h @@ -53,8 +53,8 @@ #ifndef _IMAGE_WRITER_KTX_H_ #define _IMAGE_WRITER_KTX_H_ -#include "ImageWriter.h" -#include "ImageFwd.h" +#include "FasTC/ImageWriter.h" +#include "FasTC/ImageFwd.h" // Forward Declare class ImageWriterKTX : public ImageWriter { diff --git a/IO/src/ImageWriterPNG.cpp b/IO/src/ImageWriterPNG.cpp index 5fe847a..04045ac 100644 --- a/IO/src/ImageWriterPNG.cpp +++ b/IO/src/ImageWriterPNG.cpp @@ -49,8 +49,8 @@ #include -#include "Image.h" -#include "Pixel.h" +#include "FasTC/Image.h" +#include "FasTC/Pixel.h" class PNGStreamWriter { public: diff --git a/IO/src/ImageWriterPNG.h b/IO/src/ImageWriterPNG.h index b280869..fa514df 100644 --- a/IO/src/ImageWriterPNG.h +++ b/IO/src/ImageWriterPNG.h @@ -44,8 +44,8 @@ #ifndef _IMAGE_WRITER_PNG_H_ #define _IMAGE_WRITER_PNG_H_ -#include "ImageWriter.h" -#include "ImageFwd.h" +#include "FasTC/ImageWriter.h" +#include "FasTC/ImageFwd.h" // Forward Declare class ImageWriterPNG : public ImageWriter { diff --git a/PVRTCEncoder/CMakeLists.txt b/PVRTCEncoder/CMakeLists.txt index 026222b..8c08479 100644 --- a/PVRTCEncoder/CMakeLists.txt +++ b/PVRTCEncoder/CMakeLists.txt @@ -49,14 +49,12 @@ # # -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/PVRTCEncoder/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/PVRTCEncoder/include) - -INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) -INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) +SET( LIBRARY_HEADERS + "include/FasTC/PVRTCCompressor.h" +) SET( HEADERS - include/PVRTCCompressor.h + ${LIBRARY_HEADERS} src/Block.h src/PVRTCImage.h ) @@ -72,7 +70,7 @@ OPTION(DEBUG_PVRTC_DECODER "Output intermediate images during PVRTC decoding." O CONFIGURE_FILE( "config/PVRTCDefines.h.in" - "include/PVRTCDefines.h" + "include/FasTC/PVRTCDefines.h" ) IF( PVRTEXLIB_FOUND ) @@ -83,11 +81,22 @@ IF( PVRTEXLIB_FOUND ) ) ENDIF() +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/PVRTCEncoder/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/PVRTCEncoder/include) +INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include) +INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include) + ADD_LIBRARY( PVRTCEncoder ${HEADERS} ${SOURCES} ) +INSTALL(TARGETS PVRTCEncoder EXPORT FasTCTargets ARCHIVE DESTINATION lib COMPONENT lib) +INSTALL( + FILES ${LIBRARY_HEADERS} "${FasTC_BINARY_DIR}/PVRTCEncoder/include/FasTC/PVRTCDefines.h" + DESTINATION ${INCLUDE_INSTALL_DIR}/FasTC + COMPONENT dev) + TARGET_LINK_LIBRARIES( PVRTCEncoder FasTCBase ) IF( DEBUG_PVRTC_DECODER ) TARGET_LINK_LIBRARIES( PVRTCEncoder FasTCIO ) diff --git a/PVRTCEncoder/include/PVRTCCompressor.h b/PVRTCEncoder/include/FasTC/PVRTCCompressor.h similarity index 98% rename from PVRTCEncoder/include/PVRTCCompressor.h rename to PVRTCEncoder/include/FasTC/PVRTCCompressor.h index f9b627e..8875975 100644 --- a/PVRTCEncoder/include/PVRTCCompressor.h +++ b/PVRTCEncoder/include/FasTC/PVRTCCompressor.h @@ -53,8 +53,8 @@ #ifndef PVRTCENCODER_INCLUDE_PVRTCCOMPRESSOR_H_ #define PVRTCENCODER_INCLUDE_PVRTCCOMPRESSOR_H_ -#include "CompressionJob.h" -#include "PVRTCDefines.h" +#include "FasTC/CompressionJob.h" +#include "FasTC/PVRTCDefines.h" namespace PVRTCC { diff --git a/PVRTCEncoder/src/Block.h b/PVRTCEncoder/src/Block.h index cd5dc91..9ed67cc 100644 --- a/PVRTCEncoder/src/Block.h +++ b/PVRTCEncoder/src/Block.h @@ -53,8 +53,8 @@ #ifndef PVRTCENCODER_SRC_BLOCK_H_ #define PVRTCENCODER_SRC_BLOCK_H_ -#include "TexCompTypes.h" -#include "Pixel.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/Pixel.h" namespace PVRTCC { diff --git a/PVRTCEncoder/src/Compressor.cpp b/PVRTCEncoder/src/Compressor.cpp index a4f87e9..4005ff7 100644 --- a/PVRTCEncoder/src/Compressor.cpp +++ b/PVRTCEncoder/src/Compressor.cpp @@ -50,7 +50,7 @@ * */ -#include "PVRTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" #include #include @@ -59,8 +59,9 @@ #include #include -#include "Pixel.h" -#include "Color.h" +#include "FasTC/Pixel.h" +#include "FasTC/Color.h" + #include "PVRTCImage.h" #include "Block.h" diff --git a/PVRTCEncoder/src/CompressorPVRLib.cpp b/PVRTCEncoder/src/CompressorPVRLib.cpp index 13b740e..c9bf1ff 100644 --- a/PVRTCEncoder/src/CompressorPVRLib.cpp +++ b/PVRTCEncoder/src/CompressorPVRLib.cpp @@ -51,7 +51,7 @@ */ // Our library include... -#include "PVRTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" // PVRLib library include... #include "PVRTextureUtilities.h" diff --git a/PVRTCEncoder/src/Decompressor.cpp b/PVRTCEncoder/src/Decompressor.cpp index 53b32fe..f410196 100644 --- a/PVRTCEncoder/src/Decompressor.cpp +++ b/PVRTCEncoder/src/Decompressor.cpp @@ -50,12 +50,13 @@ * */ -#include "PVRTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" #include #include -#include "Pixel.h" +#include "FasTC/Pixel.h" + #include "Block.h" #include "PVRTCImage.h" diff --git a/PVRTCEncoder/src/PVRTCImage.cpp b/PVRTCEncoder/src/PVRTCImage.cpp index a3c1f2d..c5d221a 100644 --- a/PVRTCEncoder/src/PVRTCImage.cpp +++ b/PVRTCEncoder/src/PVRTCImage.cpp @@ -63,7 +63,7 @@ #include #include -#include "Pixel.h" +#include "FasTC/Pixel.h" using FasTC::Pixel; #ifdef DEBUG_PVRTC_DECODER diff --git a/PVRTCEncoder/src/PVRTCImage.h b/PVRTCEncoder/src/PVRTCImage.h index 44058b2..77f3f3a 100644 --- a/PVRTCEncoder/src/PVRTCImage.h +++ b/PVRTCEncoder/src/PVRTCImage.h @@ -53,9 +53,10 @@ #ifndef PVRTCENCODER_SRC_IMAGE_H_ #define PVRTCENCODER_SRC_IMAGE_H_ -#include "TexCompTypes.h" -#include "PVRTCCompressor.h" -#include "Image.h" +#include "FasTC/TexCompTypes.h" +#include "FasTC/Image.h" + +#include "FasTC/PVRTCCompressor.h" #include diff --git a/PVRTCEncoder/test/CMakeLists.txt b/PVRTCEncoder/test/CMakeLists.txt index 74190e0..1ab3ae7 100644 --- a/PVRTCEncoder/test/CMakeLists.txt +++ b/PVRTCEncoder/test/CMakeLists.txt @@ -58,7 +58,9 @@ INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include ) IF( DEBUG_PVRTC_DECODER ) INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Core/include ) + INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Core/include ) INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/IO/include ) + INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/IO/include ) ENDIF( DEBUG_PVRTC_DECODER ) INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/GTest/include) @@ -102,7 +104,7 @@ IF(PVRTEXLIB_FOUND) # Make sure to include the PVR library headers... INCLUDE_DIRECTORIES( ${PVRTEXLIB_INCLUDE_DIRS} ) - INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Core/include ) + INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Core/include ) # HACK for MSVC 2012... IF(MSVC) diff --git a/PVRTCEncoder/test/DecompTestPVR.cpp b/PVRTCEncoder/test/DecompTestPVR.cpp index 599ac0f..b581f88 100644 --- a/PVRTCEncoder/test/DecompTestPVR.cpp +++ b/PVRTCEncoder/test/DecompTestPVR.cpp @@ -56,7 +56,7 @@ #include "PVRTextureUtilities.h" // This is our library header -#include "PVRTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" #include "TestUtils.h" diff --git a/PVRTCEncoder/test/DecompressorTest.cpp b/PVRTCEncoder/test/DecompressorTest.cpp index d1c2319..98ec2db 100644 --- a/PVRTCEncoder/test/DecompressorTest.cpp +++ b/PVRTCEncoder/test/DecompressorTest.cpp @@ -54,7 +54,7 @@ #include "TestUtils.h" -#include "PVRTCCompressor.h" +#include "FasTC/PVRTCCompressor.h" static const FasTC::ECompressionFormat kFmt = FasTC::eCompressionFormat_PVRTC4; diff --git a/PVRTCEncoder/test/ImageTest.cpp b/PVRTCEncoder/test/ImageTest.cpp index 4b77d1f..97dcc10 100644 --- a/PVRTCEncoder/test/ImageTest.cpp +++ b/PVRTCEncoder/test/ImageTest.cpp @@ -52,7 +52,7 @@ #include "gtest/gtest.h" #include "PVRTCImage.h" -#include "Pixel.h" +#include "FasTC/Pixel.h" #include "TestUtils.h" #include diff --git a/PVRTCEncoder/test/TestUtils.h b/PVRTCEncoder/test/TestUtils.h index 9c371d3..bab4c3e 100644 --- a/PVRTCEncoder/test/TestUtils.h +++ b/PVRTCEncoder/test/TestUtils.h @@ -53,7 +53,7 @@ #ifndef PVRTCENCODER_TEST_TESTUTILS_H_ #define PVRTCENCODER_TEST_TESTUTILS_H_ -#include "TexCompTypes.h" +#include "FasTC/TexCompTypes.h" class PixelPrinter { private: