make indents consistent in cake.. also put a glaring note that the MRUBY support needs to be finished.

This commit is contained in:
Edward Rudd 2014-01-01 10:46:33 -05:00
parent a18497ca7b
commit 835ea686c8
1 changed files with 188 additions and 187 deletions

View File

@ -15,33 +15,33 @@ include(cmake/PrepUtils.cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
IF("${CMAKE_SYSTEM}" MATCHES "Linux") IF("${CMAKE_SYSTEM}" MATCHES "Linux")
SET(LINUX ON) SET(LINUX ON)
SET(LINUX ON PARENT_SCOPE) SET(LINUX ON PARENT_SCOPE)
ENDIF() ENDIF()
IF(FORCE32) IF(FORCE32)
if(APPLE) if(APPLE)
SET(CMAKE_OSX_ARCHITECTURES "i386") SET(CMAKE_OSX_ARCHITECTURES "i386")
else() else()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
endif() endif()
ENDIF() ENDIF()
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
IF(LINUX) IF(LINUX)
if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE32) ) if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE32) )
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86_64") set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86_64")
set(BIN_RPATH "\$ORIGIN/lib64") set(BIN_RPATH "\$ORIGIN/lib64")
else() else()
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86") set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86")
set(BIN_RPATH "\$ORIGIN/lib") set(BIN_RPATH "\$ORIGIN/lib")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
endif() endif()
elseif(APPLE) elseif(APPLE)
SET(BIN_RPATH "@executable_path/../Frameworks") SET(BIN_RPATH "@executable_path/../Frameworks")
endif() endif()
set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE)
@ -54,23 +54,23 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
if (EXTERNAL_LIB_PATH) if (EXTERNAL_LIB_PATH)
set(CMAKE_PREFIX_PATH ${EXTERNAL_LIB_PATH}) set(CMAKE_PREFIX_PATH ${EXTERNAL_LIB_PATH})
if(EXISTS "${EXTERNAL_LIB_PATH}/lib/pkgconfig/") if(EXISTS "${EXTERNAL_LIB_PATH}/lib/pkgconfig/")
SET(ENV{PKG_CONFIG_PATH} "${EXTERNAL_LIB_PATH}/lib/pkgconfig/") SET(ENV{PKG_CONFIG_PATH} "${EXTERNAL_LIB_PATH}/lib/pkgconfig/")
endif() endif()
if(APPLE) if(APPLE)
set(PLATFORM_SHARED_LIBS set(PLATFORM_SHARED_LIBS
libSDL2.dylib libSDL2_image-2.0.0.dylib libSDL2_ttf-2.0.0.dylib libSDL_sound-1.0.1.dylib libSDL2.dylib libSDL2_image-2.0.0.dylib libSDL2_ttf-2.0.0.dylib libSDL_sound-1.0.1.dylib
libfreetype.6.dylib libsigc-2.0.0.dylib libfreetype.6.dylib libsigc-2.0.0.dylib
CACHE STRING "List of shared libraries that need to be copied into the OS X bundle") CACHE STRING "List of shared libraries that need to be copied into the OS X bundle")
foreach(lib ${PLATFORM_SHARED_LIBS}) foreach(lib ${PLATFORM_SHARED_LIBS})
if(EXISTS ${EXTERNAL_LIB_PATH}/lib/${lib}) if(EXISTS ${EXTERNAL_LIB_PATH}/lib/${lib})
list(APPEND PLATFORM_COPY_LIBS list(APPEND PLATFORM_COPY_LIBS
${EXTERNAL_LIB_PATH}/lib/${lib} ${EXTERNAL_LIB_PATH}/lib/${lib}
) )
endif() endif()
endforeach() endforeach()
endif() endif()
endif() endif()
pkg_check_modules(SIGCXX REQUIRED sigc++-2.0) pkg_check_modules(SIGCXX REQUIRED sigc++-2.0)
@ -90,7 +90,7 @@ find_package(zlib REQUIRED)
## Setup main source ## ## Setup main source ##
set(MAIN_HEADERS set(MAIN_HEADERS
src/quadarray.h src/quadarray.h
src/audio.h src/audio.h
src/binding.h src/binding.h
src/bitmap.h src/bitmap.h
@ -130,7 +130,7 @@ set(MAIN_HEADERS
src/perftimer.h src/perftimer.h
src/sharedstate.h src/sharedstate.h
src/al-util.h src/al-util.h
src/boost-hash.h src/boost-hash.h
src/debugwriter.h src/debugwriter.h
) )
@ -166,202 +166,203 @@ set(MAIN_SOURCE
## Setup embedded source ## ## Setup embedded source ##
set(EMBEDDED_INPUT set(EMBEDDED_INPUT
shader/transSimple.frag shader/transSimple.frag
shader/trans.frag shader/trans.frag
shader/hue.frag shader/hue.frag
shader/sprite.frag shader/sprite.frag
shader/plane.frag shader/plane.frag
shader/bitmapBlit.frag shader/bitmapBlit.frag
shader/simple.frag shader/simple.frag
shader/simpleColor.frag shader/simpleColor.frag
shader/simpleAlpha.frag shader/simpleAlpha.frag
shader/flashMap.frag shader/flashMap.frag
shader/simple.vert shader/simple.vert
shader/simpleColor.vert shader/simpleColor.vert
shader/sprite.vert shader/sprite.vert
assets/liberation.ttf assets/liberation.ttf
) )
if (RGSS2) if (RGSS2)
list(APPEND EMBEDDED_INPUT list(APPEND EMBEDDED_INPUT
shader/blur.frag shader/blur.frag
shader/blurH.vert shader/blurH.vert
shader/blurV.vert shader/blurV.vert
shader/simpleMatrix.vert shader/simpleMatrix.vert
) )
endif() endif()
## Process Embeddeds ## ## Process Embeddeds ##
find_program(XXD_EXE xxd find_program(XXD_EXE xxd
DOC "Location of the xxd executable" DOC "Location of the xxd executable"
) )
macro(ProcessWithXXD outvar inputfile outdir) macro(ProcessWithXXD outvar inputfile outdir)
get_filename_component(basefile ${inputfile} NAME) get_filename_component(basefile ${inputfile} NAME)
set(outputfile ${outdir}/${basefile}.xxd) set(outputfile ${outdir}/${basefile}.xxd)
set_source_files_properties(${outputfile} PROPERTIES HEADER_ONLY TRUE) set_source_files_properties(${outputfile} PROPERTIES HEADER_ONLY TRUE)
add_custom_command( add_custom_command(
OUTPUT ${outputfile} OUTPUT ${outputfile}
COMMAND ${XXD_EXE} -i ${inputfile} ${outputfile} COMMAND ${XXD_EXE} -i ${inputfile} ${outputfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${inputfile} DEPENDS ${inputfile}
COMMENT "Generating XXD for ${inputfile}" COMMENT "Generating XXD for ${inputfile}"
) )
list(APPEND ${outvar} list(APPEND ${outvar}
${outputfile} ${outputfile}
) )
endmacro() endmacro()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xxdhack) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xxdhack)
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR}/xxdhack ${CMAKE_CURRENT_BINARY_DIR}/xxdhack
) )
foreach(item ${EMBEDDED_INPUT}) foreach(item ${EMBEDDED_INPUT})
ProcessWithXXD(EMBEDDED_SOURCE ${item} ${CMAKE_CURRENT_BINARY_DIR}) ProcessWithXXD(EMBEDDED_SOURCE ${item} ${CMAKE_CURRENT_BINARY_DIR})
endforeach() endforeach()
## Setup binding source ## ## Setup binding source ##
if (BINDING STREQUAL "MRI") if (BINDING STREQUAL "MRI")
set(MRIVERSION "2.0" CACHE STRING "Version of MRI to link with") set(MRIVERSION "2.0" CACHE STRING "Version of MRI to link with")
pkg_check_modules(MRI REQUIRED ruby-${MRIVERSION}) pkg_check_modules(MRI REQUIRED ruby-${MRIVERSION})
list(APPEND DEFINES list(APPEND DEFINES
BINDING_MRI BINDING_MRI
) )
set(BINDING_HEADERS set(BINDING_HEADERS
binding-mri/binding-util.h binding-mri/binding-util.h
binding-mri/binding-types.h binding-mri/binding-types.h
binding-mri/serializable-binding.h binding-mri/serializable-binding.h
binding-mri/disposable-binding.h binding-mri/disposable-binding.h
binding-mri/sceneelement-binding.h binding-mri/sceneelement-binding.h
binding-mri/viewportelement-binding.h binding-mri/viewportelement-binding.h
binding-mri/flashable-binding.h binding-mri/flashable-binding.h
) )
set(BINDING_SOURCE set(BINDING_SOURCE
binding-mri/binding-mri.cpp binding-mri/binding-mri.cpp
binding-mri/binding-util.cpp binding-mri/binding-util.cpp
binding-mri/table-binding.cpp binding-mri/table-binding.cpp
binding-mri/etc-binding.cpp binding-mri/etc-binding.cpp
binding-mri/bitmap-binding.cpp binding-mri/bitmap-binding.cpp
binding-mri/font-binding.cpp binding-mri/font-binding.cpp
binding-mri/graphics-binding.cpp binding-mri/graphics-binding.cpp
binding-mri/input-binding.cpp binding-mri/input-binding.cpp
binding-mri/sprite-binding.cpp binding-mri/sprite-binding.cpp
binding-mri/viewport-binding.cpp binding-mri/viewport-binding.cpp
binding-mri/plane-binding.cpp binding-mri/plane-binding.cpp
binding-mri/window-binding.cpp binding-mri/window-binding.cpp
binding-mri/tilemap-binding.cpp binding-mri/tilemap-binding.cpp
binding-mri/audio-binding.cpp binding-mri/audio-binding.cpp
binding-mri/module_rpg.cpp binding-mri/module_rpg.cpp
binding-mri/filesystem-binding.cpp binding-mri/filesystem-binding.cpp
) )
elseif(BINDING STREQUAL "MRUBY") elseif(BINDING STREQUAL "MRUBY")
list(APPEND DEFINES message(FATAL_ERROR "Mruby support in CMake needs to be finished")
BINDING_MRUBY list(APPEND DEFINES
) BINDING_MRUBY
set(BINDING_HEADERS )
binding-mruby/binding-util.h set(BINDING_HEADERS
binding-mruby/disposable-binding.h binding-mruby/binding-util.h
binding-mruby/flashable-binding.h binding-mruby/disposable-binding.h
binding-mruby/binding-types.h binding-mruby/flashable-binding.h
binding-mruby/sceneelement-binding.h binding-mruby/binding-types.h
binding-mruby/viewportelement-binding.h binding-mruby/sceneelement-binding.h
binding-mruby/serializable-binding.h binding-mruby/viewportelement-binding.h
binding-mruby/mrb-ext/file.h binding-mruby/serializable-binding.h
binding-mruby/mrb-ext/rwmem.h binding-mruby/mrb-ext/file.h
binding-mruby/mrb-ext/marshal.h binding-mruby/mrb-ext/rwmem.h
) binding-mruby/mrb-ext/marshal.h
set(BINDING_SOURCE )
binding-mruby/binding-mruby.cpp set(BINDING_SOURCE
binding-mruby/binding-util.cpp binding-mruby/binding-mruby.cpp
binding-mruby/window-binding.cpp binding-mruby/binding-util.cpp
binding-mruby/bitmap-binding.cpp binding-mruby/window-binding.cpp
binding-mruby/sprite-binding.cpp binding-mruby/bitmap-binding.cpp
binding-mruby/font-binding.cpp binding-mruby/sprite-binding.cpp
binding-mruby/viewport-binding.cpp binding-mruby/font-binding.cpp
binding-mruby/plane-binding.cpp binding-mruby/viewport-binding.cpp
binding-mruby/audio-binding.cpp binding-mruby/plane-binding.cpp
binding-mruby/tilemap-binding.cpp binding-mruby/audio-binding.cpp
binding-mruby/etc-binding.cpp binding-mruby/tilemap-binding.cpp
binding-mruby/graphics-binding.cpp binding-mruby/etc-binding.cpp
binding-mruby/input-binding.cpp binding-mruby/graphics-binding.cpp
binding-mruby/table-binding.cpp binding-mruby/input-binding.cpp
binding-mruby/module_rpg.c binding-mruby/table-binding.cpp
binding-mruby/mrb-ext/file.cpp binding-mruby/module_rpg.c
binding-mruby/mrb-ext/marshal.cpp binding-mruby/mrb-ext/file.cpp
binding-mruby/mrb-ext/rwmem.cpp binding-mruby/mrb-ext/marshal.cpp
binding-mruby/mrb-ext/kernel.cpp binding-mruby/mrb-ext/rwmem.cpp
binding-mruby/mrb-ext/time.cpp binding-mruby/mrb-ext/kernel.cpp
) binding-mruby/mrb-ext/time.cpp
)
elseif(BINDING STREQUAL "NULL") elseif(BINDING STREQUAL "NULL")
set(BINDING_SOURCE set(BINDING_SOURCE
binding-null/binding-null.cpp binding-null/binding-null.cpp
) )
else() else()
message(FATAL_ERROR "Must choose a valid binding type. MRI, MRUBY, or NULL") message(FATAL_ERROR "Must choose a valid binding type. MRI, MRUBY, or NULL")
endif() endif()
## Setup main executable ## ## Setup main executable ##
if(APPLE) if(APPLE)
find_library(CARBON_LIBRARY Carbon) find_library(CARBON_LIBRARY Carbon)
find_library(IOKIT_LIBRARY IOKit) find_library(IOKIT_LIBRARY IOKit)
mark_as_advanced(CARBON_LIBRARY IOKIT_LIBRARY) mark_as_advanced(CARBON_LIBRARY IOKIT_LIBRARY)
list(APPEND PLATFORM_LIBRARIES list(APPEND PLATFORM_LIBRARIES
${CARBON_LIBRARY} ${CARBON_LIBRARY}
${IOKIT_LIBRARY} ${IOKIT_LIBRARY}
) )
endif() endif()
link_directories( link_directories(
${SIGCXX_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS}
${PIXMAN_LIBRARY_DIRS} ${PIXMAN_LIBRARY_DIRS}
${PHYSFS_LIBRARY_DIRS} ${PHYSFS_LIBRARY_DIRS}
${SDL2_LIBRARY_DIRS} # Blindly assume other SDL bits are in same directory ${SDL2_LIBRARY_DIRS} # Blindly assume other SDL bits are in same directory
${Boost_LIBRARY_DIR} ${Boost_LIBRARY_DIR}
${MRI_LIBDIR} ${MRI_LIBDIR}
) )
add_executable(${PROJECT_NAME} MACOSX_BUNDLE add_executable(${PROJECT_NAME} MACOSX_BUNDLE
${MAIN_HEADERS} ${MAIN_HEADERS}
${MAIN_SOURCE} ${MAIN_SOURCE}
${BINDING_SOURCE} ${BINDING_SOURCE}
${EMBEDDED_SOURCE} ${EMBEDDED_SOURCE}
) )
target_compile_definitions(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE
${DEFINES} ${DEFINES}
) )
target_include_directories(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
src src
${SIGCXX_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS}
${PIXMAN_INCLUDE_DIRS} ${PIXMAN_INCLUDE_DIRS}
${PHYSFS_INCLUDE_DIRS} ${PHYSFS_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS} # Blindly assume other SDL bits are in same directory ${SDL2_INCLUDE_DIRS} # Blindly assume other SDL bits are in same directory
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}/GL ${GLEW_INCLUDE_DIR}/GL
${MRI_INCLUDE_DIRS} ${MRI_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}
) )
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
${SIGCXX_LIBRARIES} ${SIGCXX_LIBRARIES}
${SDL2_LIBRARIES} ${SDL2_LIBRARIES}
${SDL2_IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES}
${SDL2_TTF_LIBRARIES} ${SDL2_TTF_LIBRARIES}
${SDL_SOUND_LIBRARIES} ${SDL_SOUND_LIBRARIES}
${PHYSFS_LIBRARIES} ${PHYSFS_LIBRARIES}
${PIXMAN_LIBRARIES} ${PIXMAN_LIBRARIES}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${MRI_LIBRARIES} ${MRI_LIBRARIES}
${OPENAL_LIBRARY} ${OPENAL_LIBRARY}
${OPENGL_gl_LIBRARY} ${OPENGL_gl_LIBRARY}
${GLEW_LIBRARY} ${GLEW_LIBRARY}
${ZLIB_LIBRARY} ${ZLIB_LIBRARY}
${PLATFORM_LIBRARIES} ${PLATFORM_LIBRARIES}
) )
PostBuildMacBundle(${PROJECT_NAME} "" "${PLATFORM_COPY_LIBS}") PostBuildMacBundle(${PROJECT_NAME} "" "${PLATFORM_COPY_LIBS}")