summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater/CMakeLists.txt
blob: 73e18aacb3c6689b9db56ac79032db39e0b8ec4a (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
# -*- cmake -*-

project(updater_service)

include(00-Common)
if(LL_TESTS)
  include(LLAddBuildTest)
endif(LL_TESTS)
include(Boost)
include(CMakeCopyIfDifferent)
include(CURL)
include(LLCommon)
include(LLCoreHttp)
include(LLMessage)
include(LLPlugin)
include(LLVFS)

include_directories(
    ${LLCOMMON_INCLUDE_DIRS}
    ${LLCOREHTTP_INCLUDE_DIRS}
    ${LLMESSAGE_INCLUDE_DIRS}
    ${LLPLUGIN_INCLUDE_DIRS}
    ${LLVFS_INCLUDE_DIRS}
    ${CURL_INCLUDE_DIRS}
    ${CMAKE_SOURCE_DIR}/newview
    )
include_directories(SYSTEM
    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
    )

set(updater_service_SOURCE_FILES
    llupdaterservice.cpp
    llupdatechecker.cpp
    llupdatedownloader.cpp
    llupdateinstaller.cpp
    )

set(updater_service_HEADER_FILES
    llupdaterservice.h
    llupdatechecker.h
    llupdatedownloader.h
    llupdateinstaller.h
    )

set_source_files_properties(${updater_service_HEADER_FILES}
                            PROPERTIES HEADER_FILE_ONLY TRUE)

set_source_files_properties(
   llupdaterservice.cpp 
   PROPERTIES
   COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake
   )

list(APPEND 
    updater_service_SOURCE_FILES 
    ${updater_service_HEADER_FILES} 
    )

add_library(llupdaterservice
            ${updater_service_SOURCE_FILES}
            )

target_link_libraries(llupdaterservice
    ${LLCOMMON_LIBRARIES}
    ${LLMESSAGE_LIBRARIES}
    ${LLCOREHTTP_LIBRARIES}
    ${LLPLUGIN_LIBRARIES}
    ${LLVFS_LIBRARIES}
    )

if(LL_TESTS)
if (NOT LINUX)
  SET(llupdater_service_TEST_SOURCE_FILES
      llupdaterservice.cpp
      )

set(test_libs
    ${LLCOMMON_LIBRARIES}
    ${BOOST_COROUTINE_LIBRARY} 
    ${BOOST_CONTEXT_LIBRARY} 
    ${BOOST_THREAD_LIBRARY} 
    ${BOOST_SYSTEM_LIBRARY})

set_source_files_properties(
    llupdaterservice.cpp
    PROPERTIES
      LL_TEST_ADDITIONAL_LIBRARIES ${test_libs}
# *NOTE:Mani - I was trying to use the preprocessor seam to mock out
#              llifstream (and other) llcommon classes. It didn't work
#              because of the windows declspec(dllimport)attribute.
#     LL_TEST_ADDITIONAL_CFLAGS "-Dllifstream=llus_mock_llifstream"
    )

  LL_ADD_PROJECT_UNIT_TESTS(llupdaterservice "${llupdater_service_TEST_SOURCE_FILES}" ${test_libs})
endif (NOT LINUX)
endif(LL_TESTS)

set(UPDATER_INCLUDE_DIRS 
  ${LIBS_OPEN_DIR}/viewer_components/updater 
  CACHE INTERNAL ""
)

set(UPDATER_LIBRARIES 
  llupdaterservice
  CACHE INTERNAL ""
)