CMakeLists.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. cmake_minimum_required(VERSION 3.8)
  2. project(LotRO_dat_library)
  3. set(CMAKE_CXX_STANDARD 11)
  4. set(PROJECT_BINARY_DIR bin)
  5. set(PROJECT_VERSION 0.1.0)
  6. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
  7. SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} -static" )
  8. set(CMAKE_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/bin)
  9. set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source)
  10. include_directories(${CMAKE_SOURCE_DIR}/Common/Yaml)
  11. SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_OUTPUT_DIR})
  12. SET(LIBRARY_OUTPUT_PATH ${CMAKE_OUTPUT_DIR})
  13. set(SOURCE_FILES
  14. ${CMAKE_SOURCE_DIR}/Common/CommonFunctions.h
  15. ${CMAKE_SOURCE_DIR}/Common/DatException.h
  16. ${CMAKE_SOURCE_DIR}/LotroDatPatcher.h
  17. ${CMAKE_SOURCE_DIR}/DatFile.cpp
  18. ${CMAKE_SOURCE_DIR}/DatFile.h
  19. ${CMAKE_SOURCE_DIR}/BinaryData.cpp
  20. ${CMAKE_SOURCE_DIR}/BinaryData.h
  21. ${CMAKE_SOURCE_DIR}/Database.cpp
  22. ${CMAKE_SOURCE_DIR}/Database.h
  23. ${CMAKE_SOURCE_DIR}/Subfile.cpp
  24. ${CMAKE_SOURCE_DIR}/Subfile.h
  25. ${CMAKE_SOURCE_DIR}/SubDirectory.cpp
  26. ${CMAKE_SOURCE_DIR}/SubDirectory.h
  27. ${CMAKE_SOURCE_DIR}/Common/SQLite/sqlite3.c
  28. ${CMAKE_SOURCE_DIR}/Common/SQLite/sqlite3.h
  29. ${CMAKE_SOURCE_DIR}/Subfiles/TextSubfile.cpp
  30. ${CMAKE_SOURCE_DIR}/Subfiles/TextSubfile.h
  31. ${CMAKE_SOURCE_DIR}/Subfiles/JpgSubfile.cpp
  32. ${CMAKE_SOURCE_DIR}/Subfiles/JpgSubfile.h
  33. ${CMAKE_SOURCE_DIR}/Subfiles/DdsSubfile.cpp
  34. ${CMAKE_SOURCE_DIR}/Subfiles/DdsSubfile.h
  35. ${CMAKE_SOURCE_DIR}/Subfiles/OggSubfile.cpp
  36. ${CMAKE_SOURCE_DIR}/Subfiles/OggSubfile.h
  37. ${CMAKE_SOURCE_DIR}/Subfiles/FontSubfile.cpp
  38. ${CMAKE_SOURCE_DIR}/Subfiles/FontSubfile.h
  39. ${CMAKE_SOURCE_DIR}/Subfiles/WavSubfile.cpp
  40. ${CMAKE_SOURCE_DIR}/Subfiles/WavSubfile.h
  41. ${CMAKE_SOURCE_DIR}/Subfiles/UnknownSubfile.cpp
  42. ${CMAKE_SOURCE_DIR}/Subfiles/UnknownSubfile.h
  43. )
  44. # STATIC LIBRARY
  45. add_library(LotroDat_static STATIC ${SOURCE_FILES})
  46. target_link_libraries(LotroDat_static ${CMAKE_SOURCE_DIR}/Common/ZLib/libzlibstatic.a)
  47. target_link_libraries(LotroDat_static ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  48. # SHARED LIBRARY
  49. add_library(LotroDat SHARED ${SOURCE_FILES})
  50. target_link_libraries(LotroDat ${CMAKE_SOURCE_DIR}/Common/ZLib/libzlibstatic.a)
  51. target_link_libraries(LotroDat_static ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  52. # FOR EXTRACTOR USE NEXT LINE
  53. add_executable(LotRO_dat_extract_tester ${SOURCE_FILES} ${CMAKE_SOURCE_DIR}/Tests/extract_test.cpp)
  54. target_link_libraries(LotRO_dat_extract_tester ${CMAKE_SOURCE_DIR}/Common/ZLib/libzlibstatic.a)
  55. target_link_libraries(LotroDat_static ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  56. # FOR PATCHER USE NEXT LINE
  57. add_executable(LotRO_dat_pat_tester ${SOURCE_FILES} ${CMAKE_SOURCE_DIR}/Tests/patch_test.cpp)
  58. target_link_libraries(LotRO_dat_pat_tester ${CMAKE_SOURCE_DIR}/Common/Zlib/libzlibstatic.a)
  59. target_link_libraries(LotroDat_static ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)