-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (68 loc) · 2.42 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
66
67
68
69
70
71
72
73
74
###############################################################################
#
# Copyright (c) 2012 Mateusz Loskot <mateusz at loskot dot net>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
###############################################################################
cmake_minimum_required(VERSION 2.8)
project(jxrpp)
set(jxrpp_VERSION_MAJOR 0)
set(jxrpp_VERSION_MINOR 1)
set(jxrpp_VERSION "${jxrpp_VERSION_MAJOR}.${jxrpp_VERSION_MINOR}")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
###############################################################################
# libjpegxr - uses source files from git submodule jxr-refsoft
set(jpegxr_DIR ${CMAKE_SOURCE_DIR}/jxr-refsoft/src)
set(jpegxr_SRC
${jpegxr_DIR}/jpegxr.h
${jpegxr_DIR}/algo.c
${jpegxr_DIR}/api.c
${jpegxr_DIR}/cr_parse.c
${jpegxr_DIR}/cw_emit.c
${jpegxr_DIR}/flags.c
${jpegxr_DIR}/init.c
${jpegxr_DIR}/io.c
${jpegxr_DIR}/jpegxr_pixelformat.c
${jpegxr_DIR}/r_parse.c
${jpegxr_DIR}/r_strip.c
${jpegxr_DIR}/r_tile_frequency.c
${jpegxr_DIR}/r_tile_spatial.c
${jpegxr_DIR}/w_emit.c
${jpegxr_DIR}/w_strip.c
${jpegxr_DIR}/w_tile_frequency.c
${jpegxr_DIR}/w_tile_spatial.c
${jpegxr_DIR}/x_strip.c)
if (MSVC)
set_source_files_properties(${jpegxr_SRC} PROPERTIES LANGUAGE CXX)
add_library(jpegxr SHARED ${jpegxr_SRC})
set_target_properties(jpegxr PROPERTIES
OUTPUT_NAME jpegxr
DEFINE_SYMBOL JXR_DLL_EXPORTS
COMPILE_DEFINITIONS JXR_DLL)
add_library(jpegxr-static STATIC ${jpegxr_SRC})
set_target_properties(jpegxr-static PROPERTIES
OUTPUT_NAME jpegxr
PREFIX "lib")
else()
add_library(jpegxr STATIC ${jpegxr_SRC})
endif()
###############################################################################
# libjxrpp
set(jxrpp_SRC jxrpp.hpp jxrpp.cpp)
add_library(jxrpp STATIC ${jxrpp_SRC})
set_target_properties(jxrpp PROPERTIES
OUTPUT_NAME jxrpp
VERSION ${jxrpp_VERSION}
CLEAN_DIRECT_OUTPUT 1
INCLUDE_DIRECTORIES ${jpegxr_DIR})
###############################################################################
# jxrpp_info
add_executable(jxrpp_info jxrpp_info.cpp)
target_link_libraries(jxrpp_info jxrpp jpegxr)
set_target_properties(jxrpp_info PROPERTIES
INCLUDE_DIRECTORIES ${jpegxr_DIR})