tools/CMakeLists.txt
author koda
Tue, 19 Apr 2011 00:43:14 +0200
changeset 5158 4941df038b95
parent 5096 7d588baaff82
child 5169 e353ca78d28b
permissions -rw-r--r--
stats implemented once again! refactoring complete \o/
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2593
dd995a9c8871 add an uninstall target (to be tested)
koda
parents: 2550
diff changeset
     1
if (NOT APPLE)
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
     2
	CONFIGURE_FILE(
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
     3
		"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
     4
		"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
     5
		IMMEDIATE @ONLY)
2593
dd995a9c8871 add an uninstall target (to be tested)
koda
parents: 2550
diff changeset
     6
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
     7
	ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
2593
dd995a9c8871 add an uninstall target (to be tested)
koda
parents: 2550
diff changeset
     8
endif()
dd995a9c8871 add an uninstall target (to be tested)
koda
parents: 2550
diff changeset
     9
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4775
diff changeset
    10
if (APPLE)
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    11
	find_package(Qt4 REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    12
	find_package(SDL REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    13
	find_package(SDL_image REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    14
	find_package(SDL_net REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    15
	find_package(SDL_ttf REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    16
	find_package(SDL_mixer REQUIRED)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    17
	find_package(OGGVORBIS REQUIRED)
4775
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    18
        if(NOT NOAUTOUPDATE)
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    19
		find_package(SPARKLE)
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    20
		if(SPARKLE_FOUND)
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    21
			set(SPARKLE_FOUND 1)
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    22
		else()
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    23
			set(SPARKLE_FOUND 0)
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    24
		endif()
663aa9552bfc add NOAUTOUPDATE symbol and hedgewars-server.cabal
koda
parents: 4341
diff changeset
    25
	endif()
4335
c279aeb615df improve mac bundle creation
koda
parents: 2641
diff changeset
    26
c279aeb615df improve mac bundle creation
koda
parents: 2641
diff changeset
    27
	#use the associated tool from the libraries we've selected
4341
46b8791e577f minor things
koda
parents: 4335
diff changeset
    28
	string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}")
46b8791e577f minor things
koda
parents: 4335
diff changeset
    29
	find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin NO_DEFAULT_PATH)
2219
07f5345ecae7 additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
diff changeset
    30
5096
7d588baaff82 small tweak for bundle creation
koda
parents: 5053
diff changeset
    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
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    32
	if(NOT macdeployqt_EXE)
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    33
		message(FATAL_ERROR "The utility macdeployqt is required to create the bundle!")
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    34
	endif()
2219
07f5345ecae7 additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
diff changeset
    35
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    36
	#dummy target, we're interested in the postscript file
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    37
	add_custom_target(bundle)
2219
07f5345ecae7 additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
diff changeset
    38
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    39
	set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
2219
07f5345ecae7 additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
diff changeset
    40
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    41
	set(frameworks_dir ${bundle_name}/Contents/Frameworks/)
2401
2a694ea2a437 fixes & co.
koda
parents: 2220
diff changeset
    42
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    43
	string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
2547
koda
parents: 2546
diff changeset
    44
2641
b08cafb86797 some tweaks in the mac compilation system
koda
parents: 2593
diff changeset
    45
	CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
2219
07f5345ecae7 additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
diff changeset
    46
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4775
diff changeset
    47
endif()