aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-09 14:41:04 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-09 14:41:04 +0000
commitb230f515a89f14d4742b79d4caabf4997a8e614a (patch)
treee678e2647ea504ede0c464daf9e6457e83133f3c
parentf6681ab67054faacfb131f4ee712fc448a012e9e (diff)
downloadusdx-b230f515a89f14d4742b79d4caabf4997a8e614a.tar.gz
usdx-b230f515a89f14d4742b79d4caabf4997a8e614a.tar.xz
usdx-b230f515a89f14d4742b79d4caabf4997a8e614a.zip
- options added for projectM and generation of lazarus project files
- ConfigurePasFile.cmake merged with UsePascal.cmake (->pascal_configure_file) - OUTPUT_NAME, OUTPUT_DIR options for pascal_add_module() - ultrastardx executable is generated in the game dir of the binary directory - Id and HeadURL properties added for better identification of CMakeLists.txt in the editor git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1719 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--cmake/CMakeLists.txt129
-rw-r--r--cmake/dists/cmake/Modules/ConfigurePasFile.cmake28
-rw-r--r--cmake/dists/cmake/Modules/FindPPC.cmake38
-rw-r--r--cmake/dists/cmake/Modules/UsePascal.cmake164
-rw-r--r--cmake/src/CMakeLists.txt40
-rw-r--r--cmake/src/lib/CMakeLists.txt2
-rw-r--r--cmake/src/lib/FreeImage/CMakeLists.txt2
-rw-r--r--cmake/src/lib/JEDI-SDL/CMakeLists.txt2
-rw-r--r--cmake/src/lib/JEDI-SDL/OpenGL/CMakeLists.txt2
-rw-r--r--cmake/src/lib/JEDI-SDL/SDL/CMakeLists.txt2
-rw-r--r--cmake/src/lib/JEDI-SDL/SDL_Image/CMakeLists.txt2
-rw-r--r--cmake/src/lib/SQLite/CMakeLists.txt2
-rw-r--r--cmake/src/lib/bass/CMakeLists.txt2
-rw-r--r--cmake/src/lib/collections/CMakeLists.txt2
-rw-r--r--cmake/src/lib/ctypes/CMakeLists.txt2
-rw-r--r--cmake/src/lib/ffmpeg/CMakeLists.txt2
-rw-r--r--cmake/src/lib/fft/CMakeLists.txt2
-rw-r--r--cmake/src/lib/freetype/CMakeLists.txt2
-rw-r--r--cmake/src/lib/libpng/CMakeLists.txt2
-rw-r--r--cmake/src/lib/midi/CMakeLists.txt2
-rw-r--r--cmake/src/lib/portaudio/CMakeLists.txt2
-rw-r--r--cmake/src/lib/portmixer/CMakeLists.txt2
-rw-r--r--cmake/src/lib/projectM/CMakeLists.txt2
-rw-r--r--cmake/src/lib/projectM/cwrapper/CMakeLists.txt2
-rw-r--r--cmake/src/lib/samplerate/CMakeLists.txt2
-rw-r--r--cmake/src/lib/zlib/CMakeLists.txt2
26 files changed, 279 insertions, 162 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 09a0dff8..8eafd2b4 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1,4 +1,3 @@
-#
# UltrastarDX CMake script
# by UltraStar Deluxe Team
#
@@ -11,22 +10,21 @@
# http://www.cmake.org/cmake/help/cmake2.6docs.html
# - CMake Useful Variables (CMake Wiki):
# http://www.cmake.org/Wiki/CMake_Useful_Variables
-###
+#
+# $URL$
+# $Id$
##
-# CMAKE
+# CMAKE SETTINGS
##
+# min. version and policies
cmake_minimum_required(VERSION 2.6)
-
-if(COMMAND cmake_policy)
-# cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
-
+# module and script directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/dists/cmake/Modules)
##
-# PROJECT
+# PROJECT SETTINGS
##
project(UltrastarDX)
@@ -47,7 +45,7 @@ set(PACKAGE_IRC "#ultrastardx at quakenet.org")
##
find_package(PPC 2.2.0 REQUIRED)
-include(UsePascal)
+include(UsePascal)
include(ExpandVersion)
##
@@ -98,23 +96,28 @@ if(NOT WIN32)
pkg_check_modules(libswscale libswscale)
expand_version(libswscale_VERSION)
- # find projectM version
- set(libprojectM_MODULE "libprojectM >= 0.98")
- pkg_check_modules(libprojectM ${libprojectM_MODULE})
+ option(ENABLE_PROJECTM "Enable ProjectM support if available" OFF)
+ set(libprojectM_USE_CWRAPPER FALSE)
+ if(ENABLE_PROJECTM)
+ # find projectM version
+ set(libprojectM_MODULE "libprojectM >= 0.98")
+ pkg_check_modules(libprojectM ${libprojectM_MODULE})
+
+ if(libprojectM_FOUND)
+ # get projectM data-dir (for preset- and font-dir)
+ execute_process(
+ COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir ${libprojectM_MODULE}
+ OUTPUT_VARIABLE libprojectM_DATADIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ # check if we need the c-wrapper
+ if(NOT libprojectM_VERSION VERSION_LESS "1.0.0")
+ set(libprojectM_USE_CWRAPPER TRUE)
+ endif()
+ endif(libprojectM_FOUND)
+ endif(ENABLE_PROJECTM)
expand_version(libprojectM_VERSION)
- # get projectM data-dir (for preset- and font-dir)
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir ${libprojectM_MODULE}
- OUTPUT_VARIABLE libprojectM_DATADIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- # check if we need the c-wrapper
- if(libprojectM_VERSION VERSION_LESS "1.0.0")
- set(libprojectM_USE_CWRAPPER FALSE)
- else(libprojectM_VERSION VERSION_LESS "1.0.0")
- set(libprojectM_USE_CWRAPPER TRUE)
- endif(libprojectM_VERSION VERSION_LESS "1.0.0")
-
# find portaudio
pkg_check_modules(portaudio REQUIRED portaudio-2.0)
expand_version(portaudio_VERSION)
@@ -186,7 +189,7 @@ install(
PATTERN .svn EXCLUDE
)
install(
- FILES
+ FILES
COPYING.txt
DESTINATION share/ultrastardx
)
@@ -217,51 +220,52 @@ ADD_CUSTOM_TARGET(uninstall
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Karaoke program that evaluates your performance")
set(CPACK_PACKAGE_VENDOR "UltraStar Deluxe Team")
-#set(CPACK_PACKAGE_FILE_NAME "ultrastardx-${ULTRASTARDX_VERSION}")
-#set(CPACK_SOURCE_PACKAGE_FILE_NAME "ultrastardx-src-${ULTRASTARDX_VERSION}")
-#set(CPACK_SOURCE_GENERATOR "TBZ2")
-#set(CPACK_PACKAGE_EXECUTABLES "ultrastardx" "ultrastardx")
-#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
-#set(CPACK_PACKAGE_INSTALL_DIRECTORY "Ultrastardx ${ULTRASTARDX_VERSION}")
+set(CPACK_PACKAGE_FILE_NAME "ultrastardx-${CMAKE_PACKAGE_VERSION}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "ultrastardx-src-${CMAKE_PACKAGE_VERSION}")
+set(CPACK_SOURCE_GENERATOR "TBZ2")
+set(CPACK_PACKAGE_EXECUTABLES "ultrastardx" "ultrastardx")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "ultrastardx ${CMAKE_PACKAGE_VERSION}")
if(WIN32 AND NOT UNIX)
set(CPACK_NSIS_DISPLAY_NAME "Ultrastar Deluxe")
- set(CPACK_NSIS_HELP_LINK "http://www.ultrastardx.org/")
- set(CPACK_NSIS_URL_INFO_ABOUT "http://www.ultrastardx.org/")
+ set(CPACK_NSIS_HELP_LINK ${PACKAGE_WEBSITE})
+ set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_WEBSITE})
set(CPACK_NSIS_CONTACT "help@ultrastardx.org")
set(CPACK_NSIS_MODIFY_PATH OFF)
set(CPACK_GENERATOR "ZIP;NSIS")
else(WIN32 AND NOT UNIX)
-# set(CPACK_STRIP_FILES "bin/ultrastardx")
+ set(CPACK_STRIP_FILES "bin/ultrastardx")
endif(WIN32 AND NOT UNIX)
-#set(CPACK_SOURCE_IGNORE_FILES
-# "~"
-# "\\\\.svn"
-# "\\\\.exe$"
-# "\\\\.a$"
-# "\\\\.dll$"
-# "\\\\.dof$"
-# "\\\\.cmake$"
-# "\\\\.zip$"
-# "\\\\.gz$"
-# "\\\\.bz2$"
-# "\\\\.tmp$"
-# "\\\\.sh$"
-# "\\\\.ppu$"
-# "\\\\.o$"
-# "Makefile"
-# "CMakeFiles"
-# "debug"
-# "release$"
-# "Debug$"
-# "Release$"
-# "CPack"
-# "^${PROJECT_SOURCE_DIR}/bin/[a-z]"
-# "^${PROJECT_SOURCE_DIR}/install_manifest.txt"
-# "^${PROJECT_SOURCE_DIR}/CMakeCache.txt"
-# "^${PROJECT_SOURCE_DIR}/ultrastardx\\\\."
-#)
+set(CPACK_SOURCE_IGNORE_FILES
+ "~"
+ "\\\\.svn"
+ "\\\\.exe$"
+ "\\\\.a$"
+ "\\\\.dll$"
+ "\\\\.dof$"
+ "\\\\.cmake$"
+ "\\\\.zip$"
+ "\\\\.gz$"
+ "\\\\.bz2$"
+ "\\\\.tmp$"
+ "\\\\.sh$"
+ "\\\\.dcu$"
+ "\\\\.ppu$"
+ "\\\\.o$"
+ "Makefile"
+ "CMakeFiles"
+ "debug"
+ "release$"
+ "Debug$"
+ "Release$"
+ "CPack"
+ "^${PROJECT_SOURCE_DIR}/bin/[a-z]"
+ "^${PROJECT_SOURCE_DIR}/install_manifest.txt"
+ "^${PROJECT_SOURCE_DIR}/CMakeCache.txt"
+ "^${PROJECT_SOURCE_DIR}/ultrastardx\\\\."
+)
#include(CPack)
@@ -270,7 +274,6 @@ endif(WIN32 AND NOT UNIX)
##
message(STATUS "
-!!
!! Configuration of ${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} done!
!!
!! Type \"make\" to compile and
diff --git a/cmake/dists/cmake/Modules/ConfigurePasFile.cmake b/cmake/dists/cmake/Modules/ConfigurePasFile.cmake
deleted file mode 100644
index 803afc1d..00000000
--- a/cmake/dists/cmake/Modules/ConfigurePasFile.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (c) 2009 Tobias Gunkel <tobigun@at@users.sourceforge.net>
-#
-# Copying and distribution of this file, with or without
-# modification, are permitted in any medium without royalty provided
-# the copyright notice and this notice are preserved.
-
-# - Macro for handling Pascal configuration files
-#
-# CONFIGURE_PAS_FILE(InputFile OutputFile)
-# Works as configure_file(InputFile OutputFile) but in addition
-# it replaces occurences of {$CMAKEDEFINE(VAR) XYZ} with
-# {$DEFINE XYZ} if the value of VAR is true
-# {$UNDEF XYZ} if the value of VAR is false
-
-macro(CONFIGURE_PAS_FILE)
- file(READ ${ARGV0} config_file)
- string(REGEX MATCHALL "{\\$CMAKEDEFINE\\([^\\)]+\\)" pasdefine_list "${config_file}")
- foreach(pasdefine ${pasdefine_list})
- string(REGEX REPLACE "{\\$CMAKEDEFINE\\(([^\\)]+)\\)" "\\1" pasdefine_var ${pasdefine})
- if (${pasdefine_var})
- string(REPLACE ${pasdefine} "{$DEFINE" config_file "${config_file}")
- else (${pasdefine_var})
- string(REPLACE ${pasdefine} "{$UNDEF" config_file "${config_file}")
- endif (${pasdefine_var})
- endforeach(pasdefine)
- string(CONFIGURE "${config_file}" config_file)
- file(WRITE ${ARGV1} "${config_file}")
-endmacro(CONFIGURE_PAS_FILE)
diff --git a/cmake/dists/cmake/Modules/FindPPC.cmake b/cmake/dists/cmake/Modules/FindPPC.cmake
index 67b49dd9..3f82b720 100644
--- a/cmake/dists/cmake/Modules/FindPPC.cmake
+++ b/cmake/dists/cmake/Modules/FindPPC.cmake
@@ -103,6 +103,29 @@ foreach(once 1)
set(FPC_TARGET "${FPC_PROCESSOR}-${FPC_PLATFORM}")
+ #-v -l verbose/banner
+ #-n ignore fpc.cfg
+ #-Fi -I include-dir
+ #-k
+ #-Fl linker-dir
+ #-Fo -Fu object-/unit-dir
+ #-Xt -Xc
+ #-Ciort range checks
+ #-Cs -Ch stack/heap size
+ #-Cg -fPIC PIC code
+ #-E
+ #-g -gv -gw(2/3) -gh -gl -pg
+ #-O
+ #-T -Xd -XP cross-compiling
+ #-d -u define/undefine
+ #-Xs strip
+ #-B build all modules
+ #-Dd -Dv description + DLL-version
+
+ #PFLAGS_BASE_DEFAULT := -Si -Sg- -Sc- -v0Binwe
+ #PFLAGS_DEBUG_DEFAULT := -Xs- -g -gl -dDEBUG_MODE
+ #PFLAGS_RELEASE_DEFAULT := -Xs- -O2
+
##
# Compiler checks
##
@@ -142,14 +165,19 @@ foreach(once 1)
ppc_check(testlib.pas "library link;\nbegin\nend."
"${default_flags}" check_result
NO_CLEAN)
- find_library(libpath testlib
+ # find generated library
+ find_library(PPC_TEST_LIBPATH testlib
PATHS ${PPC_CHECK_DIR}
NO_DEFAULT_PATH)
- if(libpath)
- get_filename_component(PPC_LIBRARY_SUFFIX ${libpath} EXT CACHE)
- get_filename_component(libfilename ${libpath} NAME_WE)
+ # do not show library name in GUI
+ mark_as_advanced(PPC_TEST_LIBPATH)
+ # extract prefix and suffix from library name
+ if(PPC_TEST_LIBPATH)
+ get_filename_component(PPC_LIBRARY_SUFFIX ${PPC_TEST_LIBPATH} EXT CACHE)
+ get_filename_component(libfilename ${PPC_TEST_LIBPATH} NAME_WE)
string(REGEX REPLACE "^(.*)testlib.*" "\\1" PPC_LIBRARY_PREFIX ${libfilename})
- endif(libpath)
+ endif(PPC_TEST_LIBPATH)
+ # remove library test directory
file(REMOVE_RECURSE ${PPC_CHECK_DIR})
if(check_result)
set(PPC_ERROR "Cannot link with standard libraries")
diff --git a/cmake/dists/cmake/Modules/UsePascal.cmake b/cmake/dists/cmake/Modules/UsePascal.cmake
index a67e07b6..e3c3612b 100644
--- a/cmake/dists/cmake/Modules/UsePascal.cmake
+++ b/cmake/dists/cmake/Modules/UsePascal.cmake
@@ -4,25 +4,80 @@
# modification, are permitted in any medium without royalty provided
# the copyright notice and this notice are preserved.
-# - Pascal module build macros
+# - Creates a virtual Pascal package.
+# Do not mix this up with Delphi (dpk), FPC or Lazarus (lpk) packages.
+# A package specified by this command does not define a dll or similar.
+# It is just a compilation of units, includes and object-dirs
+# (mostly used for header files).
+# This information will be appended to a module generated by
+# add_pascal_module() if a package is specified with the PACKAGE
+# option.
+# PASCAL_ADD_PACKAGE(
+# <name>
+# [UNITS file1 [...]]
+# [INCLUDES file1 [...]]
+# [OBJECT_DIRS dir1 [...]]
#
-# ADD_PASCAL_MODULE(
+# - Builds a Pascal module.
+# The module can be a program, library or unit. The type is either autodetected
+# (by the file header) or can be set by the appropriate flag.
+# The output name for executables and libraries (exe, dll, so) will be the
+# name of the target (or the one given by OUTPUT_NAME). It will be located in
+# the current binary dir by default (or in the directory given by OUTPUT_DIR).
+# If main_source is a unit the name of the generated object file (mostly a .o/.ppu pair)
+# will match the units name and located in an extra directory (like i386-linux) in the
+# current binary dir.
+# It is recommended to pass all unit (pas/pp) files and include (inc) files required
+# by the module with the UNITS/INCLUDES flags. Although dependencies are normally
+# already defined in the project file (.lpr/.dpr/...) FPC is not able to reliably track
+# changes in dependencies as it does not search for source-files besides the directory
+# of the project file. When calling FPC directly the user has to pass all paths to source
+# files with the -Fu flag, otherwise FPC will not recompile changed source-files.
+# If you pass all source files (wildcards as dir/*.pas are allowed) with UNITS/INCLUDES
+# pascal_add_module does this for you. In addition the filenames are appended to auto-generated
+# project files for e.g. lazarus.
+# The UNITS/INCLUDES files are also used as dependencies for triggering a rebuild. If REBUILD_ALL
+# is not specified FPC tries to perform a minimal rebuild (only files that changed). If inline
+# functions are used in your project's sources FPC might not be able to perform a minimum rebuild
+# and compiles lots of unchanged units too.
+# (See http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg11914.html)
+# If for some reason a minimal rebuild fails, specify
+# REBUILD_ALL to recompile all units used by your project.
+# Units/includes used by packages specified by the PACKAGES option do not have to be specified
+# again with UNITS/INCLUDES. Package sources are not appended to auto-generated project files
+# for lazarus.
+# Sets target properties:
+# - PASCAL_TYPE: module type (one of PROGRAM/LIBRARY/UNIT)
+# - PASCAL_LOCATION: full path of output file (equivalent to LOCATION)
+# PASCAL_ADD_MODULE(
# <name>
# [PROGRAM | LIBRARY | UNIT]
-# <source>
-# FLAGS ...
-# DEPENDS depend [...]
-# UNITS file1 [...]
-# INCLUDES file1 [...]
-# OBJECT_DIRS dir1 [...]
-# PACKAGES pkg1 [...]
-# EXCLUDE_FROM_ALL
-# REBUILD_ALL
+# <main_source>
+# [OUTPUT_NAME name]
+# [OUTPUT_DIR dir]
+# [FLAGS ...]
+# [DEPENDS depend [...]]
+# [UNITS file1 [...]]
+# [INCLUDES file1 [...]]
+# [OBJECT_DIRS dir1 [...]]
+# [PACKAGES pkg1 [...]]
+# [EXCLUDE_FROM_ALL]
+# [REBUILD_ALL]
# )
+#
+# - Macro for handling Pascal configuration files
+# Works as configure_file(InputFile OutputFile) but in addition
+# it replaces occurences of {$CMAKEDEFINE(VAR) XYZ} with
+# {$DEFINE XYZ} if the value of VAR is true
+# {$UNDEF XYZ} if the value of VAR is false
+# PASCAL_CONFIGURE_FILE(InputFile OutputFile)
+#
include(MacroParseArguments)
include(LazarusGenerator)
+option(GENERATE_LAZARUS_PROJECTS "Generate lazarus project files (.lpi) for every Pascal target" OFF)
+
function(PASCAL_ADD_PACKAGE name)
set(ARG)
parse_arguments(ARG
@@ -51,7 +106,7 @@ endfunction(PASCAL_ADD_PACKAGE)
macro(PASCAL_ADD_MODULE)
set(ARG)
parse_arguments(ARG
- "FLAGS;DEPENDS;UNITS;INCLUDES;OBJECT_DIRS;PACKAGES"
+ "OUTPUT_NAME;OUTPUT_DIR;FLAGS;DEPENDS;UNITS;INCLUDES;OBJECT_DIRS;PACKAGES"
"EXCLUDE_FROM_ALL;REBUILD_ALL"
${ARGN}
)
@@ -118,18 +173,31 @@ macro(PASCAL_ADD_MODULE)
# init list of additional "make clean" files
set(extra_clean_files "")
- # set ppu and obj output dir
+ # set output directory
+ if(ARG_OUTPUT_DIR)
+ set(output_dir ${ARG_OUTPUT_DIR})
+ else()
+ set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+
+ # set compiled units (ppu/obj) output directory
set(unit_out_dir ${CMAKE_CURRENT_BINARY_DIR}/${FPC_TARGET})
list(APPEND extra_clean_files ${unit_out_dir})
- # create output name
- set(output_name ${target})
+ # set output-file basename
+ if(ARG_OUTPUT_NAME)
+ set(output_name ${ARG_OUTPUT_NAME})
+ else()
+ set(output_name ${target})
+ endif()
+
+ # create output filename
if(type STREQUAL PROGRAM)
- set(output "${CMAKE_CURRENT_BINARY_DIR}/${output_name}${CMAKE_EXECUTABLE_SUFFIX}")
+ set(output "${output_dir}/${output_name}${CMAKE_EXECUTABLE_SUFFIX}")
list(APPEND extra_clean_files ${output})
endif(type STREQUAL PROGRAM)
if(type STREQUAL LIBRARY)
- set(output "${CMAKE_CURRENT_BINARY_DIR}/${PPC_LIBRARY_PREFIX}${output_name}${PPC_LIBRARY_SUFFIX}")
+ set(output "${output_dir}/${PPC_LIBRARY_PREFIX}${output_name}${PPC_LIBRARY_SUFFIX}")
list(APPEND extra_clean_files ${output})
endif(type STREQUAL LIBRARY)
if(type STREQUAL UNIT)
@@ -228,29 +296,6 @@ macro(PASCAL_ADD_MODULE)
# set flags
list(APPEND PFLAGS ${ARG_FLAGS})
- #-v -l verbose/banner
- #-n ignore fpc.cfg
- #-Fi -I include-dir
- #-k
- #-Fl linker-dir
- #-Fo -Fu object-/unit-dir
- #-Xt -Xc
- #-Ciort range checks
- #-Cs -Ch stack/heap size
- #-Cg -fPIC PIC code
- #-E
- #-g -gv -gw(2/3) -gh -gl -pg
- #-O
- #-T -Xd -XP cross-compiling
- #-d -u define/undefine
- #-Xs strip
- #-B build all modules
- #-Dd -Dv description + DLL-version
-
- #PFLAGS_BASE_DEFAULT := -Si -Sg- -Sc- -v0Binwe
- #PFLAGS_DEBUG_DEFAULT := -Xs- -g -gl -dDEBUG_MODE
- #PFLAGS_RELEASE_DEFAULT := -Xs- -O2
-
# lower-case project type (just for user info)
string(TOLOWER ${type} proj_type_lowcase)
@@ -295,15 +340,32 @@ macro(PASCAL_ADD_MODULE)
# of the target
set_target_properties(${target} PROPERTIES PASCAL_LOCATION ${output})
- generate_lazarus_project(
- ${source}
- ${output}
- ${unit_out_dir}
- "${ARG_UNITS}"
- "${unit_dirs}"
- "${ARG_INCLUDES}"
- "${inc_dirs}"
- "${obj_dirs}"
- "${PFLAGS}"
- )
+ if(GENERATE_LAZARUS_PROJECTS)
+ generate_lazarus_project(
+ ${source}
+ ${output}
+ ${unit_out_dir}
+ "${ARG_UNITS}"
+ "${unit_dirs}"
+ "${ARG_INCLUDES}"
+ "${inc_dirs}"
+ "${obj_dirs}"
+ "${PFLAGS}"
+ )
+ endif(GENERATE_LAZARUS_PROJECTS)
endmacro(PASCAL_ADD_MODULE)
+
+macro(PASCAL_CONFIGURE_FILE)
+ file(READ ${ARGV0} config_file)
+ string(REGEX MATCHALL "{\\$CMAKEDEFINE\\([^\\)]+\\)" pasdefine_list "${config_file}")
+ foreach(pasdefine ${pasdefine_list})
+ string(REGEX REPLACE "{\\$CMAKEDEFINE\\(([^\\)]+)\\)" "\\1" pasdefine_var ${pasdefine})
+ if (${pasdefine_var})
+ string(REPLACE ${pasdefine} "{$DEFINE" config_file "${config_file}")
+ else (${pasdefine_var})
+ string(REPLACE ${pasdefine} "{$UNDEF" config_file "${config_file}")
+ endif (${pasdefine_var})
+ endforeach(pasdefine)
+ string(CONFIGURE "${config_file}" config_file)
+ file(WRITE ${ARGV1} "${config_file}")
+endmacro(PASCAL_CONFIGURE_FILE)
diff --git a/cmake/src/CMakeLists.txt b/cmake/src/CMakeLists.txt
index 5e8ee7f9..1e920936 100644
--- a/cmake/src/CMakeLists.txt
+++ b/cmake/src/CMakeLists.txt
@@ -1,23 +1,28 @@
+# $URL$
+# $Id$
+
add_subdirectory(lib)
##
# CONFIGURATION
##
-include(ConfigurePasFile)
-configure_pas_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in
- ${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc)
+pascal_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/paths.inc
- "INSTALL_DATADIR = '/usr/local/share/ultrastardx';")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/paths.inc
+ "INSTALL_DATADIR = '${CMAKE_INSTALL_PREFIX}/share/ultrastardx';")
##
# BUILD
##
#if(DELPHI)
-# PACKAGES ctypes bass midi
+# PACKAGES ctypes
#endif(DELPHI)
+#if(WIN32)
+# PACKAGES bass midi
+#endif(WIN32)
set(depends)
if(libprojectM_USE_CWRAPPER)
@@ -25,24 +30,29 @@ if(libprojectM_USE_CWRAPPER)
endif(libprojectM_USE_CWRAPPER)
pascal_add_module(ultrastardx ultrastardx.dpr
-# FLAGS -vut
- UNITS
- base/*.pas
- menu/*.pas
- screens/*.pas
+ #FLAGS -vut
+ OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/../game
+ UNITS
+ base/*.pas
+ #macosx/*.pas
media/*.pas
+ menu/*.pas
+ screens/*.pas
lib/other/*.pas
../plugins/SDK/*.pas
- INCLUDES
+ INCLUDES
${CMAKE_CURRENT_BINARY_DIR}/config-${FPC_PLATFORM}.inc
${CMAKE_CURRENT_BINARY_DIR}/paths.inc
- PACKAGES
+ PACKAGES
collections
ffmpeg
fft
freetype
- sdl sdl_image opengl
- portaudio portmixer
+ sdl
+ sdl_image
+ opengl
+ portaudio
+ portmixer
projectm
png
samplerate
diff --git a/cmake/src/lib/CMakeLists.txt b/cmake/src/lib/CMakeLists.txt
index 1136fd8f..d4bfb131 100644
--- a/cmake/src/lib/CMakeLists.txt
+++ b/cmake/src/lib/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
add_subdirectory(bass)
add_subdirectory(collections)
add_subdirectory(ctypes)
diff --git a/cmake/src/lib/FreeImage/CMakeLists.txt b/cmake/src/lib/FreeImage/CMakeLists.txt
index 873880f6..4a430978 100644
--- a/cmake/src/lib/FreeImage/CMakeLists.txt
+++ b/cmake/src/lib/FreeImage/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(freeimage
UNITS *.pas
)
diff --git a/cmake/src/lib/JEDI-SDL/CMakeLists.txt b/cmake/src/lib/JEDI-SDL/CMakeLists.txt
index 1b5bfdc9..513efc62 100644
--- a/cmake/src/lib/JEDI-SDL/CMakeLists.txt
+++ b/cmake/src/lib/JEDI-SDL/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
add_subdirectory(SDL)
add_subdirectory(SDL_Image)
add_subdirectory(OpenGL)
diff --git a/cmake/src/lib/JEDI-SDL/OpenGL/CMakeLists.txt b/cmake/src/lib/JEDI-SDL/OpenGL/CMakeLists.txt
index 2b33cdcf..07784441 100644
--- a/cmake/src/lib/JEDI-SDL/OpenGL/CMakeLists.txt
+++ b/cmake/src/lib/JEDI-SDL/OpenGL/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(opengl
UNITS Pas/*.pas
)
diff --git a/cmake/src/lib/JEDI-SDL/SDL/CMakeLists.txt b/cmake/src/lib/JEDI-SDL/SDL/CMakeLists.txt
index 8bd0ae65..69c63d0a 100644
--- a/cmake/src/lib/JEDI-SDL/SDL/CMakeLists.txt
+++ b/cmake/src/lib/JEDI-SDL/SDL/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(sdl
UNITS Pas/*.pas
INCLUDES Pas/*.inc
diff --git a/cmake/src/lib/JEDI-SDL/SDL_Image/CMakeLists.txt b/cmake/src/lib/JEDI-SDL/SDL_Image/CMakeLists.txt
index fb34d8ce..8a545b02 100644
--- a/cmake/src/lib/JEDI-SDL/SDL_Image/CMakeLists.txt
+++ b/cmake/src/lib/JEDI-SDL/SDL_Image/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(sdl_image
UNITS Pas/*.pas
)
diff --git a/cmake/src/lib/SQLite/CMakeLists.txt b/cmake/src/lib/SQLite/CMakeLists.txt
index 4a4378b3..7f4e2c53 100644
--- a/cmake/src/lib/SQLite/CMakeLists.txt
+++ b/cmake/src/lib/SQLite/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(sqlite3
UNITS *.pas
)
diff --git a/cmake/src/lib/bass/CMakeLists.txt b/cmake/src/lib/bass/CMakeLists.txt
index c55d0629..888876ed 100644
--- a/cmake/src/lib/bass/CMakeLists.txt
+++ b/cmake/src/lib/bass/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(bass
UNITS delphi/*.pas
)
diff --git a/cmake/src/lib/collections/CMakeLists.txt b/cmake/src/lib/collections/CMakeLists.txt
index 02480e70..58012ace 100644
--- a/cmake/src/lib/collections/CMakeLists.txt
+++ b/cmake/src/lib/collections/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(collections
UNITS *.pas
)
diff --git a/cmake/src/lib/ctypes/CMakeLists.txt b/cmake/src/lib/ctypes/CMakeLists.txt
index 64827ee2..bc008ba9 100644
--- a/cmake/src/lib/ctypes/CMakeLists.txt
+++ b/cmake/src/lib/ctypes/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(ctypes
UNITS *.pas
)
diff --git a/cmake/src/lib/ffmpeg/CMakeLists.txt b/cmake/src/lib/ffmpeg/CMakeLists.txt
index 0db265ca..ff1ea393 100644
--- a/cmake/src/lib/ffmpeg/CMakeLists.txt
+++ b/cmake/src/lib/ffmpeg/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(ffmpeg
UNITS *.pas
)
diff --git a/cmake/src/lib/fft/CMakeLists.txt b/cmake/src/lib/fft/CMakeLists.txt
index f38808c8..17e3ccb2 100644
--- a/cmake/src/lib/fft/CMakeLists.txt
+++ b/cmake/src/lib/fft/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(fft
UNITS *.pas
)
diff --git a/cmake/src/lib/freetype/CMakeLists.txt b/cmake/src/lib/freetype/CMakeLists.txt
index 772834f4..9487d683 100644
--- a/cmake/src/lib/freetype/CMakeLists.txt
+++ b/cmake/src/lib/freetype/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(freetype
UNITS *.pas
)
diff --git a/cmake/src/lib/libpng/CMakeLists.txt b/cmake/src/lib/libpng/CMakeLists.txt
index 9e5aaf52..8dda58b3 100644
--- a/cmake/src/lib/libpng/CMakeLists.txt
+++ b/cmake/src/lib/libpng/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(png
UNITS *.pas
)
diff --git a/cmake/src/lib/midi/CMakeLists.txt b/cmake/src/lib/midi/CMakeLists.txt
index f3265e44..320da742 100644
--- a/cmake/src/lib/midi/CMakeLists.txt
+++ b/cmake/src/lib/midi/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(midi
UNITS *.pas *.PAS
)
diff --git a/cmake/src/lib/portaudio/CMakeLists.txt b/cmake/src/lib/portaudio/CMakeLists.txt
index 3e18119b..167eb3c3 100644
--- a/cmake/src/lib/portaudio/CMakeLists.txt
+++ b/cmake/src/lib/portaudio/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(portaudio
UNITS *.pas
)
diff --git a/cmake/src/lib/portmixer/CMakeLists.txt b/cmake/src/lib/portmixer/CMakeLists.txt
index 74a4b437..0996bb26 100644
--- a/cmake/src/lib/portmixer/CMakeLists.txt
+++ b/cmake/src/lib/portmixer/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(portmixer
UNITS *.pas
)
diff --git a/cmake/src/lib/projectM/CMakeLists.txt b/cmake/src/lib/projectM/CMakeLists.txt
index 3598d0b5..62f69d0c 100644
--- a/cmake/src/lib/projectM/CMakeLists.txt
+++ b/cmake/src/lib/projectM/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(projectm
UNITS *.pas
INCLUDES *.inc
diff --git a/cmake/src/lib/projectM/cwrapper/CMakeLists.txt b/cmake/src/lib/projectM/cwrapper/CMakeLists.txt
index 90880cd8..acca3025 100644
--- a/cmake/src/lib/projectM/cwrapper/CMakeLists.txt
+++ b/cmake/src/lib/projectM/cwrapper/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
if(libprojectM_USE_CWRAPPER)
include_directories(${libprojectM_INCLUDEDIR}/libprojectM)
add_definitions(-DPROJECTM_VERSION_INT=${libprojectM_VERSION_INT})
diff --git a/cmake/src/lib/samplerate/CMakeLists.txt b/cmake/src/lib/samplerate/CMakeLists.txt
index adea4fe1..9aa2f4d0 100644
--- a/cmake/src/lib/samplerate/CMakeLists.txt
+++ b/cmake/src/lib/samplerate/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(samplerate
UNITS *.pas
)
diff --git a/cmake/src/lib/zlib/CMakeLists.txt b/cmake/src/lib/zlib/CMakeLists.txt
index 66b42b7e..7b11202d 100644
--- a/cmake/src/lib/zlib/CMakeLists.txt
+++ b/cmake/src/lib/zlib/CMakeLists.txt
@@ -1,3 +1,5 @@
+# $URL$
+# $Id$
pascal_add_package(zlib
UNITS *.pas
)