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 AND NOT SKIPBUNDLE) |
10 find_package(Qt4 REQUIRED QUIET) |
10 find_package(Qt4 REQUIRED QUIET) |
11 if(${NOSDL2}) |
11 find_package(SDL2 REQUIRED) |
12 find_package(SDL REQUIRED) |
12 find_package(SDL2_image REQUIRED) |
13 find_package(SDL_image REQUIRED) |
13 find_package(SDL2_net REQUIRED) |
14 find_package(SDL_net REQUIRED) |
14 find_package(SDL2_ttf REQUIRED) |
15 find_package(SDL_ttf REQUIRED) |
15 find_package(SDL2_mixer REQUIRED) |
16 find_package(SDL_mixer REQUIRED) |
16 |
17 find_package(OggVorbis REQUIRED) |
17 find_package(PNG REQUIRED) |
18 else(${NOSDL2}) |
|
19 find_package(SDL2 REQUIRED) |
|
20 find_package(SDL2_image REQUIRED) |
|
21 find_package(SDL2_net REQUIRED) |
|
22 find_package(SDL2_ttf REQUIRED) |
|
23 find_package(SDL2_mixer REQUIRED) |
|
24 endif(${NOSDL2}) |
|
25 |
18 |
26 if(NOT NOAUTOUPDATE) |
19 if(NOT NOAUTOUPDATE) |
27 find_package(Sparkle) #needed for SPARKLE_FOUND variable |
20 find_package(Sparkle) #needed for SPARKLE_FOUND variable |
28 #needed because the 'if' clause in the script prints silly policy warnings |
21 #needed because the 'if' clause in the script prints silly policy warnings |
29 if(${SPARKLE_FOUND}) |
22 if(SPARKLE_FOUND) |
30 set(SPARKLE_FOUND 1) |
23 set(SPARKLE_FOUND 1) |
31 else() |
24 else() |
32 set(SPARKLE_FOUND 0) |
25 set(SPARKLE_FOUND 0) |
33 endif() |
26 endif() |
34 endif() |
27 endif() |
36 #use the associated tool from the libraries we've selected |
29 #use the associated tool from the libraries we've selected |
37 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
30 string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}") |
38 |
31 |
39 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
32 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
40 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_library_only "${SDL_LIBRARY}") |
33 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_library_only "${SDL_LIBRARY}") |
|
34 #remove the "libSDLmain.a" from the SDL_LIBRARY variable |
|
35 string(REGEX REPLACE ".*;(.*)" "\\1" sdl_library_only "${sdl_library_only}") |
41 |
36 |
42 if(NOT NOPNG) |
37 #get the neme of the library (harmelss if it is static) |
43 #get the neme of the library (harmelss if it is static) |
38 string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}") |
44 string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}") |
39 string(REGEX REPLACE ".*/(.*)$" "\\1" ZLIB_LIBNAME "${ZLIB_LIBRARY}") |
45 string(REGEX REPLACE ".*/(.*)$" "\\1" ZLIB_LIBNAME "${ZLIB_LIBRARY}") |
|
46 endif() |
|
47 |
40 |
48 set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}) |
41 set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}) |
49 if(${BUILD_ENGINE_LIBRARY}) |
42 if(${BUILD_ENGINE_LIBRARY}) |
50 set(engine_full_path "${frameworks_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
43 set(engine_full_path "${frameworks_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}") |
51 else() |
44 else() |
64 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake |
57 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake |
65 CODE "message(STATUS \"Your app bundle is ready\")") |
58 CODE "message(STATUS \"Your app bundle is ready\")") |
66 |
59 |
67 #create the .dmg for deployment |
60 #create the .dmg for deployment |
68 #first make sure .app exists, then remove any old .dmg with same name, finally run the script |
61 #first make sure .app exists, then remove any old .dmg with same name, finally run the script |
69 add_custom_target(dmg COMMAND if [ ! -a Hedgewars.app ]; then make install\; fi; |
62 add_custom_target(dmg COMMAND make install |
70 COMMAND rm -f ${CMAKE_BINARY_DIR}/Hedgewars-${HEDGEWARS_VERSION}.dmg |
63 COMMAND rm -f ${CMAKE_BINARY_DIR}/Hedgewars-${HEDGEWARS_VERSION}.dmg |
71 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create-dmg.sh |
64 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create-dmg.sh |
72 --volname "Hedgewars ${HEDGEWARS_VERSION}" |
65 --volname "Hedgewars ${HEDGEWARS_VERSION}" |
73 # --volicon icon.icns |
66 # --volicon icon.icns |
74 --window-size 600 470 |
67 --window-size 600 470 |