Skip to content

Commit

Permalink
Added SkyX .4 and the CMake support addon.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterclemenko committed Apr 14, 2013
0 parents commit 4d03fde
Show file tree
Hide file tree
Showing 101 changed files with 14,832 additions and 0 deletions.
33 changes: 33 additions & 0 deletions CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#-------------------------------------------------------------------
# This file is part of the CMake build system for SkyX
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------

#############################################################
# Install useful CMake modules.
# These are necessary to compile the samples from the install
# directory, but can also be used for custom projects.
#############################################################

if(WIN32 OR APPLE)
set(SKYX_CMAKE_DIR "CMake")
else()
set(SKYX_CMAKE_DIR "${SKYX_LIB_DIRECTORY}/SKYX/cmake")
endif()

set(INST_FILES
Utils/SkyXFindPkgMacros.cmake
Utils/SkyXConfigTargets.cmake
Utils/SkyXGetVersion.cmake
Utils/SkyXMacroLogFeature.cmake
)

if (WIN32)
set(INST_FILES ${INST_FILES}
Templates/VisualStudioUserFile.vcproj.user.in
)
endif ()

install(FILES ${INST_FILES} DESTINATION ${SKYX_CMAKE_DIR})
51 changes: 51 additions & 0 deletions CMake/SkyXConfigureBuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#-------------------------------------------------------------------
# This file is part of the CMake build system for SkyX
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------

#######################################################################
# This file takes care of configuring SkyX to build with the settings
# given in CMake. It creates the necessary config.h file and will
# also prepare package files for pkg-config and CMake.
#######################################################################

# No static build for the moment

# dynamic or static build
if (SKYX_STATIC)
set(SKYX_LIB_TYPE STATIC)
else ()
set(SKYX_LIB_TYPE SHARED)
endif ()

# Create the pkg-config package files on Unix systems
if (UNIX)
set(SKYX_LIB_SUFFIX "")
set(SKYX_PLUGIN_PREFIX "")
set(SKYX_PLUGIN_EXT ".so")
if (SKYX_STATIC)
set(SKYX_LIB_SUFFIX "${SKYX_LIB_SUFFIX}Static")
set(SKYX_PLUGIN_PREFIX "lib")
set(SKYX_PLUGIN_EXT ".a")
endif ()
string(TOLOWER "${CMAKE_BUILD_TYPE}" SKYX_BUILD_TYPE)
if (SKYX_BUILD_TYPE STREQUAL "debug")
set(SKYX_LIB_SUFFIX "${SKYX_LIB_SUFFIX}_d")
endif ()

set(SKYX_ADDITIONAL_LIBS "")
set(SKYX_CFLAGS "")
set(SKYX_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
configure_file(${SKYX_TEMPLATES_DIR}/SKYX.pc.in ${SKYX_BINARY_DIR}/pkgconfig/SKYX${SKYX_LIB_SUFFIX}.pc @ONLY)

install(FILES ${SKYX_BINARY_DIR}/pkgconfig/SKYX${SKYX_LIB_SUFFIX}.pc DESTINATION lib/pkgconfig)
endif ()

if (MSVC)
# Enable intrinsics on MSVC in debug mode
# Not actually necessary in release mode since /O2 implies /Oi but can't easily add this per build type?
add_definitions(/Oi)
endif (MSVC)

95 changes: 95 additions & 0 deletions CMake/SkyXDependencies.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#-------------------------------------------------------------------
# This file is part of the CMake build system for SKYX
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------

#######################################################################
# Find all necessary and optional SKYX dependencies
#######################################################################

# SKYX_DEPENDENCIES_DIR can be used to specify a single base
# folder where the required dependencies may be found.
set(SKYX_DEPENDENCIES_DIR "" CACHE PATH "Path to prebuilt SKYX dependencies")
include(SkyXFindPkgMacros)

set(SKYX_DEP_SEARCH_PATH
${SKYX_DEPENDENCIES_DIR}
${ENV_SKYX_DEPENDENCIES_DIR}
${ENV_OGRE_HOME}
)
message(STATUS "Search path: ${SKYX_DEP_SEARCH_PATH}")

# Set hardcoded path guesses for various platforms
if (UNIX)
set(SKYX_DEP_SEARCH_PATH ${SKYX_DEP_SEARCH_PATH}
/usr/local)
endif ()

# give guesses as hints to the find_package calls
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${SKYX_DEP_SEARCH_PATH})
set(CMAKE_FRAMEWORK_PATH ${CMAKE_FRAMEWORK_PATH} ${SKYX_DEP_SEARCH_PATH})


