overte-JulianGro/libraries/render-utils/CMakeLists.txt
Dale Glass 32c3725b5d Define _USE_MATH_DEFINES everywhere that uses math constants
On Win32, things are failing to build with messages like:

RenderableEntityItem.cpp(674,51): error C2065: 'M_PI': undeclared identifier

This is because as per Microsoft documentation, _USE_MATH_DEFINES is needed to
obtain constants like M_PI:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-160

It seems this worked previously due to some quirk of CMake, but stopped working
after some reordering. This change makes this definition explicit where it is needed.
2021-07-17 19:34:26 +02:00

21 lines
742 B
CMake

set(TARGET_NAME render-utils)
# pull in the resources.qrc file
qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts.qrc")
setup_hifi_library(Gui Network Qml Quick Script)
link_hifi_libraries(shared task ktx gpu shaders graphics graphics-scripting material-networking model-networking render animation model-serializers image procedural)
include_hifi_library_headers(audio)
include_hifi_library_headers(networking)
include_hifi_library_headers(octree)
include_hifi_library_headers(hfm)
# tell CMake to exclude qrc_fonts.cpp for policy CMP0071
set_property(SOURCE qrc_fonts.cpp PROPERTY SKIP_AUTOMOC ON)
if (NOT ANDROID)
target_nsight()
endif ()
if (WIN32)
add_compile_definitions(_USE_MATH_DEFINES)
endif()