FasTC/Core/CMakeLists.txt

119 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/>
2012-08-27 17:36:59 +00:00
SET( SOURCES
"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"
2012-08-27 17:36:59 +00:00
)
SET( HEADERS
${LIBRARY_HEADERS}
"src/CompressionFuncs.h"
2012-08-27 17:36:59 +00:00
)
# Make sure to add the appropriate stopwatch files...
IF( WIN32 )
SET( SOURCES ${SOURCES} "src/StopWatchWin32.cpp" )
ELSEIF( APPLE )
SET( SOURCES ${SOURCES} "src/StopWatchOSX.cpp" )
ELSE()
SET( SOURCES ${SOURCES} "src/StopWatchUnix.cpp" )
2012-08-30 21:13:36 +00:00
# Assume compiler is GCC
SET( LINK_FLAGS -lrt ${LINK_FLAGS} )
ENDIF()
2013-11-11 22:07:57 +00:00
###### Find Threads....
2013-01-27 15:33:41 +00:00
IF( MSVC )
2013-11-11 22:07:57 +00:00
SET( SOURCES ${SOURCES} "src/ThreadWin32.cpp" )
ELSE()
FIND_PACKAGE( Threads )
IF( CMAKE_USE_PTHREADS_INIT )
SET( SOURCES ${SOURCES} "src/ThreadPThread.cpp" )
ELSE()
MESSAGE( FATAL_ERROR "Could not find suitable threading library." )
ENDIF()
ENDIF()
# Add internal sources
2013-11-11 22:07:57 +00:00
SET( HEADERS ${HEADERS} "src/Thread.h" )
SET( HEADERS ${HEADERS} "src/ThreadGroup.h" )
SET( HEADERS ${HEADERS} "src/WorkerQueue.h" )
2013-11-11 22:07:57 +00:00
SET( SOURCES ${SOURCES} "src/ThreadSafeStreambuf.cpp" )
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 )
2013-03-21 04:15:23 +00:00
ADD_LIBRARY( FasTCCore
2012-08-27 17:36:59 +00:00
${HEADERS}
${SOURCES}
)
2012-08-27 22:34:37 +00:00
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 )
2013-03-21 04:15:23 +00:00
TARGET_LINK_LIBRARIES( FasTCCore FasTCIO )
2013-10-21 21:23:33 +00:00
TARGET_LINK_LIBRARIES( FasTCCore ETCEncoder )
TARGET_LINK_LIBRARIES( FasTCCore DXTEncoder )
2013-03-21 04:15:23 +00:00
TARGET_LINK_LIBRARIES( FasTCCore BPTCEncoder )
TARGET_LINK_LIBRARIES( FasTCCore PVRTCEncoder )
TARGET_LINK_LIBRARIES( FasTCCore ASTCEncoder )
2013-11-11 22:07:57 +00:00
IF( CMAKE_USE_PTHREADS_INIT )
2013-03-21 04:15:23 +00:00
TARGET_LINK_LIBRARIES( FasTCCore ${CMAKE_THREAD_LIBS_INIT} )
2012-09-30 19:34:21 +00:00
ENDIF()
2012-08-30 21:13:36 +00:00
IF( NOT WIN32 AND NOT APPLE )
2013-03-21 04:15:23 +00:00
TARGET_LINK_LIBRARIES( FasTCCore rt )
2012-08-30 21:13:36 +00:00
ENDIF()