Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

CMakeLists.txt 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. cmake_minimum_required(VERSION 2.6)
  2. project(unarr C)
  3. #Set up api and release version for later use.
  4. #Increase in major api version indicates api
  5. #breakage!! For non-breaking changes, use
  6. #minor api version instead.
  7. set (UNARR_API_VERSION_MAJOR 1)
  8. set (UNARR_API_VERSION_MINOR 0)
  9. #set build type to default if unset
  10. if( NOT CMAKE_BUILD_TYPE )
  11. set( CMAKE_BUILD_TYPE Release CACHE STRING
  12. "Choose the type of build, options are: None Debug Release RelWithDebInfo
  13. MinSizeRel."
  14. FORCE )
  15. endif()
  16. find_package(ZLIB)
  17. find_package(BZip2)
  18. if (UNIX OR MINGW)
  19. add_compile_options(-fomit-frame-pointer -D_FILE_OFFSET_BITS=64)
  20. endif (UNIX OR MINGW)
  21. #sources
  22. set (HEADERS common/allocator.h
  23. common/unarr-imp.h
  24. rar/rar.h
  25. rar/lzss.h
  26. rar/rarvm.h
  27. lzmasdk/LzmaDec.h
  28. lzmasdk/Ppmd7.h
  29. lzmasdk/CpuArch.h
  30. lzmasdk/Ppmd.h
  31. lzmasdk/7zTypes.h
  32. lzmasdk/Ppmd8.h
  33. lzmasdk/Precomp.h
  34. _7z/_7z.h
  35. zip/zip.h
  36. zip/inflate.h
  37. tar/tar.h)
  38. set (SOURCES rar/uncompress-rar.c
  39. rar/huffman-rar.c
  40. rar/rar.c
  41. rar/filter-rar.c
  42. rar/rarvm.c
  43. rar/parse-rar.c
  44. _7z/_7z.c
  45. zip/zip.c
  46. zip/inflate.c
  47. zip/parse-zip.c
  48. zip/uncompress-zip.c
  49. tar/tar.c
  50. tar/parse-tar.c
  51. lzmasdk/Ppmd7.c
  52. lzmasdk/Ppmd8.c
  53. lzmasdk/CpuArch.c
  54. lzmasdk/LzmaDec.c
  55. lzmasdk/Ppmd7Dec.c
  56. lzmasdk/Ppmd8Dec.c
  57. common/custalloc.c
  58. common/unarr.c
  59. common/stream.c
  60. common/conv.c
  61. common/crc32.c
  62. )
  63. #build targets
  64. add_library(unarr SHARED unarr.h ${HEADERS} ${SOURCES})
  65. add_library(unarr_static STATIC unarr.h ${HEADERS} ${SOURCES})
  66. set_target_properties(unarr PROPERTIES VERSION ${UNARR_API_VERSION_MAJOR}.${UNARR_API_VERSION_MINOR} SOVERSION ${UNARR_API_VERSION_MAJOR})
  67. set_target_properties(unarr_static PROPERTIES OUTPUT_NAME unarr VERSION ${UNARR_API_VERSION_MAJOR}.${UNARR_API_VERSION_MINOR} SOVERSION ${UNARR_API_VERSION_MAJOR})
  68. #library detection macros
  69. if (ZLIB_FOUND)
  70. include_directories(${ZLIB_INCLUDE_DIRS})
  71. target_link_libraries(unarr ${ZLIB_LIBRARIES})
  72. target_link_libraries(unarr_static ${ZLIB_LIBRARIES})
  73. add_definitions(-DHAVE_ZLIB)
  74. endif(ZLIB_FOUND)
  75. if (BZIP2_FOUND)
  76. include_directories(${BZIP_INCLUDE_DIRS})
  77. target_link_libraries (unarr ${BZIP2_LIBRARIES})
  78. target_link_libraries (unarr_static ${BZIP2_LIBRARIES})
  79. add_definitions(-DHAVE_BZIP2)
  80. endif (BZIP2_FOUND)
  81. #make install targets
  82. install(TARGETS unarr DESTINATION lib)
  83. install(TARGETS unarr_static DESTINATION lib)
  84. install(FILES unarr.h DESTINATION include)