PageRenderTime 38ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/cmake/Linking.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 65 lines | 47 code | 7 blank | 11 comment | 6 complexity | 7d1f958cdf7b42e740238fc984318394 MD5 | raw file
Possible License(s): LGPL-2.1
  1. # -*- cmake -*-
  2. include(Variables)
  3. set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
  4. set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
  5. set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
  6. if (WINDOWS)
  7. set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
  8. set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
  9. elseif (LINUX)
  10. set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib)
  11. set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
  12. elseif (DARWIN)
  13. set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
  14. set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/\$(CONFIGURATION)")
  15. endif (WINDOWS)
  16. # Autobuild packages must provide 'release' versions of libraries, but may provide versions for
  17. # specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then
  18. # the 'release' directory (as a default fallback).
  19. # *NOTE - we have to take special care to use CMAKE_CFG_INTDIR on IDE generators (like mac and
  20. # windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is
  21. # that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and
  22. # CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators
  23. if(WINDOWS OR DARWIN)
  24. # the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
  25. # fortunately both windows and darwin are case insensitive filesystems so this works.
  26. set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/")
  27. else(WINDOWS OR DARWIN)
  28. # else block is for linux and any other makefile based generators
  29. string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
  30. set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
  31. endif(WINDOWS OR DARWIN)
  32. list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
  33. link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
  34. if (LINUX)
  35. set(DL_LIBRARY dl)
  36. set(PTHREAD_LIBRARY pthread)
  37. else (LINUX)
  38. set(DL_LIBRARY "")
  39. set(PTHREAD_LIBRARY "")
  40. endif (LINUX)
  41. if (WINDOWS)
  42. set(WINDOWS_LIBRARIES
  43. advapi32
  44. shell32
  45. ws2_32
  46. mswsock
  47. psapi
  48. winmm
  49. netapi32
  50. wldap32
  51. gdi32
  52. user32
  53. dbghelp
  54. )
  55. else (WINDOWS)
  56. set(WINDOWS_LIBRARIES "")
  57. endif (WINDOWS)
  58. mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)