CMakeLists.txt 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. target_link_libraries(LotroDat_static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic)
  49. # SHARED LIBRARY
  50. add_library(LotroDat SHARED ${SOURCE_FILES})
  51. target_link_libraries(LotroDat ${CMAKE_SOURCE_DIR}/Common/ZLib/libzlibstatic.a)
  52. target_link_libraries(LotroDat ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  53. target_link_libraries(LotroDat -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic)
  54. # FOR EXTRACTOR USE NEXT LINE
  55. add_executable(LotRO_dat_extract_tester ${SOURCE_FILES} ${CMAKE_SOURCE_DIR}/Tests/extract_test.cpp)
  56. target_link_libraries(LotRO_dat_extract_tester ${CMAKE_SOURCE_DIR}/Common/ZLib/libzlibstatic.a)
  57. target_link_libraries(LotRO_dat_extract_tester ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  58. target_link_libraries(LotRO_dat_extract_tester -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic)
  59. # FOR PATCHER USE NEXT LINE
  60. add_executable(LotRO_dat_pat_tester ${SOURCE_FILES} ${CMAKE_SOURCE_DIR}/Tests/patch_test.cpp)
  61. target_link_libraries(LotRO_dat_pat_tester ${CMAKE_SOURCE_DIR}/Common/Zlib/libzlibstatic.a)
  62. target_link_libraries(LotRO_dat_pat_tester ${CMAKE_SOURCE_DIR}/Common/Yaml/libyaml-cpp.a)
  63. target_link_libraries(LotRO_dat_pat_tester -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic)