

# WARNING : automatically generated by utils/generate.py
cmake_minimum_required(VERSION 2.8)

include_directories(
  "../../../myWindows"
  "../../../"
  "../../../include_windows"
)

add_definitions( -DEXTERNAL_CODECS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -DENV_UNIX -DBREAK_HANDLER -DUNICODE -D_UNICODE -DUNIX_USE_WIN_FILE)

IF(APPLE)
  add_definitions(-DENV_MACOSX)
  FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation )
ENDIF(APPLE)

add_library(Rar MODULE

  "../../../../C/7zCrc.c"
  "../../../../C/7zCrcOpt.c"
  "../../../../C/Alloc.c"
  "../../../../C/CpuArch.c"
  "../../../../C/Ppmd7.c"
  "../../../../C/Ppmd7Dec.c"
  "../../../../CPP/7zip/Common/InBuffer.cpp"
  "../../../../CPP/7zip/Common/OutBuffer.cpp"
  "../../../../CPP/7zip/Common/StreamUtils.cpp"
  "../../../../CPP/7zip/Compress/CodecExports.cpp"
  "../../../../CPP/7zip/Compress/DllExportsCompress.cpp"
  "../../../../CPP/7zip/Compress/LzOutWindow.cpp"
  "../../../../CPP/7zip/Compress/Rar1Decoder.cpp"
  "../../../../CPP/7zip/Compress/Rar2Decoder.cpp"
  "../../../../CPP/7zip/Compress/Rar3Decoder.cpp"
  "../../../../CPP/7zip/Compress/Rar3Vm.cpp"
  "../../../../CPP/7zip/Compress/Rar5Decoder.cpp"
  "../../../../CPP/7zip/Compress/RarCodecsRegister.cpp"
  "../../../../CPP/Common/CRC.cpp"
  "../../../../CPP/Common/MyVector.cpp"
  "../../../../CPP/Common/MyWindows.cpp"
)

    
SET_TARGET_PROPERTIES(Rar PROPERTIES PREFIX "")

find_library(DL_LIB dl)

link_directories(${DL_LIB_PATH})

IF(APPLE)
   TARGET_LINK_LIBRARIES(Rar ${COREFOUNDATION_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
ELSE(APPLE)
  IF(HAVE_PTHREADS)
   TARGET_LINK_LIBRARIES(Rar ${CMAKE_THREAD_LIBS_INIT} dl)
  ENDIF(HAVE_PTHREADS)
ENDIF(APPLE)

