Mercurial > almixer_isolated
annotate CMakeLists.txt @ 7:ee50db043251
Cross-platform fixes.
author | Eric Wing <ewing . public |-at-| gmail . com> |
---|---|
date | Thu, 28 Oct 2010 02:33:05 -0700 |
parents | 8cb13d89451a |
children | a71ed111a627 |
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 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
65 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
66 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
67 SET(PUBLIC_HEADERS |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
68 ${ALmixer_SOURCE_DIR}/ALmixer.h |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
69 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
70 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
71 #SET(RESOURCE_FILES |
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 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
74 ADD_DEFINITIONS(-DALMIXER_BUILD_LIBRARY) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
75 IF(ENABLE_ALMIXER_THREADS) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
76 ADD_DEFINITIONS(-DENABLE_ALMIXER_THREADS) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
77 ELSE(ENABLE_ALMIXER_THREADS) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
78 REMOVE_DEFINITIONS(-DENABLE_ALMIXER_THREADS) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
79 ENDIF(ENABLE_ALMIXER_THREADS) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
80 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
81 |
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 IF(WANTS_BUILD_SHARED_LIBRARY) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
84 #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
|
85 ADD_LIBRARY(ALmixer SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE}) |
4
26aec5629f68
Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
3
diff
changeset
|
86 ELSE(WANTS_BUILD_SHARED_LIBRARY) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
87 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
|
88 ENDIF(WANTS_BUILD_SHARED_LIBRARY) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
89 #SET_TARGET_PROPERTIES(ALmixer PROPERTIES OUTPUT_NAME "ALmixer") |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
90 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
91 # Set Dynamic Library and Framework properties |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
92 IF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
93 |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
94 SET_TARGET_PROPERTIES(ALmixer PROPERTIES |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
95 FRAMEWORK TRUE |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
96 FRAMEWORK_VERSION "${ALMIXER_FRAMEWORK_VERSION_NUMBER}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
97 # PRIVATE_HEADER "fooPrivate.h;fooBoth.h" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
98 PUBLIC_HEADER "${PUBLIC_HEADERS}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
99 RESOURCE "${RESOURCE_FILES}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
100 # INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
101 # BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
102 VERSION ${ALMIXER_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
103 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
104 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
105 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
106 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
107 # 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
|
108 # 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
|
109 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
|
110 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
|
111 # 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
|
112 # 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
|
113 # 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
|
114 # 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
|
115 # disable the switch. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
116 IF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
117 # MESSAGE("got dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}") |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
118 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
|
119 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
120 ELSE(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
121 # MESSAGE("no dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}") |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
122 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
|
123 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
124 ENDIF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) |
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 |
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 # 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
|
129 # the user sees in an information panel. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
130 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
|
131 # Bundle version is the version the OS looks at. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
132 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
|
133 SET(MACOSX_FRAMEWORK_IDENTIFIER "net.playcontrol.almixer") |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
134 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
135 ELSEIF(WANTS_BUILD_SHARED_LIBRARY) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
136 IF(APPLE) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
137 SET_TARGET_PROPERTIES(ALmixer PROPERTIES |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
138 FRAMEWORK FALSE |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
139 # INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
140 # BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
141 VERSION ${ALMIXER_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
142 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
143 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
144 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
145 # 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
|
146 # 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
|
147 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
|
148 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
|
149 # 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
|
150 # 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
|
151 # 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
|
152 # 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
|
153 # disable the switch. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
154 IF(CMAKE_DYLIB_INSTALL_NAME_DIR) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
155 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
|
156 ELSE(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 OFF) |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
158 ENDIF(CMAKE_DYLIB_INSTALL_NAME_DIR) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
159 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
160 |
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 ELSEIF(UNIX) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
163 SET_TARGET_PROPERTIES(ALmixer PROPERTIES |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
164 INSTALL_RPATH ${CMAKE_INSTALL_RPATH} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
165 BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
166 VERSION ${ALMIXER_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
167 SOVERSION ${ALMIXER_SOVERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
168 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
169 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
170 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
171 ELSEIF(WIN32) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
172 MESSAGE("Win32") |
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
173 # SET_TARGET_PROPERTIES(ALmixer PROPERTIES |
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
174 # VERSION ${ALMIXER_VERSION} |
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
175 # SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} |
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
176 #) |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
177 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
178 ELSE(APPLE) |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
179 SET_TARGET_PROPERTIES(ALmixer PROPERTIES |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
180 VERSION ${ALMIXER_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
181 SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
182 # COMPILE_FLAGS "${ALMIXER_C_FLAGS}" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
183 ) |
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 ENDIF(APPLE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
186 |
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 ENDIF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
189 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
190 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
|
191 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
|
192 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
193 |
5
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
194 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
195 # For Doxygen |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
196 # 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
|
197 # 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
|
198 # 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
|
199 # 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
|
200 INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
201 #INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/Documentation.cmake OPTIONAL) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
202 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
|
203 MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
204 # 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
|
205 # and then do the equivalent of "make DoxygenDoc". |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
206 IF(BUILD_DOCUMENTATION) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
207 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
208 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
|
209 IF(BUILD_REF_DOCS_SEARCHENGINE) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
210 SET(SEARCHENGINE YES) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
211 ELSE() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
212 SET(SEARCHENGINE NO) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
213 ENDIF() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
214 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
215 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
|
216 IF(BUILD_REF_DOCS_TAGFILE) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
217 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
|
218 ELSE() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
219 SET(GENERATE_TAGFILE "") |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
220 ENDIF() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
221 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
222 IF(DOT) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
223 SET(HAVE_DOT YES) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
224 ELSE() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
225 SET(HAVE_DOT NO) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
226 ENDIF() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
227 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
228 # 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
|
229 SET(GENERATE_HTMLHELP "NO") |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
230 IF(DOCUMENTATION_HTML_HELP) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
231 # 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
|
232 IF(NOT WIN32) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
233 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
|
234 MARK_AS_ADVANCED(HTML_HELP_COMPILER) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
235 ENDIF() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
236 # 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
|
237 SET(GENERATE_HTMLHELP "YES") |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
238 endif() |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
239 |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
240 # 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
|
241 # a final Doxyfile |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
242 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
|
243 ${PROJECT_BINARY_DIR}/doc/ALmixer.doxyfile |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
244 ) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
245 # 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
|
246 |
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 # This creates a new target to build documentation. |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
249 # 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
|
250 # 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
|
251 # (called by FindDocumentation.cmake). |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
252 # It runs the final generated Doxyfile against it. |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
253 # The DOT_PATH is substituted into the Doxyfile. |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
254 ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN} |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
255 ${PROJECT_BINARY_DIR}/doc/ALmixer.doxyfile |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
256 ) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
257 ENDIF(BUILD_DOCUMENTATION) |
8cb13d89451a
Doxygen support and fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
4
diff
changeset
|
258 |
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 |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
262 # Install commands below |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
263 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
|
264 # 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
|
265 INSTALL(TARGETS |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
266 ALmixer |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
267 FRAMEWORK DESTINATION ${CMAKE_FRAMEWORK_INSTALL_DIR} |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
268 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
269 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
|
270 INSTALL(TARGETS |
7
ee50db043251
Cross-platform fixes.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
5
diff
changeset
|
271 ALmixer |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
272 LIBRARY DESTINATION lib |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
273 ARCHIVE DESTINATION lib |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
274 PUBLIC_HEADER DESTINATION include |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
275 ) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
276 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
|
277 |
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 # 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
|
283 CONFIGURE_FILE( |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
284 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
285 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
286 IMMEDIATE @ONLY) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
287 ADD_CUSTOM_TARGET(uninstall |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
288 "${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
|
289 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
290 |
4
26aec5629f68
Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
3
diff
changeset
|
291 # The Examples |
26aec5629f68
Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
3
diff
changeset
|
292 ADD_SUBDIRECTORY(EXAMPLES) |
26aec5629f68
Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
3
diff
changeset
|
293 |
26aec5629f68
Added example programs.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
3
diff
changeset
|
294 |
3
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
295 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
296 # 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
|
297 # 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
|
298 IF(APPLE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
299 # 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
|
300 # 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
|
301 # 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
|
302 # will overwrite any changes the user sets. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
303 # 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
|
304 # 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
|
305 IF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
306 # 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
|
307 # version information we need. (Darwin versions can be changed |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
308 # independently of OS X versions.) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
309 # 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
|
310 IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
311 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
|
312 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
|
313 ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
314 IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
315 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
|
316 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
|
317 ELSE(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
318 # No Universal Binary support |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
319 # 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
|
320 # but the SDK detection is too unreliable here. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
321 ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
322 ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
323 ENDIF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
324 ENDIF(APPLE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
325 |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
326 # 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
|
327 # advantage of this. |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
328 IF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
329 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
|
330 ENDIF(NOT ALMIXER_CONFIG_HAS_BEEN_RUN_BEFORE) |
a929285e1db0
Added CMake build system.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
331 |
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 |