PageRenderTime 31ms CodeModel.GetById 22ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/llvfs/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 100 lines | 74 code | 21 blank | 5 comment | 6 complexity | 7874792a9378a863e29c4bcc05556316 MD5 | raw file
  1# -*- cmake -*-
  2
  3project(llvfs)
  4
  5include(00-Common)
  6include(LLCommon)
  7include(UnixInstall)
  8
  9include_directories(
 10    ${LLCOMMON_INCLUDE_DIRS}
 11    )
 12
 13set(llvfs_SOURCE_FILES
 14    lldir.cpp
 15    lldiriterator.cpp
 16    lllfsthread.cpp
 17    llpidlock.cpp
 18    llvfile.cpp
 19    llvfs.cpp
 20    llvfsthread.cpp
 21    )
 22
 23set(llvfs_HEADER_FILES
 24    CMakeLists.txt
 25
 26    lldir.h
 27    lldirguard.h
 28    lldiriterator.h
 29    lllfsthread.h
 30    llpidlock.h
 31    llvfile.h
 32    llvfs.h
 33    llvfsthread.h
 34    )
 35
 36if (DARWIN)
 37  LIST(APPEND llvfs_SOURCE_FILES lldir_mac.cpp)
 38  LIST(APPEND llvfs_HEADER_FILES lldir_mac.h)
 39endif (DARWIN)
 40
 41if (LINUX)
 42  LIST(APPEND llvfs_SOURCE_FILES lldir_linux.cpp)
 43  LIST(APPEND llvfs_HEADER_FILES lldir_linux.h)
 44
 45  if (VIEWER AND INSTALL)
 46    set_source_files_properties(lldir_linux.cpp
 47                                PROPERTIES COMPILE_FLAGS
 48                                "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\""
 49                                )
 50  endif (VIEWER AND INSTALL)
 51endif (LINUX)
 52
 53if (WINDOWS)
 54  LIST(APPEND llvfs_SOURCE_FILES lldir_win32.cpp)
 55  LIST(APPEND llvfs_HEADER_FILES lldir_win32.h)
 56endif (WINDOWS)
 57
 58set_source_files_properties(${llvfs_HEADER_FILES}
 59                            PROPERTIES HEADER_FILE_ONLY TRUE)
 60
 61list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES})
 62
 63add_library (llvfs ${llvfs_SOURCE_FILES})
 64
 65set(vfs_BOOST_LIBRARIES
 66    ${BOOST_FILESYSTEM_LIBRARY}
 67    ${BOOST_SYSTEM_LIBRARY}
 68    )
 69
 70target_link_libraries(llvfs
 71    ${vfs_BOOST_LIBRARIES}
 72    )
 73
 74if (DARWIN)
 75  include(CMakeFindFrameworks)
 76  find_library(CARBON_LIBRARY Carbon)
 77  target_link_libraries(llvfs ${CARBON_LIBRARY})
 78endif (DARWIN)
 79
 80
 81# Add tests
 82if (LL_TESTS)
 83    include(LLAddBuildTest)
 84    # UNIT TESTS
 85    SET(llvfs_TEST_SOURCE_FILES
 86    lldiriterator.cpp
 87    )
 88
 89    set_source_files_properties(lldiriterator.cpp
 90    PROPERTIES
 91    LL_TEST_ADDITIONAL_LIBRARIES "${vfs_BOOST_LIBRARIES}"
 92    )
 93    LL_ADD_PROJECT_UNIT_TESTS(llvfs "${llvfs_TEST_SOURCE_FILES}")
 94
 95    # INTEGRATION TESTS
 96    set(test_libs llmath llcommon llvfs ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
 97
 98    # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
 99    LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}")
100endif (LL_TESTS)