1 if (NOT APPLE) |
1 if (NOT APPLE) |
2 CONFIGURE_FILE( |
2 configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
3 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
3 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
4 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
4 IMMEDIATE @ONLY) |
5 IMMEDIATE @ONLY) |
|
6 |
5 |
7 ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") |
6 add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") |
8 endif() |
7 endif() |
9 |
8 |
10 if (APPLE) |
9 if (APPLE) |
11 find_package(Qt4 REQUIRED) |
10 find_package(Qt4 REQUIRED) |
12 find_package(SDL REQUIRED) |
11 find_package(SDL REQUIRED) |
14 find_package(SDL_net REQUIRED) |
13 find_package(SDL_net REQUIRED) |
15 find_package(SDL_ttf REQUIRED) |
14 find_package(SDL_ttf REQUIRED) |
16 find_package(SDL_mixer REQUIRED) |
15 find_package(SDL_mixer REQUIRED) |
17 find_package(OGGVORBIS REQUIRED) |
16 find_package(OGGVORBIS REQUIRED) |
18 if(NOT NOAUTOUPDATE) |
17 if(NOT NOAUTOUPDATE) |
19 find_package(SPARKLE) |
18 #needed for SPARKLE_FOUND variable |
20 if(SPARKLE_FOUND) |
19 find_package(Sparkle QUIET) |
21 set(SPARKLE_FOUND 1) |
|
22 else() |
|
23 set(SPARKLE_FOUND 0) |
|
24 endif() |
|
25 endif() |
20 endif() |
26 |
21 |
27 #use the associated tool from the libraries we've selected |
22 #use the associated tool from the libraries we've selected |
28 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
23 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
29 find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin NO_DEFAULT_PATH) |
24 |
|
25 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
|
26 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") |
30 |
27 |
31 #this tool is present in qt 4.5 but only if you compile from sources; from qt 4.6 is present also in the binary version |
28 #this tool is present in qt 4.5 but only if you compile from sources; from qt 4.6 is present also in the binary version |
|
29 find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin NO_DEFAULT_PATH) |
32 if(NOT macdeployqt_EXE) |
30 if(NOT macdeployqt_EXE) |
33 message(FATAL_ERROR "The utility macdeployqt is required to create the bundle!") |
31 message(FATAL_ERROR "The utility macdeployqt is required to create the bundle!") |
34 endif() |
32 endif() |
35 |
33 |
36 #dummy target, we're interested in the postscript file |
34 #dummy target, we're interested in the postscript file |
37 add_custom_target(bundle) |
35 add_custom_target(bundle) |
38 |
|
39 set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
36 set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
40 |
37 |
41 set(frameworks_dir ${bundle_name}/Contents/Frameworks/) |
38 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
|
39 endif() |
42 |
40 |
43 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") |
|
44 |
|
45 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
|
46 |
|
47 endif() |
|