aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/src/CMakeLists.txt
blob: 08a0819719d0e5430cf4b2f8f984af9f43ffd2e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# $URL$
# $Id$

add_subdirectory(lib)

##
# CONFIGURATION
##

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';")

##
# BUILD
##

#if(DELPHI)
#  PACKAGES ctypes
#endif(DELPHI)
#if(WIN32)
#  PACKAGES bass midi
#endif(WIN32)

set(depends)
if(libprojectM_USE_CWRAPPER)
  list(APPEND depends projectM-cwrapper)
endif(libprojectM_USE_CWRAPPER)

pascal_add_module(ultrastardx ultrastardx.dpr
  #FPC_FLAGS -Si -Cs2000000 # maybe set stack size?
  OUTPUT_DIR ${USDX_GAME_DIR}
  UNITS
    base/*.pas
    macosx/*.pas
    media/*.pas
    menu/*.pas
    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}
)