summaryrefslogtreecommitdiff
path: root/indra/llcache/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcache/CMakeLists.txt')
-rw-r--r--indra/llcache/CMakeLists.txt98
1 files changed, 98 insertions, 0 deletions
diff --git a/indra/llcache/CMakeLists.txt b/indra/llcache/CMakeLists.txt
new file mode 100644
index 0000000000..ab84bd96a0
--- /dev/null
+++ b/indra/llcache/CMakeLists.txt
@@ -0,0 +1,98 @@
+# -*- cmake -*-
+
+project(llcache)
+
+include(00-Common)
+include(LLCommon)
+include(UnixInstall)
+
+include_directories(
+ ${LLCOMMON_INCLUDE_DIRS}
+ ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
+ )
+
+set(llcache_SOURCE_FILES
+ lldir.cpp
+ lldiriterator.cpp
+ lllfsthread.cpp
+ llpidlock.cpp
+ llvfile.cpp
+ )
+
+set(llcache_HEADER_FILES
+ CMakeLists.txt
+
+ lldir.h
+ lldirguard.h
+ lldiriterator.h
+ lllfsthread.h
+ llpidlock.h
+ llvfile.h
+ )
+
+if (DARWIN)
+ LIST(APPEND llcache_SOURCE_FILES lldir_mac.cpp)
+ LIST(APPEND llcache_HEADER_FILES lldir_mac.h)
+endif (DARWIN)
+
+if (LINUX)
+ LIST(APPEND llcache_SOURCE_FILES lldir_linux.cpp)
+ LIST(APPEND llcache_HEADER_FILES lldir_linux.h)
+
+ if (INSTALL)
+ set_source_files_properties(lldir_linux.cpp
+ PROPERTIES COMPILE_FLAGS
+ "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\""
+ )
+ endif (INSTALL)
+endif (LINUX)
+
+if (WINDOWS)
+ LIST(APPEND llcache_SOURCE_FILES lldir_win32.cpp)
+ LIST(APPEND llcache_HEADER_FILES lldir_win32.h)
+endif (WINDOWS)
+
+set_source_files_properties(${llcache_HEADER_FILES}
+ PROPERTIES HEADER_FILE_ONLY TRUE)
+
+list(APPEND llcache_SOURCE_FILES ${llcache_HEADER_FILES})
+
+add_library (llcache ${llcache_SOURCE_FILES})
+
+set(cache_BOOST_LIBRARIES
+ ${BOOST_FILESYSTEM_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY}
+ )
+
+target_link_libraries(llcache
+ ${LLCOMMON_LIBRARIES}
+ ${cache_BOOST_LIBRARIES}
+ )
+
+if (DARWIN)
+ include(CMakeFindFrameworks)
+ find_library(COCOA_LIBRARY Cocoa)
+ target_link_libraries(llcache ${COCOA_LIBRARY})
+endif (DARWIN)
+
+
+# Add tests
+if (LL_TESTS)
+ include(LLAddBuildTest)
+ # UNIT TESTS
+ SET(llcache_TEST_SOURCE_FILES
+ lldiriterator.cpp
+ )
+
+ set_source_files_properties(lldiriterator.cpp
+ PROPERTIES
+ LL_TEST_ADDITIONAL_LIBRARIES "${cache_BOOST_LIBRARIES}"
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(llcache "${llcache_TEST_SOURCE_FILES}")
+
+ # INTEGRATION TESTS
+ set(test_libs llmath llcommon llcache ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
+
+ # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
+ LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}")
+endif (LL_TESTS)