hedgewars/CMakeLists.txt
author unc0rr
Tue, 11 Jul 2006 21:04:05 +0000
changeset 75 d2b737858ff7
parent 73 fe1c62875a19
child 89 f9db56409a86
permissions -rw-r--r--
- New First Aid powerup - New power progressbar - Less powerful Desert Eagle - Bots can use Desert Eagle - Set TurnTimeLeft to 0 when hh damaged - Bots can handle situation when ammo is over - Bots can go in different directions to reach good position, not just only go left or right - Small fixes for FillLand (use all the array) - Fixes for world geometry, get rid of one variable - Added missed in previous commit files - New test map

add_subdirectory(Data)

set(dcc32_tryexe dcc32.exe)
set(ppc386_tryexe ppc386)
set(hwengine_project "hwengine.dpr")

find_program(dcc32_executable ${dcc32_tryexe})
find_program(ppc386_executable ${ppc386_tryexe})

if (dcc32_executable)
	 exec_program(${dcc32_executable} ARGS "--version" OUTPUT_VARIABLE dcc32_output)
endif (dcc32_executable)

if (ppc386_executable)
	 exec_program(${ppc386_executable} ARGS "-v" OUTPUT_VARIABLE ppc386_output)
endif (ppc386_executable)

string(REGEX MATCH "[0-9]+\\.[0-9]+" dcc32version "${dcc32_output}")
if (dcc32version)
	set(pascal_compiler ${dcc32_executable})
	set(pascal_compiler_flags "-B -W"${hwengine_project})
else (dcc32version)
	string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ppc386_version "${ppc386_output}")
	if (ppc386_version)
		string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ppc386_vers_major "${ppc386_version}")
		string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ppc386_vers_minor "${ppc386_version}")
		string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" ppc386_vers_patch "${ppc386_version}")
		math(EXPR ppc386_ver "${ppc386_vers_major}*10000 + ${ppc386_vers_minor}*100 + ${ppc386_vers_patch}")
		if (ppc386_ver LESS "010902")
			message("Minimum required version of FreePascal is 1.9.2")
		else (ppc386_ver LESS "010902")
			set(pascal_compiler ${ppc386_executable})
			set(pascal_compiler_flags "-B -Sd -Xs -OG -O3 -Cs2000000"${hwengine_project})
		endif (ppc386_ver LESS "010902")
	endif (ppc386_version)
endif (dcc32version)

if (NOT pascal_compiler)
	message(FATAL_ERROR "No Pascal compiler found!")
endif (NOT pascal_compiler)

add_custom_target(hwengine ALL
	${pascal_compiler} ${pascal_compiler_flags})

install_targets(/bin hwengine)