github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/image/jxr/jxrlib/CMakeLists.txt (about)

     1  # Copyright 2013 <chaishushan{AT}gmail.com>. All rights reserved.
     2  # Use of this source code is governed by a BSD-style
     3  # license that can be found in the LICENSE file.
     4  
     5  project(JXR_LIB)
     6  
     7  #------------------------------------------------------------------------------
     8  
     9  IF(WIN32)
    10    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
    11      set(OS win64)
    12    else()
    13      set(OS win32)
    14    endif()
    15  else()
    16    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
    17      set(OS posix64)
    18    else()
    19      set(OS posix64)
    20    endif()
    21  endif()
    22  
    23  #------------------------------------------------------------------------------
    24  
    25  add_definitions(
    26    -DDISABLE_PERF_MEASUREMENT
    27  )
    28  include_directories(AFTER
    29    ./include
    30    ./common/include
    31    ./image/decode
    32    ./image/encode
    33    ./image/sys
    34    ./jxrgluelib
    35    .
    36  )
    37  
    38  set(JXR_SRC
    39    ./jxrgluelib/JXRGlue.c
    40    ./jxrgluelib/JXRMeta.c
    41    ./jxrgluelib/JXRGluePFC.c
    42    ./jxrgluelib/JXRGlueJxr.c
    43  
    44    ./image/encode/encode.c
    45    ./image/encode/segenc.c
    46    ./image/encode/strenc.c
    47    ./image/encode/strFwdTransform.c
    48    ./image/encode/strPredQuantEnc.c
    49  
    50    ./image/decode/decode.c
    51    ./image/decode/postprocess.c
    52    ./image/decode/segdec.c
    53    ./image/decode/strdec.c
    54    ./image/decode/strInvTransform.c
    55    ./image/decode/strPredQuantDec.c
    56    ./image/decode/JXRTranscode.c
    57  
    58    ./image/sys/adapthuff.c
    59    ./image/sys/image.c
    60    ./image/sys/strcodec.c
    61    ./image/sys/strPredQuant.c
    62    ./image/sys/strTransform.c
    63    ./image/sys/perfTimerANSI.c
    64  
    65    ./src/jxr.c
    66    ./src/jxr_private.c
    67    ./src/jxr_decode.c
    68    ./src/jxr_encode.c
    69    ./src/jxr_stream_discard
    70  )
    71  
    72  set(JXR_TEST_SRC
    73    ./jxrtestlib/JXRTest.c
    74    ./jxrtestlib/JXRTestBmp.c
    75    ./jxrtestlib/JXRTestHdr.c
    76    ./jxrtestlib/JXRTestPnm.c
    77    ./jxrtestlib/JXRTestTif.c
    78    ./jxrtestlib/JXRTestYUV.c
    79  )
    80  
    81  #------------------------------------------------------------------------------
    82  
    83  add_library(jxrlib STATIC
    84    ${JXR_SRC}
    85  )
    86  if(CMAKE_BUILD_TYPE STREQUAL "debug")
    87    set_target_properties(jxrlib
    88      PROPERTIES OUTPUT_NAME "jxrlib-${OS}-debug"
    89    )
    90  else()
    91    set_target_properties(jxrlib
    92      PROPERTIES OUTPUT_NAME "jxrlib-${OS}"
    93    )
    94  endif()
    95  
    96  install(TARGETS jxrlib
    97    RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
    98    LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
    99    ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   100  )
   101  
   102  #------------------------------------------------------------------------------
   103  # JxrEncApp/JxrDecApp
   104  
   105  include_directories(AFTER
   106    ./jxrtestlib
   107  )
   108  
   109  # JxrEncApp
   110  add_executable(JxrEncApp
   111    ./jxrencoderdecoder/JxrEncApp.c
   112  
   113    ${JXR_TEST_SRC}
   114    ${JXR_SRC}
   115  )
   116  install(TARGETS JxrEncApp
   117    RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   118    LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   119    ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   120  )
   121  
   122  # JxrDecApp
   123  add_executable(JxrDecApp
   124    ./jxrencoderdecoder/JxrDecApp.c
   125  
   126    ${JXR_TEST_SRC}
   127    ${JXR_SRC}
   128  )
   129  install(TARGETS JxrDecApp
   130    RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   131    LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   132    ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   133  )
   134  
   135  #------------------------------------------------------------------------------
   136  # test
   137  
   138  include_directories(AFTER
   139    ./test
   140  )
   141  
   142  add_executable(jxrtest
   143    ./test/test.cc
   144    ./test/test_util.cc
   145    ./test/test_util_jpg.cc
   146  
   147    ./test/jxr_test.cc
   148    ./test/jxr_bench_test.cc
   149  
   150    ${JXR_SRC}
   151  )
   152  
   153  install(TARGETS jxrtest
   154    RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   155    LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   156    ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
   157  )
   158  
   159  #------------------------------------------------------------------------------
   160