changeset 0:0495feee881f

First version almost done. Need to make old_views aware of which Fractal type the view is for.
author Eris Caffee <discordia@eldalin.com>
date Sun, 17 Oct 2010 23:08:48 -0500
parents
children 455406f5f021
files .hgignore CMakeLists.txt
diffstat 2 files changed, 214 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Sun Oct 17 23:08:48 2010 -0500
     1.3 @@ -0,0 +1,5 @@
     1.4 +syntax: glob
     1.5 +
     1.6 +build*/*
     1.7 +*~
     1.8 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/CMakeLists.txt	Sun Oct 17 23:08:48 2010 -0500
     2.3 @@ -0,0 +1,209 @@
     2.4 +###############################################################################
     2.5 +#
     2.6 +# A generalized cmake file for developing cross-platform games.
     2.7 +#
     2.8 +# Copyright (c) 2010 Eris Caffee
     2.9 +# Permission is hereby granted, free of charge, to any person obtaining a copy
    2.10 +#  of this software and associated documentation files (the "Software"), to deal
    2.11 +#  in the Software without restriction, including without limitation the rights
    2.12 +#  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    2.13 +#  copies of the Software, and to permit persons to whom the Software is
    2.14 +#  furnished to do so, subject to the following conditions:
    2.15 +# The above copyright notice and this permission notice shall be included in
    2.16 +#  all copies or substantial portions of the Software.
    2.17 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    2.18 +#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    2.19 +#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    2.20 +#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    2.21 +#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    2.22 +#  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2.23 +#  THE SOFTWARE.
    2.24 +#
    2.25 +# Instructions:
    2.26 +# This cmake file assumes that your source files are laid in out in the 
    2.27 +# following manner:
    2.28 +#
    2.29 +#   project_dir\		Top level directory of the project.
    2.30 +#     |---include\		Header files are here.
    2.31 +#     |---src\			Source files are here.
    2.32 +#     |---build\		Binaries/objects go here.  Run cmake from here.
    2.33 +#     !---cmake\
    2.34 +#     |     |---modules\        Custom cmake include files, if any, go here.
    2.35 +#     |---CMakeLists.txt	This file.
    2.36 +#
    2.37 +# You may have more directories, of course, but these are assumed.  You probably
    2.38 +# want more than one build directory.  I normally have build-linux\ 
    2.39 +# and build-windows\ directories.
    2.40 +#
    2.41 +# Set the App_Name variable, below, to the name of your application and you
    2.42 +# are ready to start.  Run ccmake, or cmake-gui from within your build
    2.43 +# directory, choose the options you need, such as enabling SDL, and you 
    2.44 +# should be good to go.
    2.45 +#
    2.46 +# You can uncomment the "SET (CMAKE_VERBOSE_MAKEFILE ON) command if you
    2.47 +# need to debug the actual makefile that is generated.
    2.48 +#
    2.49 +# On windows, you may need to set the SDLDIR environment variable to the location
    2.50 +# of your SDL installation before you run cmake-gui.
    2.51 +#
    2.52 +# When writing path names on Windows, such as when manually specifiying a 
    2.53 +# file or directory name, either use unix-style forward slashes '/' in the
    2.54 +# path names or use double backslashes. If you use a single backslash as the
    2.55 +# path name seperator, then cmake will interpret  it as an esacpe sequence.
    2.56 +# Thus, write "C:/source" or "C:\\source" instead of "C:\source".  It's
    2.57 +# probably best to use forward slashes in case to ever have a situation
    2.58 +# where cmake needs to do recursive processing: each level of cmake will
    2.59 +# strip out one of the slashes, so if there are two lev3els of cmake you
    2.60 +# need to write \\\, three levels requires \\\\, etc.
    2.61 +#
    2.62 +# Note that some of the cmake support scripts that find libraries for you
    2.63 +# can be controlled by environment variables.  For example, you can set the
    2.64 +# SDLDIR environment variable before running cmake in order to point to
    2.65 +# a different version of SDL than your systems default copy. This is useful
    2.66 +# for trying out cutting edge versions of libraries without installing them
    2.67 +# system wide.
    2.68 +
    2.69 +cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
    2.70 +#set (CMAKE_VERBOSE_MAKEFILE ON)
    2.71 +
    2.72 +# Name your program!
    2.73 +set (App_Name "mandelbrot")
    2.74 +if (App_Name STREQUAL "") 
    2.75 +  message (FATAL_ERROR "You must set the App_Name variable!")
    2.76 +endif ()
    2.77 +
    2.78 +# Every project must have a name.
    2.79 +project (${App_Name})
    2.80 +
    2.81 +
    2.82 +################################################################################
    2.83 +# Ensure that we are not building in our source directories.
    2.84 +
    2.85 +set (Build_Dir_OK "TRUE")
    2.86 +string (REGEX MATCH "^${CMAKE_SOURCE_DIR}" In_Sub_Dir ${CMAKE_BINARY_DIR})
    2.87 +if (In_Sub_Dir)
    2.88 +  string (REGEX MATCH "^${CMAKE_SOURCE_DIR}/build" In_Build_Dir ${CMAKE_BINARY_DIR})
    2.89 +  if (NOT In_Build_Dir)
    2.90 +    set (Build_Dir_OK "FALSE")
    2.91 +  endif ()
    2.92 +endif ()
    2.93 +
    2.94 +if (NOT Build_Dir_OK)
    2.95 +  message (FATAL_ERROR "You must run cmake from a directory that is not in your source tree, or that is in a special subdirectory of the tree whose name begins with 'build'.")
    2.96 +endif ()
    2.97 +
    2.98 +
    2.99 +################################################################################
   2.100 +# Set up the basic build environment
   2.101 +# A build type defines which options are passed to the compiler, and there are
   2.102 +# several that CMake defines by default. It does not set one by default, though
   2.103 +# so we need to set the build type manually here, and we are setting it to the
   2.104 +# generally useful "Release with debug info"
   2.105 +
   2.106 +if (CMAKE_BUILD_TYPE STREQUAL "")
   2.107 +  # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This messes up
   2.108 +  # differentiation between debug and release builds.               
   2.109 +  set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
   2.110 +endif ()
   2.111 +
   2.112 +
   2.113 +################################################################################
   2.114 +# The core project files 
   2.115 +
   2.116 +file (GLOB SRCS src/*.c src/*.cpp)
   2.117 +file (GLOB HDRS include/*.h include/*.hpp)
   2.118 +
   2.119 +# The directories that contain the libraries we will be linking against.
   2.120 +# This must come before the ADD_EXECUTABLE directive.
   2.121 +link_directories (
   2.122 +  )
   2.123 +
   2.124 +# The directories that contain the include files our programs use.
   2.125 +# This must come before the ADD_EXECUTABLE directive.
   2.126 +include_directories (
   2.127 +  ${CMAKE_SOURCE_DIR}/include
   2.128 +  )
   2.129 +
   2.130 +# Define the executable program file we are creating.  We must list all of
   2.131 +# the source files.
   2.132 +if (WIN32)
   2.133 +  add_executable (${App_Name} WIN32
   2.134 +    ${SRCS}
   2.135 +    ${HDRS}
   2.136 +    )
   2.137 +else ()
   2.138 +  add_executable (${App_Name}
   2.139 +    ${SRCS}
   2.140 +    ${HDRS}
   2.141 +    )
   2.142 +endif ()
   2.143 +
   2.144 +# Although we listed the library  directories above, we also need to list the
   2.145 +# individual libraries we will be linking against.
   2.146 +target_link_libraries (${App_Name}
   2.147 +)
   2.148 +
   2.149 +
   2.150 +################################################################################
   2.151 +# SDL Support
   2.152 +#
   2.153 +# Enabling SDL support enables several suboptions to make some common SDL
   2.154 +# extension libraries available as well. 
   2.155 +#
   2.156 +# If any of the SDL libraries are not found automatically, you will need
   2.157 +# to set the appropriate environment variables and rerun cmake.  You will
   2.158 +# need to remove the CMake cache before doing so.
   2.159 +
   2.160 +# If you don't want to set actual environment variables before running
   2.161 +# CMake, then uncomment the if block below and put in the actual
   2.162 +# locations of your SDL installation.
   2.163 +
   2.164 +# if (WIN32)
   2.165 +#   set (ENV{SDLDIR} "c:\gamedev\deps\sdl\SDL-build")
   2.166 +# else ()
   2.167 +#   set (ENV{SDLDIR} "/home/eris/gamedev/deps/sdl/SDL-build")
   2.168 +# endif ()
   2.169 +
   2.170 +option(Option_SDL_Dev "Build an SDL application." OFF)
   2.171 +
   2.172 +if (Option_SDL_Dev)
   2.173 +
   2.174 +  # SDL base package
   2.175 +  # To use a version of SDL other than your systems default, set the SDLDIR
   2.176 +  # environment variable to the installation location of your preferred version.
   2.177 +  find_package (SDL)
   2.178 +  if (NOT SDL_FOUND)
   2.179 +    message (FATAL_ERROR "SDL not found!")
   2.180 +  endif (NOT SDL_FOUND)
   2.181 +  include_directories(
   2.182 +    ${SDL_INCLUDE_DIR}
   2.183 +    ${INCLUDE_DIRECTORIES}
   2.184 +    )
   2.185 +  target_link_libraries(${App_Name}
   2.186 +    ${SDL_LIBRARY}
   2.187 +    ${TARGET_LINK_LIBRARIES}
   2.188 +    )
   2.189 +
   2.190 +  # SDL_image
   2.191 +  # Environment variables SDLIMAGEDIR and SDLDIR will be checked in that order
   2.192 +  # and if set cmake will try to find SDL_image in the specified directory.
   2.193 +  OPTION(Option_SDL_Dev_SDL_image "Use SDL_image." OFF)
   2.194 +  IF (Option_SDL_Dev_SDL_image)
   2.195 +    FIND_PACKAGE (SDL_image)
   2.196 +    IF (NOT SDLIMAGE_FOUND)
   2.197 +      MESSAGE (FATAL_ERROR "SDL_image not found!")
   2.198 +    ENDIF (NOT SDLIMAGE_FOUND)
   2.199 +    INCLUDE_DIRECTORIES(
   2.200 +      ${SDLIMAGE_INCLUDE_DIR}
   2.201 +      ${INCLUDE_DIRECTORIES}
   2.202 +      )
   2.203 +    TARGET_LINK_LIBRARIES(${App_Name}
   2.204 +      ${SDLIMAGE_LIBRARY}
   2.205 +      ${TARGET_LINK_LIBRARIES}
   2.206 +      )
   2.207 +  ENDIF (Option_SDL_Dev_SDL_image)
   2.208 +
   2.209 +endif (Option_SDL_Dev)
   2.210 +
   2.211 +
   2.212 +################################################################################