annotate CMakeLists.txt @ 29:1c23805d5ce9

Optimization to destroy bookkeeping thread on BeginInterruption() and recreate it on EndInterruption(). I'm concerned that Android may be running this thread and eating up unnecessary sleep cycles, particularly on certain devices that may have pathological sleep disorders. (There is a report about Samsung Galaxy Tab.)
author Eric Wing <ewing . public |-at-| gmail . com>
date Mon, 28 Mar 2011 16:05:25 -0700
parents 54aa96ae8912
children
rev   line source
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
2 # These are all useless <sigh>
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
3 cmake_policy(SET CMP0000 OLD)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
4 cmake_policy(SET CMP0004 OLD)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
5
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
6 PROJECT(ALmixer)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
7
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
8 INCLUDE(CMakeDependentOption)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
9 SET(CPACK_SET_DESTDIR TRUE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
10 INCLUDE(CPack)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
11 FIND_PACKAGE(OpenAL)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
12 FIND_PACKAGE(SDL)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
13 # Note: SDL_sound needs to be updated for 2.6+. You'll get annoying warnings.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
14 FIND_PACKAGE(SDL_sound)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
15
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
16
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
17
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
18 SET(ALMIXER_MAJOR_VERSION 0)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
19 SET(ALMIXER_MINOR_VERSION 1)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
20 SET(ALMIXER_PATCH_VERSION 0)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
21
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
22 SET(ALMIXER_VERSION ${ALMIXER_MAJOR_VERSION}.${ALMIXER_MINOR_VERSION}.${ALMIXER_PATCH_VERSION})
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
23 SET(ALMIXER_COMPATIBILITY_VERSION ${ALMIXER_MAJOR_VERSION}.${ALMIXER_MINOR_VERSION}.0)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
24 # ??? Don't know
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
25 SET(ALMIXER_SOVERSION ${ALMIXER_MAJOR_VERSION}.${ALMIXER_MINOR_VERSION}.0)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
26
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
27
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
28 OPTION(WANTS_BUILD_SHARED_LIBRARY "Set to ON to build dynamic library." ON)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
29 #OPTION(ALMIXER_COMPILE_WITHOUT_SDL "Not supported. Don't use" OFF)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
30 OPTION(ENABLE_ALMIXER_THREADS "Use background thread for ALmixer_Update()" OFF)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
31
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
32 IF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
33 CMAKE_DEPENDENT_OPTION(WANTS_BUILD_FRAMEWORK "Set to ON to build framework instead of dylib. Only valid if BUILD_SHARED_LIBRARY is ON an is OS X." ON "WANTS_BUILD_SHARED_LIBRARY" ON)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
34 ENDIF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
35
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
36 SET(ALMIXER_LIBRARY_NAME ALmixer)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
37 IF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
38 SET(CMAKE_FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING "Directory to install frameworks to.")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
39 SET(CMAKE_FRAMEWORK_INSTALL_NAME_DIR "@executable_path/../Frameworks" CACHE STRING "install_name path for framework.")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
40 #SET(CMAKE_DYLIB_INSTALL_NAME_DIR "" CACHE STRING "install_name path for dylib.")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
41 SET(CMAKE_DYLIB_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "install_name path for dylib.")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
42 SET(ALMIXER_FRAMEWORK_NAME "${ALMIXER_LIBRARY_NAME}.framework")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
43 SET(ALMIXER_FRAMEWORK_VERSION_NUMBER "A")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
44 SET(ALMIXER_FRAMEWORK_VERSIONED_EXECUTABLE_DIR "Versions/${ALMIXER_FRAMEWORK_VERSION_NUMBER}/MacOS")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
45 SET(ALMIXER_FRAMEWORK_VERSIONED_LIB_DIR "Versions/${ALMIXER_FRAMEWORK_VERSION_NUMBER}/lib")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
46 SET(ALMIXER_FRAMEWORK_CURRENT_EXECUTABLE_DIR "Versions/Current/MacOS")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
47
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
48 # For Apple install_name, is it better to detect if Xcode vs Makefile?
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
49 # Xcode default=1, Makefile=0? Or detect if Framework vs. dylib,
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
50 # Framework=1, dylib=0?
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
51 OPTION(CMAKE_BUILD_WITH_INSTALL_RPATH "Set to YES to set the rpath or install_name on build instead of install." ON)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
52
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
53 ELSEIF(UNIX)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
54 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "rpaths separated by semicolons.")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
55 OPTION(CMAKE_BUILD_WITH_INSTALL_RPATH "Set to YES to set the rpath or install_name on build instead of install." OFF)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
56
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
57 ENDIF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
58
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
59
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
60
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
61 SET(ALMIXER_SOURCE
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
62 ${ALmixer_SOURCE_DIR}/ALmixer.c
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
63 ${ALmixer_SOURCE_DIR}/CircularQueue.c
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
64 ${ALmixer_SOURCE_DIR}/CircularQueue.h
13
54aa96ae8912 Added LinkedList class to project.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 8
diff changeset
65 ${ALmixer_SOURCE_DIR}/LinkedList.c
54aa96ae8912 Added LinkedList class to project.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 8
diff changeset
66 ${ALmixer_SOURCE_DIR}/LinkedList.h
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
67 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
68
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
69 SET(PUBLIC_HEADERS
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
70 ${ALmixer_SOURCE_DIR}/ALmixer.h
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
71 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
72
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
73 #SET(RESOURCE_FILES
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
74 #)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
75
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
76 ADD_DEFINITIONS(-DALMIXER_BUILD_LIBRARY)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
77 IF(ENABLE_ALMIXER_THREADS)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
78 ADD_DEFINITIONS(-DENABLE_ALMIXER_THREADS)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
79 ELSE(ENABLE_ALMIXER_THREADS)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
80 REMOVE_DEFINITIONS(-DENABLE_ALMIXER_THREADS)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
81 ENDIF(ENABLE_ALMIXER_THREADS)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
82
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
83
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
84
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
85 IF(WANTS_BUILD_SHARED_LIBRARY)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
86 #ADD_LIBRARY(ALmixer SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES})
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
87 ADD_LIBRARY(ALmixer SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE})
4
26aec5629f68 Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 3
diff changeset
88 ELSE(WANTS_BUILD_SHARED_LIBRARY)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
89 ADD_LIBRARY(ALmixer STATIC ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES})
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
90 ENDIF(WANTS_BUILD_SHARED_LIBRARY)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
91 #SET_TARGET_PROPERTIES(ALmixer PROPERTIES OUTPUT_NAME "ALmixer")
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
92
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
93 # Set Dynamic Library and Framework properties
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
94 IF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
95
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
96 SET_TARGET_PROPERTIES(ALmixer PROPERTIES
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
97 FRAMEWORK TRUE
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
98 FRAMEWORK_VERSION "${ALMIXER_FRAMEWORK_VERSION_NUMBER}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
99 # PRIVATE_HEADER "fooPrivate.h;fooBoth.h"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
100 PUBLIC_HEADER "${PUBLIC_HEADERS}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
101 RESOURCE "${RESOURCE_FILES}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
102 # INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
103 # BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
104 VERSION ${ALMIXER_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
105 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
106 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
107 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
108
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
109 # I moved the INSTALL_NAME_DIR to use SET_PROPERTY instead because
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
110 # SET_TARGET_PROPERTIES will fail if the variable is empty.
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
111 SET_PROPERTY(TARGET ALmixer PROPERTY INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR})
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
112 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO)
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
113 # If the user deletes the install_name path, use the gcc default
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
114 # and disable the option completely. But CMake by default places
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
115 # the name of the library in the install_name if
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
116 # BUILD_WITH_INSTALL_RPATH is ON. So to avoid this, I need to
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
117 # disable the switch.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
118 IF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
119 # MESSAGE("got dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}")
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
120 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH})
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
121
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
122 ELSE(CMAKE_FRAMEWORK_INSTALL_NAME_DIR)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
123 # MESSAGE("no dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}")
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
124 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO)
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
125
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
126 ENDIF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
127
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
128
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
129
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
130 # Short Version is the "marketing version". It is the version
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
131 # the user sees in an information panel.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
132 SET(MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${ALMIXER_MAJOR_VERSION}.${ALMIXER_MINOR_VERSION}.${ALMIXER_PATCH_VERSION}")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
133 # Bundle version is the version the OS looks at.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
134 SET(MACOSX_FRAMEWORK_BUNDLE_VERSION "${ALMIXER_MAJOR_VERSION}.${ALMIXER_MINOR_VERSION}.${ALMIXER_PATCH_VERSION}")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
135 SET(MACOSX_FRAMEWORK_IDENTIFIER "net.playcontrol.almixer")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
136
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
137 ELSEIF(WANTS_BUILD_SHARED_LIBRARY)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
138 IF(APPLE)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
139 SET_TARGET_PROPERTIES(ALmixer PROPERTIES
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
140 FRAMEWORK FALSE
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
141 # INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
142 # BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
143 VERSION ${ALMIXER_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
144 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
145 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
146 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
147 # I moved the INSTALL_NAME_DIR to use SET_PROPERTY instead because
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
148 # SET_TARGET_PROPERTIES will fail if the variable is empty.
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
149 SET_PROPERTY(TARGET ALmixer PROPERTY INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR})
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
150 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO)
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
151 # If the user deletes the install_name path, use the gcc default
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
152 # and disable the option completely. But CMake by default places
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
153 # the name of the library in the install_name if
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
154 # BUILD_WITH_INSTALL_RPATH is ON. So to avoid this, I need to
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
155 # disable the switch.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
156 IF(CMAKE_DYLIB_INSTALL_NAME_DIR)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
157 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH})
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
158 ELSE(CMAKE_DYLIB_INSTALL_NAME_DIR)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
159 SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH OFF)
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
160 ENDIF(CMAKE_DYLIB_INSTALL_NAME_DIR)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
161
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
162
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
163
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
164 ELSEIF(UNIX)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
165 SET_TARGET_PROPERTIES(ALmixer PROPERTIES
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
166 INSTALL_RPATH ${CMAKE_INSTALL_RPATH}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
167 BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
168 VERSION ${ALMIXER_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
169 SOVERSION ${ALMIXER_SOVERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
170 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
171 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
172
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
173 ELSEIF(WIN32)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
174 # SET_TARGET_PROPERTIES(ALmixer PROPERTIES
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
175 # VERSION ${ALMIXER_VERSION}
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
176 # SOVERSION ${ALMIXER_COMPATIBILITY_VERSION}
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
177 #)
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
178
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
179 ELSE(APPLE)
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
180 SET_TARGET_PROPERTIES(ALmixer PROPERTIES
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
181 VERSION ${ALMIXER_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
182 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
183 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
184 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
185
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
186 ENDIF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
187
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
188
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
189 ENDIF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
190
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
191 INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
192 TARGET_LINK_LIBRARIES(ALmixer ${OPENAL_LIBRARY} ${SDL_SOUND_LIBRARIES} ${SDL_LIBRARY})
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
193
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
194
5
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
195
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
196 # For Doxygen
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
197 # This will find the Doxygen stuff on your system if you want it.
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
198 # I need to use my version because the official version doesn't
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
199 # understand the OS X version of Doxygen. It also doesn't define
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
200 # DOT_PATH which is a problem if dot is not in the path.
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
201 INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
202 #INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/Documentation.cmake OPTIONAL)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
203 OPTION(BUILD_DOCUMENTATION "Build Almixer reference documentation using doxygen (use: make DoxygenDoc)" OFF)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
204 MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
205 # To build the documention, you will have to enable it
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
206 # and then do the equivalent of "make DoxygenDoc".
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
207 IF(BUILD_DOCUMENTATION)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
208
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
209 OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
210 IF(BUILD_REF_DOCS_SEARCHENGINE)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
211 SET(SEARCHENGINE YES)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
212 ELSE()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
213 SET(SEARCHENGINE NO)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
214 ENDIF()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
215
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
216 OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
217 IF(BUILD_REF_DOCS_TAGFILE)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
218 SET(GENERATE_TAGFILE "${PROJECT_BINARY_DIR}/doc/ALmixerDocumentation/ALmixer.tag")
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
219 ELSE()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
220 SET(GENERATE_TAGFILE "")
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
221 ENDIF()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
222
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
223 IF(DOT)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
224 SET(HAVE_DOT YES)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
225 ELSE()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
226 SET(HAVE_DOT NO)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
227 ENDIF()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
228
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
229 # If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
230 SET(GENERATE_HTMLHELP "NO")
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
231 IF(DOCUMENTATION_HTML_HELP)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
232 # on windows Documentation.cmake finds the html help workshop fi it exists. On u*ix we might have it with wine but no way to point it out
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
233 IF(NOT WIN32)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
234 SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
235 MARK_AS_ADVANCED(HTML_HELP_COMPILER)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
236 ENDIF()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
237 # this var sets a proper value in .doxygen files when coniguring them below
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
238 SET(GENERATE_HTMLHELP "YES")
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
239 endif()
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
240
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
241 # This processes our doxyfile.cmake and substitutes paths to generate
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
242 # a final Doxyfile
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
243 CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/ALmixer.doxyfile.cmake
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
244 ${PROJECT_BINARY_DIR}/doc/ALmixer.doxyfile
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
245 )
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
246 # INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/ALmixerDocumentation DESTINATION doc COMPONENT ALmixer-doc)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
247
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
248
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
249 # This creates a new target to build documentation.
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
250 # It runs ${DOXYGEN} which is the full path and executable to
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
251 # Doxygen on your system, set by the FindDoxygen.cmake module
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
252 # (called by FindDocumentation.cmake).
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
253 # It runs the final generated Doxyfile against it.
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
254 # The DOT_PATH is substituted into the Doxyfile.
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
255 ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN}
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
256 ${PROJECT_BINARY_DIR}/doc/ALmixer.doxyfile
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
257 )
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
258 ENDIF(BUILD_DOCUMENTATION)
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
259
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
260
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
261
8cb13d89451a Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 4
diff changeset
262
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
263 # Install commands below
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
264 IF(APPLE AND WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
265 # Will install framework to /Library/Frameworks directory or user specified
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
266 INSTALL(TARGETS
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
267 ALmixer
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
268 FRAMEWORK DESTINATION ${CMAKE_FRAMEWORK_INSTALL_DIR}
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
269 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
270 ELSE(APPLE AND WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
271 INSTALL(TARGETS
7
ee50db043251 Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 5
diff changeset
272 ALmixer
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
273 LIBRARY DESTINATION lib
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
274 ARCHIVE DESTINATION lib
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
275 PUBLIC_HEADER DESTINATION include
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
276 )
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
277 ENDIF(APPLE AND WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
278
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
279
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
280
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
281
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
282
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
283 # For uninstall (needs cmake_uninstall.cmake.in in the top-level directory)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
284 CONFIGURE_FILE(
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
285 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
286 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
287 IMMEDIATE @ONLY)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
288 ADD_CUSTOM_TARGET(uninstall
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
289 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
290
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
291
4
26aec5629f68 Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 3
diff changeset
292 # The Examples
26aec5629f68 Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 3
diff changeset
293 ADD_SUBDIRECTORY(EXAMPLES)
26aec5629f68 Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 3
diff changeset
294
26aec5629f68 Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 3
diff changeset
295
3
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
296
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
297 # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
298 # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
299 IF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
300 # These are just defaults/recommendations, but how we want to build
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
301 # out of the box. But the user needs to be able to change these options.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
302 # So we must only set the values the first time CMake is run, or we
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
303 # will overwrite any changes the user sets.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
304 # FORCE is used because the options are not reflected in the UI otherwise.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
305 # Seems like a good place to add version specific compiler flags too.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
306 IF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
307 # This is really fragile, but CMake doesn't provide the OS system
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
308 # version information we need. (Darwin versions can be changed
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
309 # independently of OS X versions.)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
310 # It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
311 IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
312 SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
313 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5" CACHE STRING "Flags used by the compiler during all build types." FORCE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
314 ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
315 IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
316 SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
317 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.4" CACHE STRING "Flags used by the compiler during all build types." FORCE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
318 ELSE(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
319 # No Universal Binary support
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
320 # Should break down further to set the -mmacosx-version-min,
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
321 # but the SDK detection is too unreliable here.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
322 ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
323 ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
324 ENDIF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
325 ENDIF(APPLE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
326
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
327 # This needs to be run very last so other parts of the scripts can take
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
328 # advantage of this.
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
329 IF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
330 SET(ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
331 ENDIF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE)
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
332
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
333
a929285e1db0 Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
334