140 endif() |
140 endif() |
141 else() |
141 else() |
142 message(FATAL_ERROR "No Pascal compiler found!") |
142 message(FATAL_ERROR "No Pascal compiler found!") |
143 endif() |
143 endif() |
144 |
144 |
|
145 |
|
146 #DEPENDECIES AND EXECUTABLES SECTION |
145 find_package(PNG) |
147 find_package(PNG) |
146 if(${PNG_FOUND}) |
148 if(${PNG_FOUND}) |
|
149 message(STATUS "PNG screenshots enabled (library found at ${PNG_LIBRARY})") |
147 set(pascal_compiler_flags_cmn "-dPNG_SCREENSHOTS" ${pascal_compiler_flags_cmn}) |
150 set(pascal_compiler_flags_cmn "-dPNG_SCREENSHOTS" ${pascal_compiler_flags_cmn}) |
|
151 if(APPLE) # need to explictly link with the static lib |
|
152 string(REGEX REPLACE "(.*)libpng.*" "\\1" PNG_LIBDIR "${PNG_LIBRARY}") |
|
153 set(pascal_compiler_flags_cmn "-k${PNG_LIBDIR}/libpng.a" ${pascal_compiler_flags_cmn}) |
|
154 endif() |
148 else() |
155 else() |
149 message(STATUS "PNG library not found, switching to screenshots in BMP format") |
156 message(STATUS "PNG library not found, switching to screenshots in BMP format") |
150 endif() |
157 endif() |
151 |
158 |
152 set(pascal_compiler ${fpc_executable}) |
159 set(pascal_compiler ${fpc_executable}) |
153 set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project}) |
160 set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project}) |
154 |
161 |
155 |
162 |
156 #DEPENDECIES AND EXECUTABLES SECTION |
|
157 IF(NOT APPLE) |
163 IF(NOT APPLE) |
158 #here is the command for standard executables or for shared library |
164 #here is the command for standard executables or for shared library |
159 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" |
165 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" |
160 COMMAND "${pascal_compiler}" |
166 COMMAND "${pascal_compiler}" |
161 ARGS ${pascal_compiler_flags} |
167 ARGS ${pascal_compiler_flags} |