hedgewars/CMakeLists.txt
changeset 1997 cd66434351cf
parent 1806 3c4f0886c123
child 2003 41b3d00949ca
equal deleted inserted replaced
1996:e9ee8f59f16b 1997:cd66434351cf
    62 
    62 
    63 if (${testnoexecstack})
    63 if (${testnoexecstack})
    64 set (noexecstack_flags "")
    64 set (noexecstack_flags "")
    65 endif (${testnoexecstack})
    65 endif (${testnoexecstack})
    66 
    66 
       
    67 IF(APPLE)
       
    68 	FIND_PACKAGE(SDL)
       
    69 	if (SDL_FOUND)
       
    70 		exec_program(gcc
       
    71 			     ARGS  -c -o ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o  ${hedgewars_SOURCE_DIR}/hedgewars/SDLMain.m -I ${SDL_INCLUDE_DIR})
       
    72 		exec_program(${CMAKE_AR} 
       
    73 			     ARGS -r ${EXECUTABLE_OUTPUT_PATH}/libSDLmain.a ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o)
       
    74 		exec_program(${CMAKE_RANLIB}
       
    75 			     ARGS ${EXECUTABLE_OUTPUT_PATH}/libSDLmain.a)
       
    76 	else (SDL_FOUND)
       
    77 		message(FATAL_ERROR "No SDL framework found!")
       
    78 	endif (SDL_FOUND)
       
    79 
       
    80 ENDIF(APPLE)
       
    81 
       
    82 
    67 string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
    83 string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
    68 if (fpc_version)
    84 if (fpc_version)
    69 	string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
    85 	string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
    70 	string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
    86 	string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
    71 	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
    87 	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
    72 	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
    88 	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
    73 	if (fpc_ver LESS "020200")
    89 	if (fpc_ver LESS "020200")
    74 		message("Minimum required version of FreePascal is 2.2.0")
    90 		message("Minimum required version of FreePascal is 2.2.0")
    75 	else (fpc_ver LESS "020200")
    91 	else (fpc_ver LESS "020200")
    76 		set(pascal_compiler ${fpc_executable})
    92 		set(pascal_compiler ${fpc_executable})
    77 		IF(APPLE)
    93 		set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Fl../bin" "-Cs2000000" "-vwi" "-O2" ${hwengine_project})
    78 			set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Cs2000000" "-vwi" "-O2" "-Fl/opt/local/lib" ${hwengine_project})
       
    79 		ELSE(APPLE)
       
    80 			set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Cs2000000" "-vwi" "-O2" ${hwengine_project})
       
    81 		ENDIF(APPLE)
       
    82 	endif (fpc_ver LESS "020200")
    94 	endif (fpc_ver LESS "020200")
    83 endif (fpc_version)
    95 endif (fpc_version)
    84 
    96 
    85 if (NOT pascal_compiler)
    97 if (NOT pascal_compiler)
    86 	message(FATAL_ERROR "No Pascal compiler found!")
    98 	message(FATAL_ERROR "No Pascal compiler found!")