PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/integration_tests/llui_libtest/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 115 lines | 86 code | 16 blank | 13 comment | 4 complexity | 1c2e956adabe6e020dd7a4ba9014227a MD5 | raw file
  1# -*- cmake -*-
  2
  3# Only set this up for viewer builds, because the llui library is most closely
  4# related to the viewer
  5if (VIEWER)
  6
  7project (llui_libtest)
  8
  9include(00-Common)
 10include(LLCommon)
 11include(LLImage)
 12include(LLImageJ2COJ)   # ugh, needed for images
 13include(LLKDU)
 14include(LLMath)
 15include(LLMessage)
 16include(LLRender)
 17include(LLWindow)
 18include(LLUI)
 19include(LLVFS)        # ugh, needed for LLDir
 20include(LLXML)
 21include(LLXUIXML)
 22include(Linking)
 23# include(Tut)
 24
 25include_directories(
 26    ${FREETYPE_INCLUDE_DIRS}
 27    ${LLCOMMON_INCLUDE_DIRS}
 28    ${LLIMAGE_INCLUDE_DIRS}
 29    ${LLMATH_INCLUDE_DIRS}
 30    ${LLRENDER_INCLUDE_DIRS}
 31    ${LLUI_INCLUDE_DIRS}
 32    ${LLVFS_INCLUDE_DIRS}
 33    ${LLWINDOW_INCLUDE_DIRS}
 34    ${LLXML_INCLUDE_DIRS}
 35    ${LLXUIXML_INCLUDE_DIRS}
 36    )
 37
 38set(llui_libtest_SOURCE_FILES
 39    llui_libtest.cpp
 40    llwidgetreg.cpp
 41    )
 42
 43set(llui_libtest_HEADER_FILES
 44    CMakeLists.txt
 45    llui_libtest.h
 46    llwidgetreg.h
 47    )
 48
 49set_source_files_properties(${llui_libtest_HEADER_FILES}
 50                            PROPERTIES HEADER_FILE_ONLY TRUE)
 51
 52list(APPEND llui_libtest_SOURCE_FILES ${llui_libtest_HEADER_FILES})
 53
 54add_executable(llui_libtest ${llui_libtest_SOURCE_FILES})
 55
 56# Link with OS-specific libraries for LLWindow dependency
 57if (DARWIN)
 58  find_library(COCOA_LIBRARY Cocoa)
 59  set(OS_LIBRARIES ${COCOA_LIBRARY})
 60elseif (WINDOWS)
 61  #ll_stack_trace needs this now...
 62  list(APPEND WINDOWS_LIBRARIES dbghelp)
 63  set(OS_LIBRARIES ${WINDOWS_LIBRARIES})
 64elseif (LINUX)
 65  set(OS_LIBRARIES)
 66else (DARWIN)
 67  message(FATAL_ERROR "unknown platform")
 68endif (DARWIN)
 69
 70# Libraries on which this library depends, needed for Linux builds
 71# Sort by high-level to low-level
 72target_link_libraries(llui_libtest
 73    llui
 74    llinventory
 75    llmessage
 76    ${LLRENDER_LIBRARIES}
 77    ${LLIMAGE_LIBRARIES}
 78    ${LLKDU_LIBRARIES}
 79    ${KDU_LIBRARY}
 80    ${LLIMAGEJ2COJ_LIBRARIES}
 81    ${OS_LIBRARIES}
 82    ${GOOGLE_PERFTOOLS_LIBRARIES}
 83    )
 84
 85if (WINDOWS)
 86    set_target_properties(llui_libtest
 87        PROPERTIES 
 88        LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
 89        LINK_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBCMTD"
 90        )
 91
 92    # Copy over OpenJPEG.dll
 93    # *NOTE: On Windows with VS2005, only the first comment prints
 94    set(OPENJPEG_RELEASE
 95        "${ARCH_PREBUILT_DIRS_RELEASE}/openjpeg.dll")
 96    add_custom_command( TARGET llui_libtest POST_BUILD
 97        COMMAND ${CMAKE_COMMAND} -E copy_if_different 
 98            ${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR}
 99        COMMENT "Copying OpenJPEG DLLs to binary directory"
100        )
101    set(OPENJPEG_DEBUG
102        "${ARCH_PREBUILT_DIRS_DEBUG}/openjpegd.dll")
103    add_custom_command( TARGET llui_libtest POST_BUILD
104        COMMAND ${CMAKE_COMMAND} -E copy_if_different 
105            ${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR}
106        )
107  
108endif (WINDOWS)
109
110# Ensure people working on the viewer don't break this library
111# *NOTE: This could be removed, or only built by Parabuild, if the build
112# and link times become too long. JC
113add_dependencies(viewer llui_libtest)
114
115endif (VIEWER)