File: CMakeLists.txt

package info (click to toggle)
charls 1.1.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 400 kB
  • sloc: cpp: 4,058; makefile: 17; ansic: 6
file content (64 lines) | stat: -rw-r--r-- 2,829 bytes parent folder | download
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
cmake_minimum_required(VERSION 2.6)
project(charls)

# The following compiler option are only meant for GCC:
if (CMAKE_COMPILER_IS_GNUCC)
    # the following is optimization micromanagement that made better code for x86
    # SET(CMAKE_CXX_FLAGS "-D NDEBUG -O3 -Wall -Wextra -pedantic -fvisibility=hidden -fomit-frame-pointer -momit-leaf-frame-pointer -fweb  -ftracer" )

    # Define GNU C++ defines for both Debug and Release
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03 -Wall -Wextra")

    # Define specific Debug settings.
    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")

    # Define specific Release settings.
    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D NDEBUG -O3")
ENDIF ()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    # Define clang C++ defines for both Debug and Release
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03 -Wall -Wextra")

    # Define specific Debug settings.
    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")

    # Define specific Release settings.
    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D NDEBUG -O3")
endif()

option (BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF)
option (BUILD_TESTING     "Build tests"                         ON)

if (WIN32)
   if (BUILD_SHARED_LIBS)
     add_definitions(-D CHARLS_DLL)
   else()
     add_definitions(-D CHARLS_STATIC)
   endif()
endif()

set (charls_HEADERS
src/interface.h
src/context.h         src/defaulttraits.h    src/jpegimagedatasegment.h  src/jpegsegment.h           src/lookuptable.h       src/publictypes.h
src/colortransform.h  src/contextrunmode.h   src/encoderstrategy.h       src/jpegmarker.h            src/losslesstraits.h    src/scan.h
src/config.h          src/decoderstrategy.h  src/header.h                src/jpegmarkersegment.h     src/jpegstreamwriter.h  src/processline.h     src/util.h)

add_library(CharLS src/interface.cpp src/jpegls.cpp src/jpegmarkersegment.cpp src/header.cpp src/jpegstreamwriter.cpp)
set (CHARLS_LIB_MAJOR_VERSION 1)
set (CHARLS_LIB_MINOR_VERSION 0)
set_target_properties( CharLS PROPERTIES
                              VERSION ${CHARLS_LIB_MAJOR_VERSION}.${CHARLS_LIB_MINOR_VERSION}
                              SOVERSION ${CHARLS_LIB_MAJOR_VERSION})
set_property(TARGET CharLS PROPERTY LINK_FLAGS "-Wl,--version-script=../exports.version")


install (TARGETS CharLS RUNTIME DESTINATION bin
                        LIBRARY DESTINATION lib${LIB_SUFFIX}
                        ARCHIVE DESTINATION lib${LIB_SUFFIX})
install (FILES ${charls_HEADERS} DESTINATION include/CharLS)

if (BUILD_TESTING)
  add_executable(charlstest test/main.cpp test/time.cpp test/util.cpp test/bitstreamdamage.cpp test/compliance.cpp test/performance.cpp test/dicomsamples.cpp)
  target_link_libraries (charlstest CharLS)
endif ()