72 lines
1.7 KiB
CMake
72 lines
1.7 KiB
CMake
add_subdirectory(glut)
|
|
add_executable(Viewer)
|
|
find_package(OpenGL)
|
|
target_include_directories(Viewer PRIVATE ./)
|
|
target_link_libraries(Viewer
|
|
PRIVATE
|
|
hoops_samples
|
|
glut::glut)
|
|
|
|
if(APPLE)
|
|
target_link_libraries(Viewer 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(Viewer
|
|
PRIVATE
|
|
OpenGL::GL
|
|
OpenGL::GLU)
|
|
endif()
|
|
|
|
set(_srcs
|
|
callback_opengl.cpp
|
|
callback_opengl.h
|
|
ComputeHLR.cpp
|
|
ComputeSection.cpp
|
|
trackball.cpp
|
|
trackball.h
|
|
Viewer.cpp
|
|
Viewer.h)
|
|
|
|
set(_visitors_srcs
|
|
BrepTraverse.h
|
|
CascadedAttributeConnector.h
|
|
Connector.h
|
|
MarkupTessConnector.h
|
|
MarkupTraverse.h
|
|
Matrix.h
|
|
TessConnector.h
|
|
TransfoConnector.h
|
|
TreeTraverse.h
|
|
ViewTraverse.h
|
|
VisitorBrep.h
|
|
VisitorCascadedAttribute.h
|
|
VisitorContainer.h
|
|
Visitors.h
|
|
VisitorTessellation.h
|
|
VisitorTransfo.h
|
|
VisitorTree.h
|
|
traverse/BrepTraverse.cpp
|
|
traverse/CascadedAttributeConnector.cpp
|
|
traverse/MarkupTessConnector.cpp
|
|
traverse/MarkupTraverse.cpp
|
|
traverse/TessConnector.cpp
|
|
traverse/TransfoConnector.cpp
|
|
traverse/TreeTraverse.cpp
|
|
traverse/ViewTraverse.cpp
|
|
traverse/VisitorCascadedAttribute.cpp
|
|
traverse/VisitorContainer.cpp
|
|
traverse/VisitorTessellation.cpp
|
|
traverse/VisitorTransfo.cpp
|
|
traverse/VisitorTree.cpp)
|
|
|
|
target_sources(Viewer PRIVATE ${_srcs} ${_visitors_srcs})
|
|
|
|
source_group("" FILES ${_srcs})
|
|
source_group(visitors FILES ${_visitors_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(Viewer PRIVATE /WX /WX-)
|
|
endif()
|