1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
#version management
string(TIMESTAMP MESHLAB_VERSION "%Y.%m")
if (MESHLAB_IS_NIGHTLY_VERSION)
# nightly version is in the form:
# YYYY.mm[d]_nightly_GIT_SHA1
# YYYY and mm are computed by cmake and not read from file
find_package(Git)
execute_process(COMMAND
"${GIT_EXECUTABLE}" describe --match=NeVeRmAtCh --always --abbrev=7
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_SHA1
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if (BUILD_WITH_DOUBLE_SCALAR)
set(MESHLAB_VERSION "${MESHLAB_VERSION}d")
endif()
set(MESHLAB_VERSION "${MESHLAB_VERSION}_nightly_${GIT_SHA1}")
else()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION")
# YYYY and mm are read from file
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION" MESHLAB_VERSION)
endif()
# if double precision version, "d" is appended
if (BUILD_WITH_DOUBLE_SCALAR)
set(MESHLAB_VERSION "${MESHLAB_VERSION}d")
endif()
endif()
set(MESHLAB_VERSION ${MESHLAB_VERSION} PARENT_SCOPE)
message(STATUS "MeshLab version: ${MESHLAB_VERSION}")
if (BUILD_WITH_DOUBLE_SCALAR)
message(STATUS "Building with double precision")
set(MESHLAB_SCALAR "double")
else()
message(STATUS "Building with single precision")
set(MESHLAB_SCALAR "float")
endif()
set(HEADERS
ml_document/helpers/mesh_document_state_data.h
ml_document/helpers/mesh_model_state_data.h
ml_document/base_types.h
ml_document/cmesh.h
ml_document/mesh_document.h
ml_document/mesh_model.h
ml_document/mesh_model_state.h
ml_document/raster_model.h
ml_document/render_raster.h
ml_shared_data_context/ml_plugin_gl_context.h
ml_shared_data_context/ml_scene_gl_shared_data_context.h
ml_shared_data_context/ml_shared_data_context.h
parameters/rich_parameter.h
parameters/rich_parameter_list.h
parameters/value.h
plugins/containers/generic_container_iterator.h
plugins/containers/decorate_plugin_container.h
plugins/containers/edit_plugin_container.h
plugins/containers/filter_plugin_container.h
plugins/containers/io_plugin_container.h
plugins/containers/render_plugin_container.h
plugins/interfaces/meshlab_plugin.h
plugins/interfaces/meshlab_plugin_logger.h
plugins/interfaces/decorate_plugin.h
plugins/interfaces/edit_plugin.h
plugins/interfaces/filter_plugin.h
plugins/interfaces/io_plugin.h
plugins/interfaces/render_plugin.h
plugins/action_searcher.h
plugins/meshlab_plugin_type.h
plugins/plugin_manager.h
python/function.h
python/function_parameter.h
python/function_set.h
python/python_utils.h
utilities/eigen_mesh_conversions.h
utilities/file_format.h
utilities/load_save.h
globals.h
GLExtensionsManager.h
GLLogStream.h
filterscript.h
ml_selection_buffers.h
ml_thread_safe_memory_info.h
mlapplication.h
mlexception.h)
set(SOURCES
ml_document/helpers/mesh_document_state_data.cpp
ml_document/cmesh.cpp
ml_document/mesh_document.cpp
ml_document/mesh_model.cpp
ml_document/mesh_model_state.cpp
ml_document/raster_model.cpp
ml_document/render_raster.cpp
ml_shared_data_context/ml_plugin_gl_context.cpp
ml_shared_data_context/ml_scene_gl_shared_data_context.cpp
ml_shared_data_context/ml_shared_data_context.cpp
parameters/rich_parameter.cpp
parameters/rich_parameter_list.cpp
parameters/value.cpp
plugins/containers/decorate_plugin_container.cpp
plugins/containers/edit_plugin_container.cpp
plugins/containers/filter_plugin_container.cpp
plugins/containers/io_plugin_container.cpp
plugins/containers/render_plugin_container.cpp
plugins/interfaces/meshlab_plugin_logger.cpp
plugins/interfaces/decorate_plugin.cpp
plugins/interfaces/filter_plugin.cpp
plugins/interfaces/io_plugin.cpp
plugins/action_searcher.cpp
plugins/meshlab_plugin_type.cpp
plugins/plugin_manager.cpp
python/function.cpp
python/function_parameter.cpp
python/function_set.cpp
python/python_utils.cpp
utilities/eigen_mesh_conversions.cpp
utilities/load_save.cpp
globals.cpp
GLExtensionsManager.cpp
GLLogStream.cpp
filterscript.cpp
ml_selection_buffers.cpp
ml_thread_safe_memory_info.cpp
mlapplication.cpp)
set(RESOURCES meshlab-common.qrc)
set(TARGET_TYPE SHARED)
add_library(meshlab-common ${TARGET_TYPE} ${SOURCES} ${HEADERS} ${RESOURCES})
if(NOT WIN32 AND NOT APPLE)
target_compile_definitions(
meshlab-common PRIVATE MESHLAB_LIB_INSTALL_DIR="${MESHLAB_LIB_INSTALL_DIR}")
endif()
target_compile_definitions(meshlab-common
PUBLIC
MESHLAB_VERSION=${MESHLAB_VERSION}
MESHLAB_SCALAR=${MESHLAB_SCALAR})
target_include_directories(meshlab-common
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..)
target_link_libraries(
meshlab-common
PUBLIC
Qt5::Core
Qt5::OpenGL
Qt5::Widgets
Qt5::Xml
Qt5::Network
vcglib
external-glew
external-exif
)
set_property(TARGET meshlab-common PROPERTY FOLDER Core)
set_property(TARGET meshlab-common
PROPERTY RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_LIB_OUTPUT_DIR})
set_property(TARGET meshlab-common
PROPERTY LIBRARY_OUTPUT_DIRECTORY ${MESHLAB_LIB_OUTPUT_DIR})
if (WIN32)
target_compile_definitions(meshlab-common PRIVATE ML_EXPORT_SYMBOLS)
set_property(TARGET meshlab-common
PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${MESHLAB_LIB_OUTPUT_DIR})
endif()
if(ENABLE_MESHLAB_DEBUG_LOG_FILE)
target_compile_definitions(meshlab-common PUBLIC MESHLAB_LOG_FILE_ENABLED)
endif()
set_target_properties(meshlab-common PROPERTIES
INSTALL_RPATH "${MESHLAB_LIB_INSTALL_DIR}:${INSTALL_RPATH}")
install(TARGETS meshlab-common DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
|