Skip to content

Commit

Permalink
CMake install targets reworked, now Demos, Tools and media for both i…
Browse files Browse the repository at this point in the history
…nstalls properly (at least on windows).

added options for building Hikari and Awesomium plugins
UnitTest_TextureAnimations updated (layout added)
psd files in media moved to "vector" folder
removed some unused or old Media
  • Loading branch information
Altren committed Jan 11, 2010
1 parent 6b896e7 commit d295f53
Show file tree
Hide file tree
Showing 26 changed files with 195 additions and 147 deletions.
154 changes: 87 additions & 67 deletions CMake/InstallResources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,105 @@
##################################################################


#setup Plugin builds
function(install_file FILENAME)
install(FILES
${MYGUI_BINARY_DIR}/bin/debug/${FILENAME}
DESTINATION "bin${MYGUI_DEBUG_PATH}" CONFIGURATIONS Debug
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_RELEASE_PATH}" CONFIGURATIONS Release None ""
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/resources.xml
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
)
if (WIN32)
install(FILES
${MYGUI_BINARY_DIR}/bin/debug/${FILENAME}
DESTINATION "bin${MYGUI_DEBUG_PATH}" CONFIGURATIONS Debug
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_RELEASE_PATH}" CONFIGURATIONS Release None ""
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo
)
install(FILES
${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
DESTINATION "bin${MYGUI_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
)
else ()
install(FILES
${MYGUI_BINARY_DIR}/bin/${FILENAME}
DESTINATION "bin"
)
endif ()
endfunction(install_file)

if (WIN32)
set(MYGUI_MEDIA_PATH "media")
set(MYGUI_MEDIA_DIR_REL "../../${MYGUI_MEDIA_PATH}")
set(MYGUI_MEDIA_DIR_DBG "../../${MYGUI_MEDIA_PATH}")
if (MYGUI_RENDERSYSTEM EQUAL 2)
set(MYGUI_PLUGIN_DIR ".")
set(MYGUI_PLUGIN_OGRE_DIRECTX "Plugin=RenderSystem_Direct3D9")
endif()
elseif (UNIX)
set(MYGUI_MEDIA_PATH "share/MYGUI/media")
set(MYGUI_MEDIA_DIR_REL "../${MYGUI_MEDIA_PATH}")
set(MYGUI_MEDIA_DIR_DBG "../../${MYGUI_MEDIA_PATH}")
if (MYGUI_RENDERSYSTEM EQUAL 2)
set(MYGUI_PLUGIN_DIR "/usr/lib/OGRE")
set(MYGUI_PLUGIN_OGRE_DIRECTX "")
endif()
endif ()

# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
if (WIN32)
set(MYGUI_PLUGIN_DIR ".")
set(MYGUI_PLUGIN_OGRE_DIRECTX "Plugin=RenderSystem_Direct3D9")
elseif (UNIX)
set(MYGUI_PLUGIN_DIR "/usr/lib/OGRE")
set(MYGUI_PLUGIN_OGRE_DIRECTX "")
endif()
endif ()

# install resource files
if (MYGUI_INSTALL_SAMPLES OR MYGUI_INSTALL_TOOLS)
if (WIN32)
set(MYGUI_MEDIA_DIR "../../Media")
elseif (UNIX)
set(MYGUI_MEDIA_DIR "../share/MYGUI/Media")
else ()
set(MYGUI_MEDIA_DIR "../../Media")
endif ()
if (WIN32)
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
endif ()
else() # other OS only need one cfg file
string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
set(MYGUI_CFG_SUFFIX "_d")
endif ()
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg)
endif ()
endif ()

install_file (resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
install_file (plugins.cfg)
endif ()
endif ()
else ()

if (WIN32)
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/minsizerel/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/minsizerel/plugins.cfg)
endif ()
else() # other OS only need one cfg file
string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
set(MYGUI_CFG_SUFFIX "_d")
endif ()
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg)
set(MYGUI_MEDIA_DIR "${MYGUI_SOURCE_DIR}/Media")

