forked from strukturag/libheif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (55 loc) · 1.67 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
project (libheif)
cmake_minimum_required (VERSION 2.8.8)
# https://cmake.org/cmake/help/v3.1/policy/CMP0054.html
cmake_policy(SET CMP0054 NEW)
# The version number.
set (NUMERIC_VERSION 0x01000000)
set (PACKAGE_VERSION 1.0.0)
include (${CMAKE_ROOT}/Modules/CheckCCompilerFlag.cmake)
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H)
CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
if (HAVE_INTTYPES_H)
add_definitions(-DHAVE_INTTYPES_H)
endif()
if (HAVE_STDDEF_H)
add_definitions(-DHAVE_STDDEF_H)
endif()
if (HAVE_STRINGS_H)
add_definitions(-DHAVE_STRINGS_H)
endif()
if (HAVE_UNISTD_H)
add_definitions(-DHAVE_UNISTD_H)
endif()
configure_file (
"${PROJECT_SOURCE_DIR}/libheif/heif_version.h.in"
"${PROJECT_SOURCE_DIR}/libheif/heif_version.h"
)
if(CMAKE_COMPILER_IS_GNUCXX)
set(GCC 1)
add_definitions(-Wall)
add_definitions(-Werror)
add_definitions(-Wsign-compare)
add_definitions(-Wconversion)
add_definitions(-Wno-sign-conversion)
add_definitions(-Wno-error=conversion)
set(CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_definitions(-Wall)
add_definitions(-Werror)
add_definitions(-Wsign-compare)
add_definitions(-Wconversion)
add_definitions(-Wno-sign-conversion)
add_definitions(-Wno-error=conversion)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
include_directories ("${PROJECT_SOURCE_DIR}")
if(UNIX)
set(LIBHEIF_LIBRARY_NAME heif)
else()
set(LIBHEIF_LIBRARY_NAME libheif)
endif()
add_subdirectory (examples)
add_subdirectory (libheif)