summaryrefslogtreecommitdiff
path: root/indra/llkdu/CMakeLists.txt
blob: aef8dea53ffda7773d3fda8396ffca09dc2424a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- cmake -*-

project(llkdu)

# Visual Studio 2005 has a dumb bug that causes it to fail compilation
# of KDU if building with both optimisation and /WS (treat warnings as
# errors), even when the specific warnings that make it croak are
# disabled.

#set(VS_DISABLE_FATAL_WARNINGS ON)

include(00-Common)
include(LLCommon)
include(LLImage)
include(LLKDU)

set(llkdu_SOURCE_FILES
    llimagej2ckdu.cpp
    llkdumem.cpp
    )

set(llkdu_HEADER_FILES
    CMakeLists.txt
    
    llimagej2ckdu.h
    llkdumem.h
    )

set_source_files_properties(${llkdu_HEADER_FILES}
                            PROPERTIES HEADER_FILE_ONLY TRUE)

list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})

# Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file.
# Unless that macro is also set for every consumer build, KDU freaks out,
# spamming the viewer log with alignment FUD.
set_source_files_properties(${llkdu_SOURCE_FILES}
                            PROPERTIES
                            COMPILE_DEFINITIONS
                            "KDU_X86_INTRINSICS")

if (USE_KDU)
  add_library (llkdu ${llkdu_SOURCE_FILES})

  target_link_libraries(llkdu ll::kdu llimage llcommon)
  target_include_directories( llkdu  INTERFACE   ${CMAKE_CURRENT_SOURCE_DIR})

  # Add tests
  # ND: llkdu tests are very strange as they include stubs for KDU classes/methods
  # if not having access to the right KDU version this test will fail to compile, incidentally I do not
  # have access to a matching version of KDU and thus cannot get this tests to compile
  if (LL_TESTS_KDU)
    include(LLAddBuildTest)
    include(Tut)
    SET(llkdu_TEST_SOURCE_FILES
      llimagej2ckdu.cpp
      )
    SET(llkdu_test_additional_HEADER_FILES
      llimagej2ckdu.h
      llkdumem.h
      lltut.h
      )

    get_property( llimage_include_dir TARGET llimage PROPERTY INTERFACE_INCLUDE_DIRECTORIES )
    set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES  ll::kdu llcommon)
    set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_INCLUDE_DIRS ${llimage_include_dir})

    LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}")
  endif (LL_TESTS_KDU)

endif (USE_KDU)