summaryrefslogtreecommitdiff
path: root/indra/integration_tests/llui_libtest/CMakeLists.txt
blob: 3957ede77f01d49af6eabc3cd7d389c223c4d8d8 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# -*- cmake -*-

# Only set this up for viewer builds, because the llui library is most closely
# related to the viewer
if (VIEWER)

project (llui_libtest)

include(00-Common)
include(LLCommon)
include(LLImage)
include(LLImageJ2COJ)   # ugh, needed for images
include(LLKDU)
include(LLMath)
include(LLMessage)
include(LLRender)
include(LLWindow)
include(LLUI)
include(LLFileSystem)
include(LLXML)
include(Hunspell)
include(Linking)
# include(Tut)

include_directories(
    ${FREETYPE_INCLUDE_DIRS}
    ${LLCOMMON_INCLUDE_DIRS}
    ${LLIMAGE_INCLUDE_DIRS}
    ${LLMATH_INCLUDE_DIRS}
    ${LLRENDER_INCLUDE_DIRS}
    ${LLUI_INCLUDE_DIRS}
    ${LLFILESYSTEM_INCLUDE_DIRS}
    ${LLWINDOW_INCLUDE_DIRS}
    ${LLXML_INCLUDE_DIRS}
    ${LIBS_PREBUILD_DIR}/include/hunspell
    )
include_directories(SYSTEM
    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
    ${LLXML_SYSTEM_INCLUDE_DIRS}
    )

set(llui_libtest_SOURCE_FILES
    llui_libtest.cpp
    llwidgetreg.cpp
    )

set(llui_libtest_HEADER_FILES
    CMakeLists.txt
    llui_libtest.h
    llwidgetreg.h
    )

set_source_files_properties(${llui_libtest_HEADER_FILES}
                            PROPERTIES HEADER_FILE_ONLY TRUE)

list(APPEND llui_libtest_SOURCE_FILES ${llui_libtest_HEADER_FILES})

add_executable(llui_libtest ${llui_libtest_SOURCE_FILES})

# Link with OS-specific libraries for LLWindow dependency
if (DARWIN)
  find_library(COCOA_LIBRARY Cocoa)
  find_library(IOKIT_LIBRARY IOKit)
  set(OS_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
elseif (WINDOWS)
  #ll_stack_trace needs this now...
  list(APPEND WINDOWS_LIBRARIES dbghelp)
  set(OS_LIBRARIES ${WINDOWS_LIBRARIES})
elseif (LINUX)
  set(OS_LIBRARIES)
else (DARWIN)
  message(FATAL_ERROR "unknown platform")
endif (DARWIN)

# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
target_link_libraries(llui_libtest
    ${LEGACY_STDIO_LIBS}
    llui
    llinventory
    llmessage
    ${LLRENDER_LIBRARIES}
    ${LLIMAGE_LIBRARIES}
    ${LLKDU_LIBRARIES}
    ${KDU_LIBRARY}
    ${LLIMAGEJ2COJ_LIBRARIES}
    ${OS_LIBRARIES}
    ${GOOGLE_PERFTOOLS_LIBRARIES}
    ${HUNSPELL_LIBRARY}
    )

if (WINDOWS)
    set_target_properties(llui_libtest
        PROPERTIES 
        LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
        LINK_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBCMTD"
        )

    # Copy over OpenJPEG.dll
    # *NOTE: On Windows with VS2005, only the first comment prints
    set(OPENJPEG_RELEASE
        "${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.dll")
    add_custom_command( TARGET llui_libtest POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different 
            ${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR}
        COMMENT "Copying OpenJPEG DLLs to binary directory"
        )
    set(OPENJPEG_DEBUG
        "${ARCH_PREBUILT_DIRS_DEBUG}/openjp2.dll")
    add_custom_command( TARGET llui_libtest POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different 
            ${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR}
        )
  
endif (WINDOWS)

# Ensure people working on the viewer don't break this library
# *NOTE: This could be removed, or only built by Parabuild, if the build
# and link times become too long. JC
add_dependencies(viewer llui_libtest)

endif (VIEWER)