diff options
author | Don Kjer <don@lindenlab.com> | 2012-10-04 06:29:07 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2012-10-04 06:29:07 +0000 |
commit | 21df924a10c1c32f7fc28bb29b20dc2179863b24 (patch) | |
tree | 1e3786d1da78129a73903bfa083e52423fe89a68 | |
parent | 6d613b61d76c1909021983901920b6b1dc2c80f4 (diff) |
Building headless and non-headless libraries side-by-side, removing the need for the BAKING cmake setting.
-rw-r--r-- | indra/CMakeLists.txt | 22 | ||||
-rw-r--r-- | indra/cmake/LLAppearance.cmake | 10 | ||||
-rw-r--r-- | indra/cmake/LLRender.cmake | 26 | ||||
-rw-r--r-- | indra/cmake/LLWindow.cmake | 30 | ||||
-rw-r--r-- | indra/cmake/OpenGL.cmake | 10 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 3 | ||||
-rw-r--r-- | indra/llappearance/CMakeLists.txt | 16 | ||||
-rw-r--r-- | indra/llrender/CMakeLists.txt | 34 | ||||
-rw-r--r-- | indra/llwindow/CMakeLists.txt | 47 | ||||
-rwxr-xr-x | indra/newview/CMakeLists.txt | 6 |
10 files changed, 106 insertions, 98 deletions
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 9ea611df6c..12fee2029f 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -108,28 +108,8 @@ endif (LINUX) add_subdirectory(${VIEWER_PREFIX}newview) add_dependencies(viewer secondlife-bin) -# Linux builds the viewer and server in 2 separate projects -# In order for build server to work on linux, -# the viewer project needs a server target. -# This is not true for mac and windows. -# *TODO: Do something like this for BAKING? -#if (LINUX) -# add_custom_target(server) -#endif (LINUX) -#if (SERVER) -# if (NOT LINUX) -# add_custom_target(server) -# endif (NOT LINUX) -# include(${SERVER_PREFIX}Server.cmake) -# -# # Windows builds include tools like VFS tool -# if (WINDOWS) -# add_subdirectory(${SERVER_PREFIX}tools) -# endif (WINDOWS) -#endif (SERVER) - if (LL_TESTS) - # Define after the custom viewer and server targets are created so + # Define after the custom targets are created so # individual apps can add themselves as dependencies add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests) endif (LL_TESTS) diff --git a/indra/cmake/LLAppearance.cmake b/indra/cmake/LLAppearance.cmake index 36cebe9816..bd3795a526 100644 --- a/indra/cmake/LLAppearance.cmake +++ b/indra/cmake/LLAppearance.cmake @@ -1,7 +1,17 @@ # -*- cmake -*- +include(Variables) + set(LLAPPEARANCE_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llappearance ) +if (BUILD_HEADLESS) + set(LLAPPEARANCE_HEADLESS_LIBRARIES + llappearanceheadless + ) +endif (BUILD_HEADLESS) + set(LLAPPEARANCE_LIBRARIES llappearance) + + diff --git a/indra/cmake/LLRender.cmake b/indra/cmake/LLRender.cmake index c2f6fc67cd..ae71ee4c0d 100644 --- a/indra/cmake/LLRender.cmake +++ b/indra/cmake/LLRender.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- +include(Variables) include(FreeType) include(GLH) @@ -8,27 +9,12 @@ set(LLRENDER_INCLUDE_DIRS ${GLH_INCLUDE_DIR} ) -if ((BAKING) AND LINUX) - set(LLRENDER_LIBRARIES - llrenderheadless - ) -else ((BAKING) AND LINUX) +if (BUILD_HEADLESS) + set(LLRENDER_HEADLESS_LIBRARIES + llrenderheadless + ) +endif (BUILD_HEADLESS) set(LLRENDER_LIBRARIES llrender ) -endif ((BAKING) AND LINUX) -# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set -# differently for different object files. -macro (copy_server_sources ) - foreach (PREFIX ${ARGV}) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp - ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}_server.cpp - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}.cpp - ) - list(APPEND server_SOURCE_FILES ${PREFIX}_server.cpp) - endforeach (PREFIX ${_copied_SOURCES}) -endmacro (copy_server_sources _copied_SOURCES) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 81e58b2bea..f6c40c174c 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- +include(Variables) include(GLEXT) include(Prebuilt) @@ -22,28 +23,21 @@ else (STANDALONE) endif (LINUX) endif (STANDALONE) -if (SDL_FOUND AND NOT BAKING) - add_definitions(-DLL_SDL=1) +if (SDL_FOUND) include_directories(${SDL_INCLUDE_DIR}) -endif (SDL_FOUND AND NOT BAKING) - -if (BAKING) - use_prebuilt_binary(mesa) - add_definitions(-DLL_MESA_HEADLESS=1) -endif (BAKING) +endif (SDL_FOUND) set(LLWINDOW_INCLUDE_DIRS ${GLEXT_INCLUDE_DIR} ${LIBS_OPEN_DIR}/llwindow ) -if (BAKING AND LINUX) - set(LLWINDOW_LIBRARIES - llwindowheadless - ) - MESSAGE( STATUS "using headless libraries") -else (BAKING AND LINUX) - set(LLWINDOW_LIBRARIES - llwindow - ) -endif (BAKING AND LINUX) +if (BUILD_HEADLESS) + set(LLWINDOW_HEADLESS_LIBRARIES + llwindowheadless + ) +endif (BUILD_HEADLESS) + +set(LLWINDOW_LIBRARIES + llwindow + ) diff --git a/indra/cmake/OpenGL.cmake b/indra/cmake/OpenGL.cmake index bafb2a460f..181b10b91c 100644 --- a/indra/cmake/OpenGL.cmake +++ b/indra/cmake/OpenGL.cmake @@ -1,15 +1,13 @@ # -*- cmake -*- -#if (INSTALL_PROPRIETARY) -# set(HEADLESS ON CACHE BOOL "Use headless mesa library.") -#endif (INSTALL_PROPRIETARY) - +include(Variables) include(Prebuilt) -if (LINUX AND NOT STANDALONE) +if (BUILD_HEADLESS) use_prebuilt_binary(mesa) SET(OPENGL_glu_LIBRARY GLU) -endif (LINUX AND NOT STANDALONE) + SET(OPENGL_HEADLESS_LIBRARIES OSMesa16 GLU) +endif (BUILD_HEADLESS) include(FindOpenGL) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index d570a8cde4..0bcb3a38b0 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -48,6 +48,9 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) # We use this as a marker that you can try to use the proprietary libraries. set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries") endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake) +if (INSTALL_PROPRIETARY) + set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") +endif (INSTALL_PROPRIETARY) set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py") set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template") diff --git a/indra/llappearance/CMakeLists.txt b/indra/llappearance/CMakeLists.txt index c570f0c93b..0dbd58b7cd 100644 --- a/indra/llappearance/CMakeLists.txt +++ b/indra/llappearance/CMakeLists.txt @@ -89,6 +89,22 @@ target_link_libraries(llappearance ${LLCOMMON_LIBRARIES} ) +if (BUILD_HEADLESS) + add_library (llappearanceheadless ${llappearance_SOURCE_FILES}) + + target_link_libraries(llappearanceheadless + ${LLCHARACTER_LIBRARIES} + ${LLINVENTORY_LIBRARIES} + ${LLIMAGE_LIBRARIES} + ${LLRENDERHEADLESS_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLXML_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} + ) +endif (BUILD_HEADLESS) + #add unit tests #if (LL_TESTS) # INCLUDE(LLAddBuildTest) diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 3ba2722201..46dde5a0d9 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -83,36 +83,36 @@ list(APPEND llrender_SOURCE_FILES llrender.cpp llrendertarget.cpp ) -if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) - copy_server_sources( - llgl - llrender - ) - - set_source_files_properties( - ${server_SOURCE_FILES} - PROPERTIES - COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1" - ) +if (BUILD_HEADLESS) add_library (llrenderheadless ${llrender_SOURCE_FILES} - ${server_SOURCE_FILES} ) -target_link_libraries(llrenderheadless + set_property(TARGET llrenderheadless + PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 + ) + + target_link_libraries(llrenderheadless ${LLCOMMON_LIBRARIES} ${LLIMAGE_LIBRARIES} ${LLMATH_LIBRARIES} - ${LLRENDER_LIBRARIES} + ${LLRENDER_HEADLESS_LIBRARIES} ${LLVFS_LIBRARIES} ${LLXML_LIBRARIES} ${LLVFS_LIBRARIES} - ${LLWINDOW_LIBRARIES} - ${OPENGL_LIBRARIES}) + ${LLWINDOW_HEADLESS_LIBRARIES} + ${OPENGL_HEADLESS_LIBRARIES}) -endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) +endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) + +if (SDL_FOUND) + set_property(TARGET llrender + PROPERTY COMPILE_DEFINITIONS LL_SDL=1 + ) +endif (SDL_FOUND) + # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llrender diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 5fef44f9cb..be74bbb541 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -38,6 +38,7 @@ set(llwindow_SOURCE_FILES llkeyboardheadless.cpp llwindowheadless.cpp llwindowcallbacks.cpp + llwindow.cpp ) set(llwindow_HEADER_FILES @@ -50,7 +51,6 @@ set(llwindow_HEADER_FILES ) set(viewer_SOURCE_FILES - llwindow.cpp llmousehandler.cpp ) @@ -75,6 +75,20 @@ if (LINUX) ${SDL_LIBRARY} fontconfig # For FCInit and other FC* functions. ) + + if (BUILD_HEADLESS) + set(llwindowheadless_LINK_LIBRARIES + ${LLCOMMON_LIBRARIES} + ${LLIMAGE_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLRENDER_HEADLESS_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLWINDOW_HEADLESS_LIBRARIES} + ${LLXML_LIBRARIES} + ${UI_LIBRARIES} # for GTK + fontconfig # For FCInit and other FC* functions. + ) + endif (BUILD_HEADLESS) endif (LINUX) if (DARWIN) @@ -140,30 +154,24 @@ endif (SOLARIS) set_source_files_properties(${llwindow_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) - set(server_SOURCE_FILES +if (BUILD_HEADLESS) + set(llwindowheadless_SOURCE_FILES llwindowmesaheadless.cpp llmousehandler.cpp ) - set(server_HEADER_FILES + set(llwindowheadless_HEADER_FILES llwindowmesaheadless.h llmousehandler.h ) - copy_server_sources( - llwindow - ) - - set_source_files_properties( - ${server_SOURCE_FILES} - PROPERTIES - COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1" - ) add_library (llwindowheadless ${llwindow_SOURCE_FILES} - ${server_SOURCE_FILES} + ${llwindowheadless_SOURCE_FILES} + ) + set_property(TARGET llwindowheadless + PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 ) - target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES} OSMesa16 dl) -endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) + target_link_libraries (llwindowheadless ${llwindowheadless_LINK_LIBRARIES} dl) +endif (BUILD_HEADLESS) if (llwindow_HEADER_FILES) list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) @@ -175,5 +183,12 @@ add_library (llwindow ${llwindow_SOURCE_FILES} ${viewer_SOURCE_FILES} ) + +if (SDL_FOUND) + set_property(TARGET llwindow + PROPERTY COMPILE_DEFINITIONS LL_SDL=1 + ) +endif (SDL_FOUND) + target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 83b38e89f9..25feb24788 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1539,6 +1539,12 @@ add_executable(${VIEWER_BINARY_NAME} ${viewer_SOURCE_FILES} ) +if (SDL_FOUND) + set_property(TARGET ${VIEWER_BINARY_NAME} + PROPERTY COMPILE_DEFINITIONS LL_SDL=1 + ) +endif (SDL_FOUND) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) |