#######################################################################
# Core dependencies
#######################################################################

# Find Boost, you can comment those lines if Ogre was not compiled using boost threads.
set(Boost_USE_STATIC_LIBS TRUE)
set(Boost_ADDITIONAL_VERSIONS "1.47.0" "1.47" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" )
# Uncomment bellow if Ogre was compiled with boost threading
#set(SKYX_BOOST_COMPONENTS thread date_time)
find_package(Boost COMPONENTS ${SKYX_BOOST_COMPONENTS} QUIET)
if (NOT Boost_FOUND)
# Try again with the other type of libs
if(Boost_USE_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS)
else()
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost COMPONENTS ${SKYX_BOOST_COMPONENTS} QUIET)
endif()
macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" TRUE "" "")
macro_log_feature(Boost_THREAD_FOUND "boost-thread" "Used for threading support" "http://boost.org" FALSE "" "")
macro_log_feature(Boost_DATE_TIME_FOUND "boost-date_time" "Used for threading support" "http://boost.org" FALSE "" "")

# Find Ogre 3D, plus terrain and paging components
find_package(OGRE)
macro_log_feature(OGRE_FOUND "OGRE" "3D library needed for the OgreGraphics plugin" "http://" TRUE "" "")

#######################################################################
# Tools dependencies
#######################################################################

# Find Doxygen
find_package(Doxygen)
macro_log_feature(DOXYGEN_FOUND "Doxygen" "Tool for building API documentation" "http://doxygen.org" FALSE "" "")

#######################################################################
# Samples dependencies (comment if not needed)
#######################################################################

# Find OIS
find_package(OIS)
macro_log_feature(OIS_FOUND "OIS" "Input library needed for the OISInput plugin" "http://sourceforge.net/projects/wgois" TRUE "" "")

#######################################################################
# All dependencies were checked
#######################################################################

# Display results, terminate if anything required is missing
MACRO_DISPLAY_FEATURE_LOG()

# Add library and include paths from the dependencies
include_directories(
${OGRE_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

link_directories(
${OGRE_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)

11 changes: 11 additions & 0 deletions CMake/Templates/SKYX.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@SKYX_PREFIX_PATH@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
plugindir=${libdir}/SKYX

Name: SKYX
Description:
Version: @SKYX_VERSION@
Libs: -L${libdir} -lSkyX@SKYX_LIB_SUFFIX@ @SKYX_ADDITIONAL_LIBS@
Cflags: -I${includedir} -I${includedir}/SKYX @SKYX_CFLAGS@
121 changes: 121 additions & 0 deletions CMake/Templates/VisualStudioUserFile.vcproj.user.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)/$(TargetFileName)"
WorkingDirectory="@SKYX_WORK_DIR@/bin/$(ConfigurationName)"
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine=""
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)/$(TargetFileName)"
WorkingDirectory="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)"
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine=""
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="RelWithDebInfo|Win32"
>
<DebugSettings
Command="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)/$(TargetFileName)"
WorkingDirectory="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)"
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine=""
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="MinSizeRel|Win32"
>
<DebugSettings
Command="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)/$(TargetFileName)"
WorkingDirectory="@SKYX_BINARY_DIR@/bin/$(ConfigurationName)"
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine=""
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>
Loading

0 comments on commit 4d03fde

Please sign in to comment.