sandboxed-api/contrib/libtiff/CMakeLists.txt

126 lines
3.7 KiB
CMake
Raw Normal View History

2020-09-24 04:21:33 +08:00
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
2020-09-24 04:21:33 +08: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.
cmake_minimum_required(VERSION 3.13..3.26)
2020-09-24 04:21:33 +08:00
project(sandboxed_libtiff CXX)
include(CTest)
include(GoogleTest)
2020-09-24 04:21:33 +08:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(NOT TARGET sapi::sapi)
set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree")
add_subdirectory("${SAPI_ROOT}"
"${CMAKE_BINARY_DIR}/sandboxed-api-build"
EXCLUDE_FROM_ALL)
endif()
2020-09-24 04:21:33 +08:00
FetchContent_Declare(libtiff
GIT_REPOSITORY https://gitlab.com/libtiff/libtiff
GIT_TAG v4.4.0 # 2022-05-20
)
FetchContent_MakeAvailable(libtiff)
2020-09-24 04:21:33 +08:00
add_subdirectory(wrapper)
add_sapi_library(tiff_sapi
2020-10-11 18:23:42 +08:00
# List of functions that we want to include in the
# generated sandboxed API class
FUNCTIONS TIFFOpen
TIFFClose
TIFFGetField1
TIFFGetField2
TIFFGetField3
TIFFSetFieldUChar1
TIFFSetFieldUChar2
TIFFSetFieldUChar3
TIFFSetFieldSChar1
TIFFSetFieldSChar2
TIFFSetFieldSChar3
TIFFSetFieldU1
TIFFSetFieldU2
TIFFSetFieldU3
TIFFSetFieldS1
TIFFSetFieldS2
TIFFSetFieldS3
TIFFSetFieldUShort1
TIFFSetFieldUShort2
TIFFSetFieldUShort3
TIFFSetFieldSShort1
TIFFSetFieldSShort2
TIFFSetFieldSShort3
TIFFSetFieldULLong1
TIFFSetFieldULLong2
TIFFSetFieldULLong3
TIFFSetFieldSLLong1
TIFFSetFieldSLLong2
TIFFSetFieldSLLong3
TIFFSetFieldFloat1
TIFFSetFieldFloat2
TIFFSetFieldFloat3
TIFFSetFieldDouble1
TIFFSetFieldDouble2
TIFFSetFieldDouble3
TIFFReadRGBATile
TIFFReadRGBATileExt
2020-10-11 18:23:42 +08:00
TIFFReadEncodedTile
TIFFReadEncodedStrip
TIFFReadFromUserBuffer
TIFFTileSize
TIFFSetDirectory
TIFFFreeDirectory
TIFFCreateDirectory
TIFFForceStrileArrayWriting
TIFFDeferStrileArrayWriting
TIFFWriteCheck
TIFFWriteScanline
TIFFWriteDirectory
TIFFWriteEncodedTile
TIFFWriteEncodedStrip
TIFFGetStrileOffsetWithErr
TIFFGetStrileByteCountWithErr
TIFFCreateEXIFDirectory
TIFFWriteCustomDirectory
INPUTS "${libtiff_SOURCE_DIR}/libtiff/tiffio.h"
2020-10-11 18:23:42 +08:00
wrapper/func.h
# Header files or .cc files that should be parsed
LIBRARY wrapped_tiff # Library dependency from the add_library() above
LIBRARY_NAME Tiff # Name prefix for the generated header. Will be
# suffixed with "Api" and "Sandbox" as needed.
NAMESPACE "" # Optional C++ namespace to wrap the generated code
2020-09-24 04:21:33 +08:00
)
add_library(sapi_contrib::libtiff ALIAS tiff_sapi)
2020-09-24 04:21:33 +08:00
target_include_directories(tiff_sapi INTERFACE
2020-10-11 18:23:42 +08:00
"${PROJECT_BINARY_DIR}" # To find the generated SAPI header
2020-09-24 04:21:33 +08:00
)
if (SAPI_BUILD_EXAMPLES)
2020-09-24 04:21:33 +08:00
add_subdirectory(example)
2020-10-01 01:54:47 +08:00
endif()
2020-09-24 04:21:33 +08:00
if (BUILD_TESTING AND SAPI_BUILD_TESTING)
2020-09-24 04:21:33 +08:00
add_subdirectory(test)
2020-10-01 01:54:47 +08:00
endif()