hedgewars/CMakeLists.txt
changeset 95 1ef5e2c41115
parent 89 f9db56409a86
child 98 f1d252c234ec
equal deleted inserted replaced
94:c6eec0bdb630 95:1ef5e2c41115
    16 endif (ppc386_executable)
    16 endif (ppc386_executable)
    17 
    17 
    18 string(REGEX MATCH "[0-9]+\\.[0-9]+" dcc32version "${dcc32_output}")
    18 string(REGEX MATCH "[0-9]+\\.[0-9]+" dcc32version "${dcc32_output}")
    19 if (dcc32version)
    19 if (dcc32version)
    20 	set(pascal_compiler ${dcc32_executable})
    20 	set(pascal_compiler ${dcc32_executable})
    21 	set(pascal_compiler_flags "-B -W"${hwengine_project})
    21 	set(pascal_compiler_flags "-B -W "${hwengine_project})
    22 else (dcc32version)
    22 else (dcc32version)
    23 	string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ppc386_version "${ppc386_output}")
    23 	string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ppc386_version "${ppc386_output}")
    24 	if (ppc386_version)
    24 	if (ppc386_version)
    25 		string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ppc386_vers_major "${ppc386_version}")
    25 		string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ppc386_vers_major "${ppc386_version}")
    26 		string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ppc386_vers_minor "${ppc386_version}")
    26 		string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ppc386_vers_minor "${ppc386_version}")
    28 		math(EXPR ppc386_ver "${ppc386_vers_major}*10000 + ${ppc386_vers_minor}*100 + ${ppc386_vers_patch}")
    28 		math(EXPR ppc386_ver "${ppc386_vers_major}*10000 + ${ppc386_vers_minor}*100 + ${ppc386_vers_patch}")
    29 		if (ppc386_ver LESS "010902")
    29 		if (ppc386_ver LESS "010902")
    30 			message("Minimum required version of FreePascal is 1.9.2")
    30 			message("Minimum required version of FreePascal is 1.9.2")
    31 		else (ppc386_ver LESS "010902")
    31 		else (ppc386_ver LESS "010902")
    32 			set(pascal_compiler ${ppc386_executable})
    32 			set(pascal_compiler ${ppc386_executable})
    33 			set(pascal_compiler_flags "-B -Sd -Xs -OG -O3 -Cs2000000"${hwengine_project})
    33 			set(pascal_compiler_flags "-B -Sd -Xs -OG -O3 -Cs2000000 "${hwengine_project})
    34 		endif (ppc386_ver LESS "010902")
    34 		endif (ppc386_ver LESS "010902")
    35 	endif (ppc386_version)
    35 	endif (ppc386_version)
    36 endif (dcc32version)
    36 endif (dcc32version)
    37 
    37 
    38 if (NOT pascal_compiler)
    38 if (NOT pascal_compiler)
    39 	message(FATAL_ERROR "No Pascal compiler found!")
    39 	message(FATAL_ERROR "No Pascal compiler found!")
    40 endif (NOT pascal_compiler)
    40 endif (NOT pascal_compiler)
    41 
    41 
    42 add_custom_command(COMMAND ${pascal_compiler} TARGET hwengine OUTPUTS hwengine ARGS ${pascal_compiler_flags})
    42 add_custom_target(hwengine ALL COMMAND "${pascal_compiler}" ${pascal_compiler_flags})
    43 
    43 
    44 install(PROGRAMS "hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
    44 install(PROGRAMS "hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)