aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/src
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-26 14:33:12 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-26 14:33:12 +0000
commit3e61ccc391546f50b7a57f19d9ec3321c4ea4f5c (patch)
treecc9c1d6f1ec973432450daac9991fe533a9b1e51 /cmake/src
parent9573122ba337c1f5f6b9937b24f7c4ad2aacbe3f (diff)
downloadusdx-3e61ccc391546f50b7a57f19d9ec3321c4ea4f5c.tar.gz
usdx-3e61ccc391546f50b7a57f19d9ec3321c4ea4f5c.tar.xz
usdx-3e61ccc391546f50b7a57f19d9ec3321c4ea4f5c.zip
some cmake changes
- everything finished except mac os x bundle creation git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1930 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--cmake/src/CMakeLists.txt81
1 files changed, 47 insertions, 34 deletions
diff --git a/cmake/src/CMakeLists.txt b/cmake/src/CMakeLists.txt
index 08a08197..df0006d3 100644
--- a/cmake/src/CMakeLists.txt
+++ b/cmake/src/CMakeLists.txt
@@ -10,31 +10,60 @@ add_subdirectory(lib)
pascal_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in
${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc)
-# To conform to the GNU Coding Standards, INSTALL_DATADIR is
-# not hardcoded at configure-time so $prefix and $datadir can be
-# changed at make-time.
-# Paths cannot be passed to fpc via -d as with gcc's -D parameter.
-# We use an intermediate file instead.
-# See [info autoconf], "19.5 How Do I `#define' Installation Directories?"
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/paths.inc
- "INSTALL_DATADIR = '${CMAKE_INSTALL_PREFIX}/share/ultrastardx';")
+# write path to shared data to paths.inc
+if(UNIX AND NOT APPLE)
+ if(IS_ABSOLUTE ${DATADIR})
+ set(usdx_install_datadir "${DATADIR}")
+ else()
+ set(usdx_install_datadir "${CMAKE_INSTALL_PREFIX}/${DATADIR}")
+ endif()
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/paths.inc
+ "INSTALL_DATADIR = '${usdx_install_datadir}';")
+endif()
##
# BUILD
##
+# includes used by ultrastardx
+set(usdx_includes
+ ${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc
+)
+if(UNIX AND NOT APPLE)
+ list(APPEND usdx_includes ${CMAKE_CURRENT_BINARY_DIR}/paths.inc)
+endif()
+
+# packages by ultrastardx
+set(usdx_packages
+ collections
+ ffmpeg
+ fft
+ freetype
+ sdl
+ sdl_image
+ opengl
+ portaudio
+ portmixer
+ projectm
+ png
+ samplerate
+ sqlite3
+ zlib
+)
+if(WIN32)
+ list(APPEND usdx_packages bass midi)
+endif(WIN32)
#if(DELPHI)
-# PACKAGES ctypes
+# list(APPEND usdx_packages ctypes)
#endif(DELPHI)
-#if(WIN32)
-# PACKAGES bass midi
-#endif(WIN32)
-set(depends)
+# dependencies by ultrastardx
+set(usdx_depends)
if(libprojectM_USE_CWRAPPER)
- list(APPEND depends projectM-cwrapper)
-endif(libprojectM_USE_CWRAPPER)
+ list(APPEND usdx_depends projectM-cwrapper)
+endif()
+# add target for ultrastardx binary
pascal_add_module(ultrastardx ultrastardx.dpr
#FPC_FLAGS -Si -Cs2000000 # maybe set stack size?
OUTPUT_DIR ${USDX_GAME_DIR}
@@ -46,23 +75,7 @@ pascal_add_module(ultrastardx ultrastardx.dpr
screens/*.pas
lib/other/*.pas
../plugins/SDK/*.pas
- INCLUDES
- ${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc
- ${CMAKE_CURRENT_BINARY_DIR}/paths.inc
- PACKAGES
- collections
- ffmpeg
- fft
- freetype
- sdl
- sdl_image
- opengl
- portaudio
- portmixer
- projectm
- png
- samplerate
- sqlite3
- zlib
- DEPENDS ${depends}
+ INCLUDES ${usdx_includes}
+ PACKAGES ${usdx_packages}
+ DEPENDS ${usdx_depends}
)