Files
Hoops_Exchange/exchange/exchangesource/DrawingViewer/CMakeLists.txt
2025-12-15 23:22:33 +08:00

41 lines
1.1 KiB
CMake

add_executable(DrawingViewer)
target_include_directories(DrawingViewer PRIVATE ../Viewer)
find_package(OpenGL)
target_link_libraries(DrawingViewer PRIVATE hoops_samples
glut::glut)
if(APPLE)
target_link_libraries(DrawingViewer PRIVATE "-framework OpenGL") #We link directly to OpenGL because
#we have issue with OpenGL::OpenGL target with the Macosx4 builder (it doesn't find the OpenGL library)
#We should be able to use OpenGL target with the new builders
else()
target_link_libraries(DrawingViewer
PRIVATE
OpenGL::GL
OpenGL::GLU)
endif()
set(_srcs
Draw.cpp
drawing_collect.cpp
drawing_draw.cpp
drawing_main.cpp
drawing_main.h
drawing_parse.cpp
drawing_parse.h
callback_opengl.cpp
callback_opengl.h)
set(_viewer_srcs ../Viewer/trackball.cpp)
target_sources(DrawingViewer PRIVATE ${_srcs} ${_viewer_srcs})
source_group("" FILES ${_srcs})
source_group(viewer FILES ${_viewer_srcs})
# this is the hackiest solution in the world to override the "/WX" flag set in the hoops_samples interface in /final-package/samples/
if(MSVC)
target_compile_options(DrawingViewer PRIVATE /WX /WX-)
endif()