4 option(PLUGIN_SCHEMATYC "Enables compilation of the Schematyc plugin (currently Schematyc2.dll)" OFF)
5 option(PLUGIN_SCHEMATYC_EXPERIMENTAL "Enables compilation of the Experimental Schematyc plugin (Schematyc.dll)" ON)
7 option(OPTION_PAKTOOLS "Build .pak encryption tools" OFF)
8 option(OPTION_RC "Include RC in the build" ${WINDOWS})
10 option(OPTION_DOXYGEN_EXAMPLES "Build Doxygen examples with the engine" OFF)
13 option(OPTION_ENABLE_CRASHRPT "Enable CrashRpt crash reporting library" ON)
16 if(NOT ANDROID AND NOT ORBIS)
17 option(OPTION_SCALEFORMHELPER "Use Scaleform Helper" ON)
19 set(OPTION_SCALEFORMHELPER ON)
23 if(OPTION_DEDICATED_SERVER)
24 set(OPTION_SCALEFORMHELPER OFF)
28 option(OPTION_DEVELOPER_CONSOLE_IN_RELEASE "Enables the developer console in Release builds" ON)
30 #The remote console is useful in development, but it is a potential security vulnerability, therefore opt-in
31 option(OPTION_REMOTE_CONSOLE "Allows remote console connection" OFF)
33 if(NOT ANDROID) # Unit test is disabled for Android until fully supported
34 if(EXISTS "${SDK_DIR}/googletest_CE_Support")
35 option(OPTION_UNIT_TEST "Unit Tests" ON)
36 elseif(OPTION_UNIT_TEST)
37 message(STATUS "Google Test not found in ${SDK_DIR}/googletest_CE_Support - disabling unit tests.")
39 # Disables the OPTION_UNIT_TEST option but also updates the message in the cache that is then used in the GUI as a tooltip.
40 set(OPTION_UNIT_TEST OFF CACHE BOOL "OPTION_UNIT_TEST was previously set but Google Test is not available. Check bootstrap settings." FORCE)
47 # Oculus SDK 1.40.0 does not compile starting with Visual Studio 2019 16.3.0 (vc142)
48 if (MSVC_VERSION LESS 1923)
49 if(EXISTS "${SDK_DIR}/OculusSDK")
50 option(PLUGIN_VR_OCULUS "Oculus support" ON)
52 option(PLUGIN_VR_OCULUS "Oculus support" OFF)
55 message(WARNING "Disabling Oculus VR Plugin because Oculus SDK 1.40.0 does not compile starting with Visual Studio 2019 16.3.0 (vc142)")
56 unset(PLUGIN_VR_OCULUS CACHE)
59 option(OPTION_CRYMONO "C# support" OFF)
62 option(OPTION_CRYMONO_SWIG "Expose C++ API to C# with SWIG" ON)
64 if(EXISTS "${SDK_DIR}/OSVR")
65 option(PLUGIN_VR_OSVR "OSVR support" ON)
67 option(PLUGIN_VR_OSVR "OSVR support" OFF)
70 option(OPTION_PHYSDBGR "Include standalone physics debugger in the build" OFF)
75 option(PLUGIN_VR_EMULATOR "VR emulation support" ON)
80 option(PLUGIN_USERANALYTICS "Enable User Analytics" ON)
81 if(EXISTS "${SDK_DIR}/OpenVR")
82 option(PLUGIN_VR_OPENVR "OpenVR support" ON)
84 option(PLUGIN_VR_OPENVR "OpenVR support" OFF)
88 option(OPTION_UNSIGNED_PAKS_IN_RELEASE "Allow unsigned PAK files to be used for release builds" ON)
90 if(WINDOWS AND EXISTS "${CRYENGINE_DIR}/Code/Sandbox/EditorQt")
91 option(OPTION_SANDBOX "Enable Sandbox" ON)
92 if (EXISTS "${SDK_DIR}/SubstanceEngines")
93 option(OPTION_SANDBOX_SUBSTANCE "Enable Sandbox Substance Integration" ON)
95 if(NOT OPTION_SANDBOX AND OPTION_SANDBOX_SUBSTANCE)
96 set(OPTION_SANDBOX_SUBSTANCE OFF)
101 option(OPTION_ENABLE_BROFILER "Enable Brofiler profiler support" ON)
105 if(NOT (ORBIS OR ANDROID OR LINUX))
106 option(RENDERER_DX11 "Renderer for DirectX 11" ON)
110 if (MSVC_VERSION LESS 1900)
111 message(STATUS "MSVC 14.0 or above is required to build CryRenderD3D12.")
113 option(RENDERER_DX12 "Renderer for DirectX 12" ON)
118 set(RENDERER_GNM ON) # TODO: remove after cleanup
119 option(GNM_VALIDATION "Enable GNM validation" ON)
122 if(WINDOWS OR LINUX OR ANDROID)
123 option(RENDERER_VULKAN "Renderer for Vulkan API" ON)
124 if (RENDERER_VULKAN AND NOT EXISTS "${SDK_DIR}/VulkanSDK")
125 message(STATUS "Vulkan SDK not found in ${SDK_DIR}/VulkanSDK - disabling Vulkan renderer.")
127 # Disables the RENDERER_VULKAN option but also updates the message in the cache that is then used in the GUI as a tooltip.
128 set(RENDERER_VULKAN OFF CACHE BOOL "Disabled Vulkan renderer due to absent Vulkan SDK. Must reside in ${SDK_DIR}/VulkanSDK" FORCE)
133 # Occlusion is enabled by default
134 option(AUDIO_USE_OCCLUSION "Enable" ON)
136 function(try_to_enable_fmod)
138 if (DEFINED AUDIO_FMOD)
140 if (EXISTS "${SDK_DIR}/Audio/fmod")
141 message(STATUS "Fmod SDK found in ${SDK_DIR}/Audio/fmod - enabling Fmod support.")
143 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
144 option(AUDIO_FMOD "Fmod SDK found in ${SDK_DIR}/Audio/fmod." ON)
146 include(${TOOLS_CMAKE_DIR}/modules/fmod.cmake)
148 message(STATUS "Fmod SDK not found in ${SDK_DIR}/Audio/fmod - disabling Fmod support.")
150 # Disables the AUDIO_FMOD option but also updates the message in the cache that is then used in the GUI as a tooltip.
151 option(AUDIO_FMOD "Fmod SDK not found in ${SDK_DIR}/Audio/fmod." OFF)
154 if (EXISTS "${SDK_DIR}/Audio/fmod")
155 message(STATUS "Fmod SDK found in ${SDK_DIR}/Audio/fmod but AUDIO_FMOD option turned OFF")
157 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
158 option(AUDIO_FMOD "Fmod SDK found in ${SDK_DIR}/Audio/fmod but AUDIO_FMOD option turned OFF." OFF)
160 message(STATUS "Fmod SDK not found in ${SDK_DIR}/Audio/fmod and AUDIO_FMOD option turned OFF")
162 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
163 option(AUDIO_FMOD "Fmod SDK not found in ${SDK_DIR}/Audio/fmod and AUDIO_FMOD option turned OFF." OFF)
167 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
168 if (EXISTS "${SDK_DIR}/Audio/fmod")
169 message(STATUS "Fmod SDK found in ${SDK_DIR}/Audio/fmod - enabling Fmod support.")
170 set(AUDIO_FMOD ON CACHE BOOL "Fmod SDK found in ${SDK_DIR}/Audio/fmod." FORCE)
171 include(${TOOLS_CMAKE_DIR}/modules/fmod.cmake)
173 message(STATUS "Fmod SDK not found in ${SDK_DIR}/Audio/fmod - disabling Fmod support.")
174 set(AUDIO_FMOD OFF CACHE BOOL "Fmod SDK not found in ${SDK_DIR}/Audio/fmod." FORCE)
178 message(STATUS "Disabling Fmod support due to unsupported platform.")
179 set(AUDIO_FMOD OFF CACHE BOOL "Fmod disabled due to unsupported platform." FORCE)
181 endfunction(try_to_enable_fmod)
183 function(try_to_enable_portaudio)
185 if (DEFINED AUDIO_PORTAUDIO)
187 if (EXISTS "${SDK_DIR}/Audio/portaudio" AND EXISTS "${SDK_DIR}/Audio/libsndfile")
188 message(STATUS "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile - enabling PortAudio support.")
190 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
191 option(AUDIO_PORTAUDIO "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile." ON)
193 include(${TOOLS_CMAKE_DIR}/modules/PortAudio.cmake)
195 message(STATUS "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile - disabling PortAudio support.")
197 # Disables the AUDIO_PORTAUDIO option but also updates the message in the cache that is then used in the GUI as a tooltip.
198 option(AUDIO_PORTAUDIO "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile." OFF)
201 if (EXISTS "${SDK_DIR}/Audio/portaudio" AND EXISTS "${SDK_DIR}/Audio/libsndfile")
202 message(STATUS "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile but AUDIO_PORTAUDIO option turned OFF")
204 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
205 option(AUDIO_PORTAUDIO "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile but AUDIO_PORTAUDIO option turned OFF." OFF)
207 message(STATUS "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile and AUDIO_PORTAUDIO option turned OFF")
209 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
210 option(AUDIO_PORTAUDIO "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile and AUDIO_PORTAUDIO option turned OFF." OFF)
214 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
215 if (EXISTS "${SDK_DIR}/Audio/portaudio" AND EXISTS "${SDK_DIR}/Audio/libsndfile")
216 message(STATUS "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile - enabling PortAudio support.")
217 set(AUDIO_PORTAUDIO ON CACHE BOOL "PortAudio and libsndfile SDKs found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile." FORCE)
218 include(${TOOLS_CMAKE_DIR}/modules/PortAudio.cmake)
220 message(STATUS "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile - disabling PortAudio support.")
221 set(AUDIO_PORTAUDIO OFF CACHE BOOL "PortAudio or libsndfile SDK not found in ${SDK_DIR}/Audio/portaudio and ${SDK_DIR}/Audio/libsndfile." FORCE)
225 message(STATUS "Disabling PortAudio support due to unsupported platform.")
226 set(AUDIO_PORTAUDIO OFF CACHE BOOL "PortAudio disabled due to unsupported platform." FORCE)
228 endfunction(try_to_enable_portaudio)
230 function(try_to_enable_sdl_mixer)
231 if (LINUX OR ANDROID OR WINDOWS)
232 # We build SDL_mixer ourselves for these platforms.
233 option(AUDIO_SDL_MIXER "SDL_mixer support" ON)
236 # Supported platforms and the user enabled the AUDIO_SDL_MIXER option.
237 message(STATUS "Enabling SDL_mixer support.")
239 # Supported platforms but the user disabled the AUDIO_SDL_MIXER option.
240 message(STATUS "SDL_mixer support manually disabled.")
243 message(STATUS "Disabling SDL_mixer support due to unsupported platform.")
244 set(AUDIO_SDL_MIXER OFF CACHE BOOL "SDL_mixer disabled due to unsupported platform." FORCE)
246 endfunction(try_to_enable_sdl_mixer)
248 function(try_to_enable_wwise)
249 if (DEFINED AUDIO_WWISE)
251 if (EXISTS "${SDK_DIR}/Audio/wwise")
252 message(STATUS "Wwise SDK found in ${SDK_DIR}/Audio/wwise - enabling Wwise support.")
254 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
255 option(AUDIO_WWISE "Wwise SDK found in ${SDK_DIR}/Audio/wwise." ON)
257 message(STATUS "Wwise SDK not found in ${SDK_DIR}/Audio/wwise - disabling Wwise support.")
259 # Disables the AUDIO_WWISE option but also updates the message in the cache that is then used in the GUI as a tooltip.
260 option(AUDIO_WWISE "Wwise SDK not found in ${SDK_DIR}/Audio/wwise." OFF)
263 if (EXISTS "${SDK_DIR}/Audio/wwise")
264 message(STATUS "Wwise SDK found in ${SDK_DIR}/Audio/wwise but AUDIO_WWISE option turned OFF")
266 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
267 option(AUDIO_WWISE "Wwise SDK found in ${SDK_DIR}/Audio/wwise but AUDIO_WWISE option turned OFF." OFF)
269 message(STATUS "Wwise SDK not found in ${SDK_DIR}/Audio/wwise and AUDIO_WWISE option turned OFF")
271 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
272 option(AUDIO_WWISE "Wwise SDK not found in ${SDK_DIR}/Audio/wwise and AUDIO_WWISE option turned OFF." OFF)
276 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
277 if (EXISTS "${SDK_DIR}/Audio/wwise")
278 message(STATUS "Wwise SDK found in ${SDK_DIR}/Audio/wwise - enabling Wwise support.")
279 set(AUDIO_WWISE ON CACHE BOOL "Wwise SDK found in ${SDK_DIR}/Audio/wwise." FORCE)
281 message(STATUS "Wwise SDK not found in ${SDK_DIR}/Audio/wwise - disabling Wwise support.")
282 set(AUDIO_WWISE OFF CACHE BOOL "Wwise SDK not found in ${SDK_DIR}/Audio/wwise." FORCE)
285 endfunction(try_to_enable_wwise)
287 function(try_to_enable_adx2)
289 if (DEFINED AUDIO_ADX2)
291 if (EXISTS "${SDK_DIR}/Audio/adx2")
292 message(STATUS "ADX2 SDK found in ${SDK_DIR}/Audio/adx2 - enabling ADX2 support.")
294 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
295 option(AUDIO_ADX2 "ADX2 SDK found in ${SDK_DIR}/Audio/adx2." ON)
297 message(STATUS "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2 - disabling ADX2 support.")
299 # Disables the AUDIO_ADX2 option but also updates the message in the cache that is then used in the GUI as a tooltip.
300 option(AUDIO_ADX2 "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2." OFF)
303 if (EXISTS "${SDK_DIR}/Audio/adx2")
304 message(STATUS "ADX2 SDK found in ${SDK_DIR}/Audio/adx2 but AUDIO_ADX2 option turned OFF")
306 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
307 option(AUDIO_ADX2 "ADX2 SDK found in ${SDK_DIR}/Audio/adx2 but AUDIO_ADX2 option turned OFF." OFF)
309 message(STATUS "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2 and AUDIO_ADX2 option turned OFF")
311 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
312 option(AUDIO_ADX2 "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2 and AUDIO_ADX2 option turned OFF." OFF)
316 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
317 if (EXISTS "${SDK_DIR}/Audio/adx2")
318 message(STATUS "ADX2 SDK found in ${SDK_DIR}/Audio/adx2 - enabling ADX2 support.")
319 set(AUDIO_ADX2 ON CACHE BOOL "ADX2 SDK found in ${SDK_DIR}/Audio/adx2." FORCE)
321 message(STATUS "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2 - disabling ADX2 support.")
322 set(AUDIO_ADX2 OFF CACHE BOOL "ADX2 SDK not found in ${SDK_DIR}/Audio/adx2." FORCE)
326 message(STATUS "Disabling ADX2 support due to unsupported platform.")
327 set(AUDIO_ADX2 OFF CACHE BOOL "ADX2 disabled due to unsupported platform." FORCE)
329 endfunction(try_to_enable_adx2)
331 function(try_to_enable_oculus_hrtf)
333 if (DEFINED AUDIO_OCULUS_HRTF)
334 if (AUDIO_OCULUS_HRTF)
335 if (EXISTS "${SDK_DIR}/Audio/oculus")
336 message(STATUS "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus - enabling Oculus HRTF support.")
338 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
339 option(AUDIO_OCULUS_HRTF "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus." ON)
341 message(STATUS "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus - disabling Oculus HRTF support.")
343 # Disables the AUDIO_OCULUS_HRTF option but also updates the message in the cache that is then used in the GUI as a tooltip.
344 option(AUDIO_OCULUS_HRTF "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus." OFF)
347 if (EXISTS "${SDK_DIR}/Audio/oculus")
348 message(STATUS "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus but AUDIO_OCULUS_HRTF option turned OFF")
350 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
351 option(AUDIO_OCULUS_HRTF "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus but AUDIO_OCULUS_HRTF option turned OFF." OFF)
353 message(STATUS "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus and AUDIO_OCULUS_HRTF option turned OFF")
355 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
356 option(AUDIO_OCULUS_HRTF "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus and AUDIO_OCULUS_HRTF option turned OFF." OFF)
360 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
361 if (EXISTS "${SDK_DIR}/Audio/oculus")
362 message(STATUS "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus - enabling Oculus HRTF support.")
363 set(AUDIO_OCULUS_HRTF ON CACHE BOOL "Oculus audio SDK found in ${SDK_DIR}/Audio/oculus." FORCE)
365 message(STATUS "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus - disabling Oculus HRTF support.")
366 set(AUDIO_OCULUS_HRTF OFF CACHE BOOL "Oculus audio SDK not found in ${SDK_DIR}/Audio/oculus." FORCE)
370 message(STATUS "Disabling Oculus HRTF support due to unsupported platform.")
371 set(AUDIO_OCULUS_HRTF OFF CACHE BOOL "Oculus HRTF disabled due to unsupported platform." FORCE)
373 endfunction(try_to_enable_oculus_hrtf)
375 function(try_to_enable_cryspatial)
376 if(WINDOWS OR DURANGO)
377 if (DEFINED AUDIO_CRYSPATIAL)
378 if (AUDIO_CRYSPATIAL)
379 if (EXISTS "${SDK_DIR}/Audio/cryspatial")
380 message(STATUS "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial - enabling CrySpatial HRTF support.")
382 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
383 option(AUDIO_CRYSPATIAL "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial." ON)
385 message(STATUS "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial - disabling CrySpatial HRTF support.")
387 # Disables the AUDIO_CRYSPATIAL option but also updates the message in the cache that is then used in the GUI as a tooltip.
388 option(AUDIO_CRYSPATIAL "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial." OFF)
391 if (EXISTS "${SDK_DIR}/Audio/cryspatial")
392 message(STATUS "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial but AUDIO_CRYSPATIAL option turned OFF")
394 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
395 option(AUDIO_CRYSPATIAL "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial but AUDIO_CRYSPATIAL option turned OFF." OFF)
397 message(STATUS "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial and AUDIO_CRYSPATIAL option turned OFF")
399 # This is to update only the message in the cache that is then used in the GUI as a tooltip.
400 option(AUDIO_CRYSPATIAL "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial and AUDIO_CRYSPATIAL option turned OFF." OFF)
404 # If this option is not in the cache yet, set it depending on whether the SDK is present or not.
405 if (EXISTS "${SDK_DIR}/Audio/cryspatial")
406 message(STATUS "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial - enabling CrySpatial HRTF support.")
407 set(AUDIO_CRYSPATIAL ON CACHE BOOL "CrySpatial audio SDK found in ${SDK_DIR}/Audio/cryspatial." FORCE)
409 message(STATUS "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial - disabling CrySpatial HRTF support.")
410 set(AUDIO_CRYSPATIAL OFF CACHE BOOL "CrySpatial audio SDK not found in ${SDK_DIR}/Audio/cryspatial." FORCE)
414 message(STATUS "Disabling CrySpatial HRTF support due to unsupported platform.")
415 set(AUDIO_CRYSPATIAL OFF CACHE BOOL "CrySpatial HRTF disabled due to unsupported platform." FORCE)
417 endfunction(try_to_enable_cryspatial)
420 try_to_enable_portaudio()
421 try_to_enable_sdl_mixer()
422 try_to_enable_wwise()
424 try_to_enable_oculus_hrtf()
425 try_to_enable_cryspatial()
429 option(PHYSICS_CRYPHYSICS "Enable" ON)
431 option(PHYSICS_PHYSX "Enable" OFF)
434 include("${TOOLS_CMAKE_DIR}/modules/PhysX.cmake")
437 include_directories("${CRYENGINE_DIR}/Code/CryEngine/CryCommon")
438 include_directories("${CRYENGINE_DIR}/Code/CryEngine/CryCommon/3rdParty")
439 include_directories("${SDK_DIR}/boost")
440 include_directories("${CRYENGINE_DIR}/Code/CryEngine/CrySchematyc/Core/Interface")
443 # link_libraries (Ntdll)
446 if (OPTION_SCALEFORMHELPER AND NOT (OPTION_ENGINE OR OPTION_SHADERCACHEGEN))
447 add_subdirectory ("Code/CryEngine/CrySystem/Scaleform")
450 if (OPTION_ENGINE OR OPTION_SHADERCACHEGEN OR OPTION_DOXYGEN_EXAMPLES)
451 add_subdirectory ("Code/CryEngine/CryCommon")
454 if (OPTION_ENGINE OR OPTION_SHADERCACHEGEN)
455 add_subdirectory ("Code/CryEngine/CrySystem")
456 add_subdirectory ("Code/CryEngine/RenderDll/XRenderD3D9")
458 # Shaders custom project
459 if(EXISTS "${CRYENGINE_DIR}/Engine/Shaders")
460 add_subdirectory(Engine/Shaders)
466 add_subdirectory ("Code/CryEngine/Cry3DEngine")
467 add_subdirectory ("Code/CryEngine/CryAction")
468 add_subdirectory ("Code/CryEngine/CryAISystem")
469 add_subdirectory ("Code/CryEngine/CryAnimation")
470 add_subdirectory ("Code/CryEngine/CryAudioSystem/Common")
471 add_subdirectory ("Code/CryEngine/CryAudioSystem")
472 add_subdirectory ("Code/CryEngine/CryDynamicResponseSystem")
473 add_subdirectory ("Code/CryEngine/CryEntitySystem")
474 add_subdirectory ("Code/CryEngine/CryFont")
475 add_subdirectory ("Code/CryEngine/CryInput")
476 add_subdirectory ("Code/CryEngine/CryMovie")
477 add_subdirectory ("Code/CryEngine/CryNetwork")
478 if (PLUGIN_SCHEMATYC_EXPERIMENTAL)
479 target_compile_definitions(CrySystem PUBLIC USE_SCHEMATYC_EXPERIMENTAL=1)
480 if (TARGET CrySystemLib)
481 target_compile_definitions(CrySystemLib PUBLIC USE_SCHEMATYC_EXPERIMENTAL=1)
483 add_subdirectory ("Code/CryEngine/CrySchematyc")
486 if (NOT ANDROID AND PLUGIN_SCHEMATYC)
487 target_compile_definitions(CrySystem PUBLIC USE_SCHEMATYC=1)
488 if (TARGET CrySystemLib)
489 target_compile_definitions(CrySystemLib PUBLIC USE_SCHEMATYC=1)
491 add_subdirectory ("Code/CryEngine/CrySchematyc2")
493 add_subdirectory ("Code/CryEngine/CryScriptSystem")
494 add_subdirectory ("Code/CryEngine/CryFlowGraph")
495 add_subdirectory ("Code/CryEngine/CryUDR")
498 add_subdirectory ("Code/CryEngine/CryLiveCreate")
503 target_compile_definitions(CrySystem PUBLIC USE_MONO=1)
504 if (TARGET CrySystemLib)
505 target_compile_definitions(CrySystemLib PUBLIC USE_MONO=1)
510 if (PHYSICS_CRYPHYSICS)
511 add_subdirectory ("Code/CryEngine/CryPhysics")
514 add_subdirectory ("Code/CryEngine/CryPhysicsSystem/CryPhysX")
519 add_subdirectory ("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplFmod")
522 add_subdirectory ("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplPortAudio")
523 endif (AUDIO_PORTAUDIO)
525 add_subdirectory ("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplSDLMixer")
526 add_subdirectory ("Code/Libs/libmikmod")
527 add_subdirectory ("Code/Libs/libmodplug")
528 add_subdirectory ("Code/Libs/libogg")
529 add_subdirectory ("Code/Libs/libvorbis")
530 add_subdirectory ("Code/Libs/SDL_mixer")
531 add_subdirectory ("Code/Libs/smpeg")
532 endif (AUDIO_SDL_MIXER)
534 add_subdirectory ("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplWwise")
536 if (AUDIO_CRYSPATIAL)
537 add_subdirectory("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplWwise/plugins/CrySpatial/WwisePlugin")
538 add_subdirectory("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplWwise/plugins/CrySpatial/SoundEnginePlugin")
539 add_subdirectory("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplFmod/plugins/CrySpatial")
542 add_subdirectory ("Code/CryEngine/CryAudioSystem/implementations/CryAudioImplAdx2")
546 add_subdirectory ("Code/Libs/bigdigits")
547 add_subdirectory ("Code/Libs/mikkelsen")
550 add_subdirectory("Code/Libs/oculus")
553 if (WINDOWS OR LINUX)
554 add_subdirectory ("Code/Libs/curl")
556 add_subdirectory ("Code/Libs/freetype")
557 add_subdirectory ("Code/Libs/lua")
559 if (OPTION_UNIT_TEST)
560 set(TEST_MODULES "" CACHE INTERNAL "List of test modules being built" FORCE)
561 set(temp ${BUILD_SHARED_LIBS})
562 set(gtest_force_shared_crt TRUE CACHE INTERNAL "" FORCE)
563 set(BUILD_SHARED_LIBS FALSE CACHE INTERNAL "" FORCE)
564 set(INSTALL_GTEST FALSE CACHE INTERNAL "" FORCE)
565 set(INSTALL_GMOCK FALSE CACHE INTERNAL "" FORCE)
567 set(MSVC_TEMP ${MSVC})
570 add_subdirectory ("${SDK_DIR}/googletest_CE_Support")
571 # Guard against wrongly setup bootstrap not finding gtest and gmock targets
572 if (NOT (TARGET gtest AND TARGET gmock))
573 message(FATAL_ERROR "Error adding google test. This could be caused by Bootstrap, please check Bootstrap.")
575 mark_as_advanced(FORCE BUILD_GTEST BUILD_GMOCK BUILD_SHARED_LIBS INSTALL_GTEST INSTALL_GMOCK gtest_build_samples gtest_build_tests gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols gmock_build_tests)
577 set(MSVC ${MSVC_TEMP})
578 target_compile_definitions(gtest PRIVATE GTEST_HAS_DEATH_TEST=0)
579 target_compile_definitions(gmock PRIVATE GTEST_HAS_DEATH_TEST=0)
581 set(BUILD_SHARED_LIBS ${temp} CACHE INTERNAL "" FORCE)
582 set_solution_folder("Libs" gtest)
583 set_solution_folder("Libs" gmock)
584 set_solution_folder("Libs" gtest_main)
585 set_solution_folder("Libs" gmock_main)
586 set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Set debug library postfix" FORCE)
587 if (DURANGO OR ORBIS)
588 set(THIS_PROJECT gtest)
589 SET_PLATFORM_TARGET_PROPERTIES(gtest)
590 set(THIS_PROJECT gmock)
591 SET_PLATFORM_TARGET_PROPERTIES(gmock)
594 # We want to hide gtest_main and gmock_main because we are not using these
595 # Only do so when these targets are defined
596 if (TARGET gmock_main)
597 set_property(TARGET gmock_main PROPERTY EXCLUDE_FROM_DEFAULT_BUILD TRUE)
598 set_property(TARGET gmock_main PROPERTY EXCLUDE_FROM_ALL TRUE)
601 if (TARGET gtest_main)
602 set_property(TARGET gtest_main PROPERTY EXCLUDE_FROM_DEFAULT_BUILD TRUE)
603 set_property(TARGET gtest_main PROPERTY EXCLUDE_FROM_ALL TRUE)
606 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryCommonUnitTest")
607 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CrySystemUnitTest")
608 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryEntitySystemUnitTest")
609 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryAnimationUnitTest")
610 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/Cry3DEngineUnitTest")
611 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryAudioSystemUnitTest")
612 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryAISystemUnitTest")
614 add_subdirectory("${CRYENGINE_DIR}/Code/CryEngine/UnitTests/CryUnitTestOrbisMain")
619 if (OPTION_SCALEFORMHELPER OR OPTION_ENGINE OR OPTION_SHADERCACHEGEN)
620 add_subdirectory ("Code/Libs/zlib")
621 add_subdirectory ("Code/Libs/expat")
623 add_subdirectory ("Code/Libs/png16")
627 if (OPTION_ENGINE OR OPTION_SHADERCACHEGEN OR OPTION_PAKTOOLS)
628 add_subdirectory ("Code/Libs/tomcrypt")
631 if (OPTION_ENGINE OR OPTION_SHADERCACHEGEN)
632 add_subdirectory ("Code/Libs/md5")
633 add_subdirectory ("Code/Libs/lz4")
634 add_subdirectory ("Code/Libs/jsmn")
635 add_subdirectory ("Code/Libs/lzma")
636 add_subdirectory ("Code/Libs/lzss")
637 add_subdirectory ("Code/Libs/tiff")
641 add_subdirectory ("Code/Libs/Detours")
644 add_subdirectory ("Code/Libs/qpOASES")