FasTC/IO/CMakeLists.txt

125 lines
3.6 KiB
Text
Raw Normal View History

2016-08-17 23:49:13 +00:00
# Copyright 2016 The University of North Carolina at Chapel Hill
2012-11-15 16:51:55 +00:00
#
2016-08-17 23:49:13 +00:00
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
2012-11-15 16:51:55 +00:00
#
2016-08-17 23:49:13 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
2012-11-15 16:51:55 +00:00
#
2016-08-17 23:49:13 +00:00
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2012-11-15 16:51:55 +00:00
#
# Please send all BUG REPORTS to <pavel@cs.unc.edu>.
# <http://gamma.cs.unc.edu/FasTC/>
SET( SOURCES
2012-10-20 22:22:29 +00:00
"src/ImageWriter.cpp"
"src/ImageLoader.cpp"
2012-10-20 22:22:29 +00:00
"src/ImageFile.cpp"
)
SET( LIBRARY_HEADERS
"include/FasTC/ImageFile.h"
"include/FasTC/ImageFileFormat.h"
"include/FasTC/FileStream.h"
)
SET( HEADERS
2012-10-20 22:22:29 +00:00
"config/ImageWriter.h.in"
"config/ImageLoader.h.in"
${LIBRARY_HEADERS}
)
IF( WIN32 )
SET( SOURCES ${SOURCES} "src/FileStreamWin32.cpp" )
ELSE()
SET( SOURCES ${SOURCES} "src/FileStreamUnix.cpp" )
# Assume compiler is GCC
SET( LINK_FLAGS -lrt ${LINK_FLAGS} )
ENDIF()
IF( PNG_FOUND )
INCLUDE_DIRECTORIES( ${PNG_INCLUDE_DIR} )
2012-08-27 16:58:44 +00:00
SET( SOURCES ${SOURCES} "src/ImageLoaderPNG.cpp" )
SET( HEADERS ${HEADERS} "src/ImageLoaderPNG.h" )
2012-10-20 22:22:29 +00:00
SET( SOURCES ${SOURCES} "src/ImageWriterPNG.cpp" )
SET( HEADERS ${HEADERS} "src/ImageWriterPNG.h" )
ENDIF()
IF( PVRTEXLIB_FOUND )
INCLUDE_DIRECTORIES( ${PVRTEXLIB_INCLUDE_DIRS} )
SET( SOURCES ${SOURCES} "src/ImageLoaderPVR.cpp" )
SET( HEADERS ${HEADERS} "src/ImageLoaderPVR.h" )
ENDIF( PVRTEXLIB_FOUND )
# Add third-party TGA library...
SET( SOURCES ${SOURCES} "third_party/tga/targa.c" )
SET( HEADERS ${HEADERS} "third_party/tga/targa.h" )
INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/IO/third_party/tga )
2013-11-19 19:22:26 +00:00
# Add TGA loaders
SET( SOURCES ${SOURCES} "src/ImageLoaderTGA.cpp" )
SET( HEADERS ${HEADERS} "src/ImageLoaderTGA.h" )
2014-01-23 19:43:05 +00:00
# Add KTX loaders
SET( SOURCES ${SOURCES} "src/ImageLoaderKTX.cpp" )
SET( HEADERS ${HEADERS} "src/ImageLoaderKTX.h" )
2014-01-23 23:24:11 +00:00
SET( SOURCES ${SOURCES} "src/ImageWriterKTX.cpp" )
SET( HEADERS ${HEADERS} "src/ImageWriterKTX.h" )
2014-01-23 19:43:05 +00:00
2014-03-12 23:26:39 +00:00
# Add ASTC loader
# This supports the Mali ASTC evaluation codec.
SET( SOURCES ${SOURCES} "src/ImageLoaderASTC.cpp" )
SET( HEADERS ${HEADERS} "src/ImageLoaderASTC.h" )
FIND_PACKAGE( OpenGL )
IF(OPENGL_FOUND)
INCLUDE_DIRECTORIES( ${OPENGL_INCLUDE_DIRS} )
ENDIF(OPENGL_FOUND)
CONFIGURE_FILE(
"config/ImageLoader.h.in"
"include/FasTC/ImageLoader.h"
)
2012-10-20 22:22:29 +00:00
CONFIGURE_FILE(
"config/ImageWriter.h.in"
"include/FasTC/ImageWriter.h"
2012-10-20 22:22:29 +00:00
)
INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/Base/include)
INCLUDE_DIRECTORIES( ${FasTC_BINARY_DIR}/Base/include)
2013-03-21 04:15:23 +00:00
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})
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)
2012-08-27 16:58:44 +00:00
TARGET_LINK_LIBRARIES( FasTCIO FasTCBase )
TARGET_LINK_LIBRARIES( FasTCIO FasTCCore )
2012-08-27 16:58:44 +00:00
IF( PNG_FOUND )
2013-03-21 04:15:23 +00:00
TARGET_LINK_LIBRARIES( FasTCIO ${PNG_LIBRARY} )
TARGET_LINK_LIBRARIES( FasTCIO ${ZLIB_LIBRARY} )
2012-08-27 16:58:44 +00:00
ENDIF()
IF( PVRTEXLIB_FOUND )
TARGET_LINK_LIBRARIES( FasTCIO ${PVRTEXLIB_LIBRARIES} )
ENDIF()