CMakeLists.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #
  6. #
  7. # CMake definition for squish-ccr 2.00 alpha2
  8. cmake_minimum_required(VERSION 3.16)
  9. project(squish-ccr)
  10. set(SQUISH_SOURCE_FILES
  11. alpha.cpp
  12. alphanormalfit.cpp
  13. bitoneblock.cpp
  14. bitoneclusterfit.cpp
  15. bitonefit.cpp
  16. bitonenormalfit.cpp
  17. bitonerangefit.cpp
  18. bitoneset.cpp
  19. colourblock.cpp
  20. colourclusterfit.cpp
  21. colourfit.cpp
  22. colournormalfit.cpp
  23. colourrangefit.cpp
  24. colourset.cpp
  25. hdrblock.cpp
  26. hdrfit.cpp
  27. hdrindexfit.cpp
  28. hdrrangefit.cpp
  29. hdrset.cpp
  30. hdrsinglefit.cpp
  31. hdrsinglesnap.cpp
  32. maths.cpp
  33. paletteblock.cpp
  34. palettechannelfit.cpp
  35. paletteclusterfit.cpp
  36. palettefit.cpp
  37. paletteindexfit.cpp
  38. palettenormalfit.cpp
  39. paletterangefit.cpp
  40. paletteset.cpp
  41. coloursinglefit.cpp
  42. coloursinglesnap.cpp
  43. palettesinglefit.cpp
  44. palettesinglesnap.cpp
  45. simd.cpp
  46. squish.cpp
  47. )
  48. set(SQUISH_HEADER_FILES
  49. alpha.h
  50. alphanormalfit.h
  51. bitoneblock.h
  52. bitoneclusterfit.h
  53. bitonefit.h
  54. bitonenormalfit.h
  55. bitonerangefit.h
  56. bitoneset.h
  57. colourblock.h
  58. colourclusterfit.h
  59. colourfit.h
  60. colournormalfit.h
  61. colourrangefit.h
  62. colourset.h
  63. config.h
  64. helpers.h
  65. hdrblock.h
  66. hdrfit.h
  67. hdrindexfit.h
  68. hdrrangefit.h
  69. hdrset.h
  70. hdrsinglefit.h
  71. hdrsinglesnap.h
  72. maths.h
  73. maths_sse.h
  74. maths_std.h
  75. paletteblock.h
  76. palettechannelfit.h
  77. paletteclusterfit.h
  78. palettefit.h
  79. paletteindexfit.h
  80. palettenormalfit.h
  81. paletterangefit.h
  82. paletteset.h
  83. simd.h
  84. simd_float.h
  85. simd_sse.h
  86. simd_ve.h
  87. coloursinglefit.h
  88. coloursinglesnap.h
  89. palettesinglefit.h
  90. palettesinglesnap.h
  91. squish.h
  92. )
  93. set(SQUISH_INLINE_FILES
  94. bitoneclusterfit.inl
  95. coloursinglelookup.inl
  96. palettesinglelookup.inl
  97. )
  98. set(SQUISH_PUBLIC_INCLUDE_FILES
  99. squish.h
  100. config.h
  101. coloursinglelookup_ccr.inl
  102. coloursinglelookup_ccr_vector.inl
  103. degeneracy_ccr.inl
  104. )
  105. add_library(squish-ccr SHARED ${SQUISH_SOURCE_FILES} ${SQUISH_HEADER_FILES} ${SQUISH_INLINE_FILES})
  106. if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  107. if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
  108. target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR} /data/workspace/sse2neon)
  109. target_compile_definitions(squish-ccr PRIVATE SQUISH_USE_NEON=1 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
  110. target_compile_options(squish-ccr PRIVATE -march=armv8-a+fp+simd+crypto+crc -Wno-unused-value -Wno-c++20-extensions -Wno-shift-op-parentheses -Wno-tautological-constant-out-of-range-compare -Wno-array-bounds -Wno-switch)
  111. else()
  112. target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR})
  113. target_compile_definitions(squish-ccr PRIVATE SQUISH_USE_NEON=0 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
  114. target_compile_options(squish-ccr PRIVATE -msse2 -Wno-unused-value -Wno-switch)
  115. endif()
  116. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  117. target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR})
  118. target_compile_definitions(squish-ccr PRIVATE NDEBUG USE_CPP SQUISH_USE_NEON=0 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
  119. endif()
  120. set_target_properties(squish-ccr
  121. PROPERTIES
  122. LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin/"
  123. PUBLIC_HEADER "${SQUISH_PUBLIC_INCLUDE_FILES}"
  124. )
  125. include(GNUInstallDirs)
  126. install(TARGETS squish-ccr
  127. PUBLIC_HEADER
  128. DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/squish-ccr"
  129. ARCHIVE
  130. DESTINATION ${CMAKE_INSTALL_BINDIR}
  131. LIBRARY
  132. DESTINATION ${CMAKE_INSTALL_BINDIR}
  133. RUNTIME
  134. DESTINATION ${CMAKE_INSTALL_BINDIR}
  135. FRAMEWORK
  136. DESTINATION ${CMAKE_INSTALL_BINDIR}
  137. )