init commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
|
||||
set(DV_UTILS_INCLUDE_FILES
|
||||
include/dvu_config.h
|
||||
)
|
||||
source_group("include" FILES ${DV_UTILS_INCLUDE_FILES})
|
||||
|
||||
#################
|
||||
# buffer
|
||||
#################
|
||||
set(DV_UTILS_BUFFER_INCLUDE_FILES
|
||||
include/buffer/dvu_dump_buffer.h
|
||||
)
|
||||
source_group("include/buffer" FILES ${DV_UTILS_BUFFER_INCLUDE_FILES})
|
||||
|
||||
set(DV_UTILS_BUFFER_SOURCE_FILES
|
||||
source/buffer/dvu_dump_buffer.cpp
|
||||
)
|
||||
source_group("source/buffer" FILES ${DV_UTILS_BUFFER_SOURCE_FILES})
|
||||
|
||||
#################
|
||||
# scene
|
||||
#################
|
||||
set(DV_UTILS_SCENE_INCLUDE_FILES
|
||||
include/scene/dvu_load_gltf.h
|
||||
)
|
||||
source_group("include/scene" FILES ${DV_UTILS_SCENE_INCLUDE_FILES})
|
||||
|
||||
set(DV_UTILS_SCENE_SOURCE_FILES
|
||||
source/scene/dvu_load_gltf.cpp
|
||||
)
|
||||
source_group("source/scene" FILES ${DV_UTILS_SCENE_SOURCE_FILES})
|
||||
|
||||
include_directories(
|
||||
${DV_AUTO_INCLUDE_PATH}
|
||||
${DV_CORE_INCLUDE_PATH}
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
add_library(dv_utils SHARED
|
||||
${DV_UTILS_INCLUDE_FILES}
|
||||
${DV_UTILS_SCENE_INCLUDE_FILES}
|
||||
${DV_UTILS_SCENE_SOURCE_FILES}
|
||||
${DV_UTILS_BUFFER_INCLUDE_FILES}
|
||||
${DV_UTILS_BUFFER_SOURCE_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(dv_utils
|
||||
dv_core
|
||||
tinygltf::tinygltf
|
||||
PNG::png_static
|
||||
)
|
||||
|
||||
target_compile_definitions(dv_utils
|
||||
PRIVATE DV_UTILS_EXPORTS
|
||||
)
|
||||
|
||||
#################
|
||||
# copy runtime dll(for debug)
|
||||
#################
|
||||
add_custom_command(
|
||||
TARGET dv_utils POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:dv_utils> ${CMAKE_BINARY_DIR}/source/console/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>)
|
||||
|
||||
add_custom_command(
|
||||
TARGET dv_utils POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:dv_utils> ${CMAKE_BINARY_DIR}/test/unit/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>)
|
||||
|
||||
#################
|
||||
# install
|
||||
#################
|
||||
install(DIRECTORY include/
|
||||
DESTINATION include/utils
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
install(TARGETS dv_utils
|
||||
RUNTIME DESTINATION bin/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>
|
||||
ARCHIVE DESTINATION lib/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>
|
||||
)
|
||||
else(MSVC)
|
||||
install(TARGETS dv_utils
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
endif(MSVC)
|
||||
Reference in New Issue
Block a user