CMakeLists.txt
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:4k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. # -*- cmake -*-
  2. project (test)
  3. include(00-Common)
  4. include(LLCommon)
  5. include(LLDatabase)
  6. include(LLInventory)
  7. include(LLMath)
  8. include(LLMessage)
  9. include(LLVFS)
  10. include(LLXML)
  11. include(LScript)
  12. include(Linking)
  13. include(Tut)
  14. include(GoogleMock)
  15. include_directories(
  16.     ${LLCOMMON_INCLUDE_DIRS}
  17.     ${LLDATABASE_INCLUDE_DIRS}
  18.     ${LLMATH_INCLUDE_DIRS}
  19.     ${LLMESSAGE_INCLUDE_DIRS}
  20.     ${LLINVENTORY_INCLUDE_DIRS}
  21.     ${LLVFS_INCLUDE_DIRS}
  22.     ${LLXML_INCLUDE_DIRS}
  23.     ${LSCRIPT_INCLUDE_DIRS}
  24.     ${GOOGLEMOCK_INCLUDE_DIRS}
  25.     )
  26. set(test_SOURCE_FILES
  27.     io.cpp
  28. #    llapp_tut.cpp # Temporarily removed until thread issues can be solved
  29.     llblowfish_tut.cpp
  30.     llbuffer_tut.cpp
  31.     lldoubledispatch_tut.cpp
  32.     llevents_tut.cpp
  33.     llhttpdate_tut.cpp
  34.     llhttpclient_tut.cpp
  35.     llhttpnode_tut.cpp
  36.     lliohttpserver_tut.cpp
  37.     llmessageconfig_tut.cpp
  38.     llpermissions_tut.cpp
  39.     llpipeutil.cpp
  40.     llsaleinfo_tut.cpp
  41.     llscriptresource_tut.cpp
  42.     llsdmessagebuilder_tut.cpp
  43.     llsdmessagereader_tut.cpp
  44.     llsd_new_tut.cpp
  45.     llsdutil_tut.cpp
  46.     llservicebuilder_tut.cpp
  47.     llstreamtools_tut.cpp
  48.     lltemplatemessagebuilder_tut.cpp
  49.     lltimestampcache_tut.cpp
  50.     lltranscode_tut.cpp
  51.     lltut.cpp
  52.     lluuidhashmap_tut.cpp
  53.     message_tut.cpp
  54.     test.cpp
  55.     )
  56. set(test_HEADER_FILES
  57.     CMakeLists.txt
  58.     debug.h
  59.     llpipeutil.h
  60.     llsdtraits.h
  61.     lltut.h
  62.     )
  63. if (NOT WINDOWS)
  64.   list(APPEND test_SOURCE_FILES
  65.        llmessagetemplateparser_tut.cpp
  66.        )
  67. endif (NOT WINDOWS)
  68. if (NOT DARWIN)
  69.   list(APPEND test_SOURCE_FILES
  70.     )
  71. endif (NOT DARWIN)
  72. set_source_files_properties(${test_HEADER_FILES}
  73.                             PROPERTIES HEADER_FILE_ONLY TRUE)
  74. list(APPEND test_SOURCE_FILES ${test_HEADER_FILES})
  75. add_executable(test ${test_SOURCE_FILES})
  76. target_link_libraries(test
  77.     ${LLDATABASE_LIBRARIES}
  78.     ${LLINVENTORY_LIBRARIES}
  79.     ${LLMESSAGE_LIBRARIES}
  80.     ${LLMATH_LIBRARIES}
  81.     ${LLVFS_LIBRARIES}
  82.     ${LLXML_LIBRARIES}
  83.     ${LSCRIPT_LIBRARIES}
  84.     ${LLCOMMON_LIBRARIES}
  85.     ${EXPAT_LIBRARIES}
  86.     ${GOOGLEMOCK_LIBRARIES}
  87.     ${APRICONV_LIBRARIES}
  88.     ${PTHREAD_LIBRARY}
  89.     ${WINDOWS_LIBRARIES}
  90.     ${BOOST_PROGRAM_OPTIONS_LIBRARY}
  91.     ${BOOST_REGEX_LIBRARY}
  92.     ${DL_LIBRARY}
  93.     ${GOOGLE_PERFTOOLS_LIBRARIES}
  94.     )
  95. if (WINDOWS)
  96.   set_target_properties(test
  97.           PROPERTIES 
  98.           LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
  99.           LINK_FLAGS_DEBUG "/NODEFAULTLIB:"LIBCMT;LIBCMTD;MSVCRT""
  100.           )
  101. endif (WINDOWS)
  102. get_target_property(TEST_EXE test LOCATION)
  103. IF(WINDOWS)
  104.   set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
  105. ELSEIF(DARWIN)
  106.   set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib)
  107. ELSE(WINDOWS)
  108.   set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib)
  109. ENDIF(WINDOWS)
  110. LL_TEST_COMMAND("${LD_LIBRARY_PATH}"
  111.   "${TEST_EXE}" "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt")
  112. ADD_CUSTOM_COMMAND(
  113.   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt
  114.   COMMAND ${LL_TEST_COMMAND_value}
  115.   DEPENDS test
  116.   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  117.   COMMENT "C++ unit tests"
  118.  )
  119. set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt)
  120. if (EXISTS /etc/debian_version_FAIL)
  121.   # The Python tests have all kinds of wacky non-portable assumptions
  122.   # built in.
  123.   add_custom_command(
  124.     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/py_tests_ok.txt
  125.     COMMAND ${PYTHON_EXECUTABLE}
  126.     ARGS
  127.       ${CMAKE_CURRENT_SOURCE_DIR}/test.py
  128.       --mode=static
  129.       --output=${CMAKE_CURRENT_BINARY_DIR}/py_test_results.txt
  130.       --touch=${CMAKE_CURRENT_BINARY_DIR}/py_tests_ok.txt
  131.       --mode=static
  132.     DEPENDS test.py
  133.     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  134.     COMMENT "Python unit tests"
  135.     )
  136.   list(APPEND test_results ${CMAKE_CURRENT_BINARY_DIR}/py_tests_ok.txt)
  137. endif (EXISTS /etc/debian_version_FAIL)
  138.     
  139. add_custom_target(tests_ok ALL DEPENDS ${test_results})