if (WIN32)
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/resources.xml)
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/minsizerel/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/plugins.cfg)
configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/minsizerel/plugins.cfg)
endif ()
else() # other OS only need one cfg file
string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
set(MYGUI_CFG_SUFFIX "_d")
endif ()
# create resources.xml
configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)
if (MYGUI_RENDERSYSTEM EQUAL 2)
# create plugins.cfg
configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg)
endif ()
endif ()
endif ()

endif ()
117 changes: 58 additions & 59 deletions CMake/MyGUIInstallDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,71 @@
#####################################################

if (NOT WIN32)
return()
return()
endif()

set(MYGUI_DEP_CUR_DIR ${MYGUI_DEPENDENCIES_DIR})
set(MYGUI_DEP_BIN_DIR ${MYGUI_DEPENDENCIES_DIR}/../Samples/Common/bin)
set(MYGUI_DEP_BIN_DIR ${MYGUI_DEPENDENCIES_DIR}/bin)

option(MYGUI_TRY_TO_COPY_DLLS "Copy dlls needed for sample builds" FALSE)

if (MYGUI_TRY_TO_COPY_DLLS)
if (MYGUI_STATIC)
# for static builds, projects must link against all MyGUI dependencies themselves, so copy full include and lib dir
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/include/ DESTINATION include)
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/lib/ DESTINATION lib)

else ()
# for non-static builds, we only need OIS for the samples
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/include/OIS DESTINATION include)
install(FILES
${MYGUI_DEP_CUR_DIR}/lib/debug/OIS_d.lib
DESTINATION lib/debug CONFIGURATIONS Debug
)
install(FILES
${MYGUI_DEP_CUR_DIR}/lib/release/OIS.lib
DESTINATION lib/release CONFIGURATIONS Release RelWithDebInfo MinSizeRel None ""
)
endif ()

if (EXISTS ${OGRE_LIB_DIR}/../bin/debug/OgreMain_d.dll)
set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR}/../bin/debug)
set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR}/../bin/release)
elseif (EXISTS "${OGRE_LIB_DIR}/OgreMain_d.dll")
set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR})
set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR})
else ()
return()
endif ()

# copy the dependency DLLs to the right places
install(FILES
${MYGUI_DEP_BIN_DIR}/debug/OIS_d.dll
${DEBUG_DLLS_DIR}/OgreMain_d.dll
${DEBUG_DLLS_DIR}/RenderSystem_Direct3D9_d.dll
${DEBUG_DLLS_DIR}/RenderSystem_GL_d.dll
DESTINATION bin/debug CONFIGURATIONS Debug
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/release CONFIGURATIONS Release None ""
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
)
if (MYGUI_STATIC)
# for static builds, projects must link against all MyGUI dependencies themselves, so copy full include and lib dir
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/include/ DESTINATION include)
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/lib/ DESTINATION lib)
else ()
# for non-static builds, we only need OIS for the samples
install(DIRECTORY ${MYGUI_DEP_CUR_DIR}/include/OIS DESTINATION include)
install(FILES
${MYGUI_DEP_CUR_DIR}/lib/debug/OIS_d.lib
DESTINATION lib/debug CONFIGURATIONS Debug
)
install(FILES
${MYGUI_DEP_CUR_DIR}/lib/release/OIS.lib
DESTINATION lib/release CONFIGURATIONS Release RelWithDebInfo MinSizeRel None ""
)
endif ()

if (EXISTS ${OGRE_LIB_DIR}/../bin/debug/OgreMain_d.dll)
set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR}/../bin/debug)
set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR}/../bin/release)
elseif (EXISTS "${OGRE_LIB_DIR}/OgreMain_d.dll")
set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR})
set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR})
else ()
return()
endif ()

# copy the dependency DLLs to the right places
install(FILES
${MYGUI_DEP_BIN_DIR}/debug/OIS_d.dll
${DEBUG_DLLS_DIR}/OgreMain_d.dll
${DEBUG_DLLS_DIR}/RenderSystem_Direct3D9_d.dll
${DEBUG_DLLS_DIR}/RenderSystem_GL_d.dll
DESTINATION bin/debug CONFIGURATIONS Debug
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/release CONFIGURATIONS Release None ""
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
)
install(FILES
${MYGUI_DEP_BIN_DIR}/release/OIS.dll
${RELEASE_DLLS_DIR}/OgreMain.dll
${RELEASE_DLLS_DIR}/RenderSystem_Direct3D9.dll
${RELEASE_DLLS_DIR}/RenderSystem_GL.dll
DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
)


