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

游戏引擎

开发平台:

C++ Builder

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