sjpeg.cmake (1173B)
1 # Copyright (c) the JPEG XL Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 # We need to CACHE the SJPEG_BUILD_EXAMPLES to not be removed by the option() 16 # inside SJPEG. 17 set(SJPEG_BUILD_EXAMPLES NO CACHE BOOL "Examples") 18 # SJPEG uses OpenGL which throws a warning if multiple options are installed. 19 # This setting makes it prefer the new version. 20 set(OpenGL_GL_PREFERENCE GLVND) 21 22 # Build SJPEG as a static library. 23 set(BUILD_SHARED_LIBS_BACKUP ${BUILD_SHARED_LIBS}) 24 set(BUILD_SHARED_LIBS OFF) 25 add_subdirectory(sjpeg EXCLUDE_FROM_ALL) 26 target_include_directories(sjpeg PUBLIC "${CMAKE_CURRENT_LIST_DIR}/sjpeg/src/") 27 set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_BACKUP})