forked from ImageOptim/libimagequant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (36 loc) · 989 Bytes
/
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
cmake_minimum_required(VERSION 3.5)
set(VERSION 2.18.0-moondust)
project(imagequant C)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ARM64)
option(BUILD_WITH_SSE "Use SSE" OFF)
else()
option(BUILD_WITH_SSE "Use SSE" ON)
endif()
find_package(OpenMP)
if(OPENMP_FOUND)
option(BUILD_WITH_OPENMP "Use OpenMP" OFF)
else()
set(BUILD_WITH_OPENMP OFF)
endif()
add_library(imagequant_a STATIC
libimagequant.c
blur.c
mediancut.c
mempool.c
nearest.c
pam.c
kmeans.c
remap.c
)
if(BUILD_WITH_SSE)
target_compile_definitions(imagequant_a PRIVATE -DUSE_SSE=1)
endif()
if(BUILD_WITH_OPENMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
target_link_libraries(imagequant_a PRIVATE ${OpenMP_C_LIBRARIES})
endif()
if(CMAKE_COMPILER_IS_GNUCC)
target_compile_options(imagequant_a PRIVATE "-std=c99")
endif()
target_include_directories(imagequant_a PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(imagequant_a PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)