configure_file(${MYGUI_DEP_BIN_DIR}/debug/OIS_d.dll ${MYGUI_BINARY_DIR}/bin/debug/OIS_d.dll COPYONLY)
Expand Down
4 changes: 2 additions & 2 deletions CMake/Templates/resources.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<Paths>
<Path root="true">@MYGUI_SOURCE_DIR@/Media</Path>
<Path>@MYGUI_SOURCE_DIR@/Media/MyGUI_Media</Path>
<Path root="true">@MYGUI_MEDIA_DIR@</Path>
<Path>@MYGUI_MEDIA_DIR@/MyGUI_Media</Path>
</Paths>
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ if (MYGUI_BUILD_DOCS)
endif ()

# Install media files
#if (MYGUI_INSTALL_MEDIA)
# add_subdirectory(Media)
#endif ()
if (MYGUI_INSTALL_MEDIA)
add_subdirectory(Media)
endif ()

# Install CMake modules
add_subdirectory(CMake)
Expand Down
1 change: 0 additions & 1 deletion Common/Base/Ogre/BaseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ namespace base
addResourceLocation(node->getContent());
}
}
addResourceLocation(mRootMedia + "/Common/packs/OgreCore.zip", "Bootstrap", "Zip", false);
}

bool BaseManager::frameStarted(const Ogre::FrameEvent& evt)
Expand Down
19 changes: 19 additions & 0 deletions Media/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################
# Install media
###############################################################

# Set media target directory
if (WIN32)
set(MYGUI_MEDIA_PATH "Media")
elseif (UNIX)
set(MYGUI_MEDIA_PATH "share/MYGUI/Media")
elseif (APPLE)
# TODO
endif ()

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION ${MYGUI_MEDIA_PATH}
PATTERN ".svn" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "vector" EXCLUDE
)
6 changes: 0 additions & 6 deletions Media/Common/Wallpapers/Wallpaper1.layout

This file was deleted.

Binary file removed Media/Common/Wallpapers/wallpaper1.png
Binary file not shown.
Binary file removed Media/Common/packs/OgreCore.zip
Binary file not shown.
Binary file added Media/Common/vector/MyGUI_Logo.bmp
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
10 changes: 10 additions & 0 deletions Media/UnitTests/UnitTest_TextureAnimations/Window.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="WindowCSMX" position="176 120 256 232" layer="RTT_Test" name="_Main">
<Property key="Widget_Caption" value="Window"/>
<Property key="Window_MinSize" value="100 100"/>
<Widget type="Edit" skin="WordWrap" position="4 4 239 188" align="Stretch">
<Property key="Widget_Caption" value="Controls:\n W - Create new window.\nV button on window to enlarge it.\nX button on window to close it.\nAlso try to resize window."/>
</Widget>
</Widget>
</MyGUI>
19 changes: 13 additions & 6 deletions Plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
option(MYGUI_BUILD_AWESOMIUM_PLUGIN "Build Plugin AwesomiumWidget" FALSE)
option(MYGUI_BUILD_HIKARI_PLUGIN "Build Plugin HikariWidget" FALSE)

add_subdirectory(Plugin_StrangeButton)

if(WIN32)
add_subdirectory(Plugin_HikariWidget)
endif(WIN32)
if (MYGUI_BUILD_HIKARI_PLUGIN)
if(WIN32)
add_subdirectory(Plugin_HikariWidget)
endif()
endif()

if(WIN32 OR APPLE)
add_subdirectory(Plugin_AwesomiumWidget)
endif(WIN32 OR APPLE)
if (MYGUI_BUILD_AWESOMIUM_PLUGIN)
if (WIN32 OR APPLE)
add_subdirectory(Plugin_AwesomiumWidget)
endif ()
endif()
Binary file modified Scripts/prepareRelease.exe
Binary file not shown.
Loading

0 comments on commit d295f53

Please sign in to comment.