1 if (NOT APPLE) |
1 if (NOT APPLE) |
2 configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
2 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
3 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
3 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
4 IMMEDIATE @ONLY) |
4 IMMEDIATE @ONLY) |
5 |
5 |
6 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") |
7 endif() |
7 endif() |
8 |
8 |
9 if (APPLE) |
9 if (APPLE) |
10 find_package(Qt4 REQUIRED) |
10 find_package(Qt4 REQUIRED QUIET) |
11 find_package(SDL REQUIRED) |
11 find_package(SDL REQUIRED) |
12 find_package(SDL_image REQUIRED) |
12 find_package(SDL_image REQUIRED) |
13 find_package(SDL_net REQUIRED) |
13 find_package(SDL_net REQUIRED) |
14 find_package(SDL_ttf REQUIRED) |
14 find_package(SDL_ttf REQUIRED) |
15 find_package(SDL_mixer REQUIRED) |
15 find_package(SDL_mixer REQUIRED) |
16 find_package(OGGVORBIS REQUIRED) |
16 find_package(OGGVORBIS REQUIRED) |
17 if(NOT NOAUTOUPDATE) |
17 if(NOT NOAUTOUPDATE) |
18 #needed for SPARKLE_FOUND variable |
18 #needed for SPARKLE_FOUND variable |
19 find_package(Sparkle QUIET) |
19 find_package(Sparkle QUIET) |
20 #needed because the 'if' clause in the script prints silly policy warnings |
20 #needed because the 'if' clause in the script prints silly policy warnings |
21 if(${SPARKLE_FOUND}) |
21 if(${SPARKLE_FOUND}) |
22 set(SPARKLE_FOUND 1) |
22 set(SPARKLE_FOUND 1) |
23 else() |
23 else() |
24 set(SPARKLE_FOUND 0) |
24 set(SPARKLE_FOUND 0) |
25 endif() |
25 endif() |
26 endif() |
26 endif() |
27 |
27 |
28 #use the associated tool from the libraries we've selected |
28 #use the associated tool from the libraries we've selected |
29 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
29 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
30 |
30 |
31 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
31 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
32 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") |
32 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") |
33 |
33 |
34 #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 |
34 if(NOT NOPNG) |
35 find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin) |
35 #get the neme of the library (harmelss if it is static) |
36 if(NOT macdeployqt_executable) |
36 string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}") |
37 message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})") |
37 endif() |
38 else() |
|
39 message(STATUS "macdeployqt found in ${macdeployqt_executable}") |
|
40 endif() |
|
41 |
38 |
42 #dummy target, we're interested in the postscript file |
39 #this tool is present in qt 4.5 but only if you compile from sources |
43 add_custom_target(bundle) |
40 #from qt 4.6 is present also in the binary version |
44 set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
41 find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin) |
|
42 if(NOT macdeployqt_executable) |
|
43 message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})") |
|
44 else() |
|
45 message(STATUS "Found macdeployqt: ${macdeployqt_executable}") |
|
46 endif() |
45 |
47 |
46 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
48 #dummy target, we're interested in the postscript file |
|
49 add_custom_target(bundle) |
|
50 set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
|
51 |
|
52 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake) |
47 endif() |
53 endif() |
48 |
54 |