PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/integration_tests/llimage_libtest/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 125 lines | 96 code | 17 blank | 12 comment | 6 complexity | eab8bb469ba73336a0278f0e6563079e MD5 | raw file
  1# -*- cmake -*-
  2
  3# Integration tests of the llimage library (JPEG2000, PNG, jpeg, etc... images reading and writing)
  4
  5project (llimage_libtest)
  6
  7include(00-Common)
  8include(LLCommon)
  9include(LLImage)
 10include(LLImageJ2COJ) 
 11include(LLKDU)
 12include(LLVFS)
 13
 14include_directories(
 15    ${LLCOMMON_INCLUDE_DIRS}
 16    ${LLVFS_INCLUDE_DIRS}
 17    ${LLIMAGE_INCLUDE_DIRS}
 18    )
 19
 20set(llimage_libtest_SOURCE_FILES
 21    llimage_libtest.cpp
 22    )
 23
 24set(llimage_libtest_HEADER_FILES
 25    CMakeLists.txt
 26    llimage_libtest.h
 27    )
 28
 29set_source_files_properties(${llimage_libtest_HEADER_FILES}
 30                            PROPERTIES HEADER_FILE_ONLY TRUE)
 31
 32list(APPEND llimage_libtest_SOURCE_FILES ${llimage_libtest_HEADER_FILES})
 33
 34add_executable(llimage_libtest
 35    WIN32
 36    MACOSX_BUNDLE
 37    ${llimage_libtest_SOURCE_FILES}
 38)
 39
 40set_target_properties(llimage_libtest
 41    PROPERTIES
 42    WIN32_EXECUTABLE
 43    FALSE
 44)
 45
 46# OS-specific libraries
 47if (DARWIN)
 48  include(CMakeFindFrameworks)
 49  find_library(COREFOUNDATION_LIBRARY CoreFoundation)
 50  set(OS_LIBRARIES ${COREFOUNDATION_LIBRARY})
 51elseif (WINDOWS)
 52  set(OS_LIBRARIES)
 53elseif (LINUX)
 54  set(OS_LIBRARIES)
 55else (DARWIN)
 56  message(FATAL_ERROR "Unknown platform")
 57endif (DARWIN)
 58
 59# Libraries on which this application depends on
 60# Sort by high-level to low-level
 61target_link_libraries(llimage_libtest
 62    ${LLCOMMON_LIBRARIES}
 63    ${LLVFS_LIBRARIES}
 64    ${LLIMAGE_LIBRARIES}
 65    ${LLKDU_LIBRARIES}
 66    ${KDU_LIBRARY}
 67    ${LLIMAGEJ2COJ_LIBRARIES}
 68    ${OS_LIBRARIES}
 69    )
 70    
 71if (DARWIN)
 72  # Path inside the app bundle where we'll need to copy libraries
 73  set(LLIMAGE_LIBTEST_DESTINATION_DIR
 74    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llimage_libtest.app/Contents/Resources
 75  )
 76  # Create the Contents/Resources directory
 77  add_custom_command(
 78    TARGET llimage_libtest POST_BUILD
 79    COMMAND ${CMAKE_COMMAND}
 80    ARGS
 81      -E
 82      make_directory
 83      ${LLIMAGE_LIBTEST_DESTINATION_DIR}
 84    COMMENT "Creating Resources directory in app bundle."
 85  ) 
 86else (DARWIN)
 87  set(LLIMAGE_LIBTEST_DESTINATION_DIR
 88    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
 89  )
 90endif (DARWIN)
 91
 92get_target_property(BUILT_LLCOMMON llcommon LOCATION)
 93add_custom_command(TARGET llimage_libtest POST_BUILD
 94  COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON}  ${LLIMAGE_LIBTEST_DESTINATION_DIR}
 95  DEPENDS ${BUILT_LLCOMMON}
 96)
 97
 98if (DARWIN)
 99  # Copy the required libraries to the package app
100  add_custom_command(TARGET llimage_libtest POST_BUILD
101    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
102    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib
103  )
104  add_custom_command(TARGET llimage_libtest POST_BUILD
105    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
106    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib
107  )
108  add_custom_command(TARGET llimage_libtest POST_BUILD
109    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
110    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib
111  )
112  add_custom_command(TARGET llimage_libtest POST_BUILD
113    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
114    DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib
115  )
116endif (DARWIN)
117
118if (WINDOWS)
119  # Check indra/test_apps/llplugintest/CMakeLists.txt for an example of what to copy over for Windows and how
120endif (WINDOWS)
121
122# Ensure people working on the viewer don't break this library
123# *NOTE: This could be removed, or only built by TeamCity, if the build
124# and link times become too long.
125add_dependencies(viewer llimage_libtest)