From c95e70ca6ebc1b1e474c70c5c12ac35cbab812c4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:49:21 +0200 Subject: [PATCH] Changed: Added tga2dds project if libsquish is found (s3tc dependency removed) --- code/nel/CMakeLists.txt | 4 +- code/nel/CMakeModules/FindS3TC.cmake | 50 ---------------------- code/nel/tools/3d/CMakeLists.txt | 6 ++- code/nel/tools/3d/tga_2_dds/CMakeLists.txt | 11 +++++ 4 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 code/nel/CMakeModules/FindS3TC.cmake create mode 100644 code/nel/tools/3d/tga_2_dds/CMakeLists.txt diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 12398e297..1e49af1e3 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -217,9 +217,7 @@ IF(WITH_SAMPLES) ENDIF(WITH_SAMPLES) IF(WITH_TOOLS) - IF(WIN32) - FIND_PACKAGE(S3TC) - ENDIF(WIN32) + FIND_PACKAGE(Squish) ADD_SUBDIRECTORY(tools) ENDIF(WITH_TOOLS) diff --git a/code/nel/CMakeModules/FindS3TC.cmake b/code/nel/CMakeModules/FindS3TC.cmake deleted file mode 100644 index f4efb8c5e..000000000 --- a/code/nel/CMakeModules/FindS3TC.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# - Locate S3TC library -# This module defines -# S3TC_LIBRARY, the library to link against -# S3TC_FOUND, if false, do not try to link to S3TC -# S3TC_INCLUDE_DIR, where to find headers. - -IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - # in cache already - SET(S3TC_FIND_QUIETLY TRUE) -ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - - -FIND_PATH(S3TC_INCLUDE_DIR - s3_intrf.h - PATHS - $ENV{S3TC_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES S3TC -) - -FIND_LIBRARY(S3TC_LIBRARY - NAMES s3tc libs3tc - PATHS - $ENV{S3TC_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - SET(S3TC_FOUND "YES") - IF(NOT S3TC_FIND_QUIETLY) - MESSAGE(STATUS "Found S3TC: ${S3TC_LIBRARY}") - ENDIF(NOT S3TC_FIND_QUIETLY) -ELSE(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - IF(NOT S3TC_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find S3TC!") - ENDIF(NOT S3TC_FIND_QUIETLY) -ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 1010bbe7d..4e21da876 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -40,11 +40,13 @@ IF(WITH_MAXPLUGIN) ENDIF(MAXSDK_FOUND) ENDIF(WITH_MAXPLUGIN) +IF(SQUISH_FOUND) + ADD_SUBDIRECTORY(tga_2_dds) +ENDIF(SQUISH_FOUND) + # These use WIndows-specific things that need to be fixed. #ig_elevation #lightmap_optimizer #object_viewer_exe #hls_bank_maker -#s3tc_compressor_lib -#tga_2_dds #plugin_max diff --git a/code/nel/tools/3d/tga_2_dds/CMakeLists.txt b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt new file mode 100644 index 000000000..e1ffed3af --- /dev/null +++ b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt @@ -0,0 +1,11 @@ +FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.cpp ../s3tc_compressor_lib/*.h) + +ADD_EXECUTABLE(tga2dds ${SRC}) + +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(tga2dds ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(tga2dds "Tools, 3D: tga2dds") +NL_ADD_RUNTIME_FLAGS(tga2dds) + +INSTALL(TARGETS tga2dds RUNTIME DESTINATION bin COMPONENT tools3d)