99 lines
2.7 KiB
CMake
99 lines
2.7 KiB
CMake
# #######################################################################################
|
|
# ## Sources
|
|
# #######################################################################################
|
|
set(_sources
|
|
application/application.cpp
|
|
application/camera.cpp
|
|
application/render/ebo.cpp
|
|
application/render/mesh.cpp
|
|
application/render/shader.cpp
|
|
application/render/vao.cpp
|
|
application/render/vbo.cpp
|
|
model/exchange.cpp
|
|
model/he/entity.cpp
|
|
model/he/model_file.cpp
|
|
model/he/part.cpp
|
|
model/he/product_occurrence.cpp
|
|
model/he/representation_item.cpp
|
|
utils/bounding_box.cpp
|
|
utils/properties.cpp
|
|
main.cpp
|
|
)
|
|
set(_headers
|
|
application/application.h
|
|
application/camera.h
|
|
application/render/ebo.h
|
|
application/render/mesh.h
|
|
application/render/shader.h
|
|
application/render/shaders/default.frag
|
|
application/render/shaders/default.vert
|
|
application/render/vao.h
|
|
application/render/vbo.h
|
|
model/exchange.h
|
|
model/he/entity.h
|
|
model/he/model_file.h
|
|
model/he/part.h
|
|
model/he/product_occurrence.h
|
|
model/he/representation_item.h
|
|
utils/bounding_box.h
|
|
utils/geometry.h
|
|
utils/properties.h
|
|
)
|
|
|
|
# #######################################################################################
|
|
# ## Target configuration
|
|
# #######################################################################################
|
|
add_executable(MeshViewer)
|
|
|
|
target_sources(MeshViewer PRIVATE ${_sources} ${_headers})
|
|
target_compile_definitions(MeshViewer PRIVATE SHADERS_FOLDER="${CMAKE_CURRENT_LIST_DIR}/application/render/shaders")
|
|
target_include_directories(MeshViewer PUBLIC .)
|
|
|
|
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Header Files" FILES ${_headers})
|
|
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${_sources})
|
|
|
|
find_package(MeshViewerDependencies REQUIRED)
|
|
|
|
target_compile_definitions(MeshViewer PRIVATE PUGIXML_HEADER_ONLY)
|
|
|
|
set_target_properties(MeshViewer PROPERTIES CXX_STANDARD 17)
|
|
|
|
target_link_libraries(MeshViewer
|
|
PRIVATE
|
|
MeshViewerDependencies
|
|
hoops_samples
|
|
)
|
|
|
|
if(WIN32)
|
|
add_custom_command(TARGET MeshViewer POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
${GLFW_LIBRARY_DLL}
|
|
$<TARGET_FILE_DIR:MeshViewer>
|
|
)
|
|
endif()
|
|
|
|
#####
|
|
# Warnings
|
|
#####
|
|
|
|
# disable warnings for glad on Debug configuration
|
|
if(MSVC)
|
|
target_link_options(MeshViewer PRIVATE /ignore:4098 /ignore:4099)
|
|
endif()
|
|
|
|
|
|
add_compile_definitions(GLM_FORCE_SILENT_WARNINGS=1)
|
|
|
|
#################################################################################
|
|
# INSTALL TARGET
|
|
#################################################################################
|
|
if(NOT APPLE)
|
|
set(_external_dir ${CMAKE_CURRENT_BINARY_DIR}/external)
|
|
install(DIRECTORY ${_external_dir}
|
|
COMPONENT Samples
|
|
DESTINATION samples/exchange/exchangesource/MeshViewer
|
|
FILES_MATCHING
|
|
PATTERN *
|
|
)
|
|
endif()
|