overte-lubosz/libraries/image/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

17 lines
355 B
CMake

set(TARGET_NAME image)
setup_hifi_library()
link_hifi_libraries(shared gpu)
target_nvtt()
target_tbb()
target_etc2comp()
target_openexr()
if (UNIX AND NOT APPLE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(image Threads::Threads)
endif()
if (WIN32)
add_compile_definitions(_USE_MATH_DEFINES)
endif()