Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/media/CMakeLists.txt @ 2711

Last change on this file since 2711 was 2711, checked in by rgrieder, 15 years ago

Looking at too many places when finding the package or media folder witch FIND_PATH.

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1 #
2 #             ORXONOX - the hottest 3D action shooter ever to exist
3 #                             > www.orxonox.net <
4 #
5 #        This program is free software; you can redistribute it and/or
6 #         modify it under the terms of the GNU General Public License
7 #        as published by the Free Software Foundation; either version 2
8 #            of the License, or (at your option) any later version.
9 #
10 #       This program is distributed in the hope that it will be useful,
11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #                 GNU General Public License for more details.
14 #
15 #   You should have received a copy of the GNU General Public License along
16 #      with this program; if not, write to the Free Software Foundation,
17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 #
19 #
20 #  Author:
21 #    Reto Grieder
22 #  Description:
23 #    Finds the media directory and configures it's installation.
24 #
25
26# This directory has to concur with the name set in BuildConfig.cmake
27IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}/${DEFAULT_MEDIA_PATH}")
28  MESSAGE(FATAL_ERROR "Value of DEFAULT_MEDIA_PATH does not concur with the name of the media directory in the source tree")
29ENDIF()
30
31# Specify media directory
32GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../media ABSOLUTE)
33FIND_PATH(CMAKE_MEDIA_OUTPUT_DIRECTORY resources.cfg
34  PATHS
35    ${CMAKE_CURRENT_SOURCE_DIR}
36    ${_search_path_1}
37  NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
38)
39IF(NOT CMAKE_MEDIA_OUTPUT_DIRECTORY)
40  MESSAGE(STATUS "Warning: Media directory not found. If you want to compile while downloading the media files, you must specify the directory by Hand BEFORE compiling! Default location is orxonox_root/media")
41  # Temporary override to the default location.
42  SET(CMAKE_MEDIA_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/media)
43  SET(CMAKE_MEDIA_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/media PARENT_SCOPE)
44ENDIF()
45
46
47################ Installation #################
48
49# Try no to copy both tcl script file libraries
50IF(TCL_LIBRARY MATCHES "85|8\\.5")
51  SET(TCL_EXCLUDE_PATTERN "tcl8\\.4")
52ELSEIF(TCL_LIBRARY MATCHES "84|8\\.4")
53  SET(TCL_EXCLUDE_PATTERN "tcl8\\.5")
54ENDIF()
55
56INSTALL(
57  DIRECTORY ${CMAKE_MEDIA_OUTPUT_DIRECTORY}/
58  DESTINATION ${ORXONOX_MEDIA_INSTALL_PATH}
59  REGEX "\\.svn$|_svn$|backToPNG|${TCL_EXCLUDE_PATTERN}" EXCLUDE
60)
Note: See TracBrowser for help on using the repository browser.