@@ -29,6 +29,32 @@ elseif(BUILD_OS_OSX)
2929 set (BUILD_OS "macx" )
3030endif ()
3131
32+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
33+ message (STATUS "No build type selected, default to Release" )
34+ set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE )
35+ endif ()
36+
37+ set (CXAGENT_DEBUG_API_BASE "http://127.0.0.1:8787" CACHE STRING "CxAgent API base used for Debug/RelWithDebInfo builds" )
38+ set (CXAGENT_RELEASE_API_BASE "http://cxagent.crealitycloud.cn" CACHE STRING "CxAgent API base used for Release/MinSizeRel builds" )
39+
40+ if (NOT "$ENV{CXAGENT_DEBUG_API_BASE} " STREQUAL "" )
41+ set (CXAGENT_DEBUG_API_BASE "$ENV{CXAGENT_DEBUG_API_BASE} " CACHE STRING "CxAgent API base used for Debug/RelWithDebInfo builds" FORCE )
42+ endif ()
43+ if (NOT "$ENV{CXAGENT_RELEASE_API_BASE} " STREQUAL "" )
44+ set (CXAGENT_RELEASE_API_BASE "$ENV{CXAGENT_RELEASE_API_BASE} " CACHE STRING "CxAgent API base used for Release/MinSizeRel builds" FORCE )
45+ endif ()
46+ if (NOT "$ENV{CXAGENT_API_BASE} " STREQUAL "" )
47+ set (CXAGENT_DEBUG_API_BASE "$ENV{CXAGENT_API_BASE} " CACHE STRING "CxAgent API base used for Debug/RelWithDebInfo builds" FORCE )
48+ set (CXAGENT_RELEASE_API_BASE "$ENV{CXAGENT_API_BASE} " CACHE STRING "CxAgent API base used for Release/MinSizeRel builds" FORCE )
49+ endif ()
50+
51+ if ("${CMAKE_BUILD_TYPE } " STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE } " STREQUAL "RelWithDebInfo" )
52+ set (CXAGENT_DEFAULT_API_BASE "${CXAGENT_DEBUG_API_BASE} " )
53+ else ()
54+ set (CXAGENT_DEFAULT_API_BASE "${CXAGENT_RELEASE_API_BASE} " )
55+ endif ()
56+ message (STATUS "CXAGENT_DEFAULT_API_BASE for ${CMAKE_BUILD_TYPE } : ${CXAGENT_DEFAULT_API_BASE} " )
57+
3258include (ConfigureAllModules )
3359__configure_build_info_header (
3460 customized
@@ -55,11 +81,6 @@ message("PROCESS_NAME=${PROCESS_NAME}")
5581set (SLIC3R_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR } /resources" )
5682file (TO_NATIVE_PATH "${SLIC3R_RESOURCES_DIR} " SLIC3R_RESOURCES_DIR_WIN )
5783
58- if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
59- message (STATUS "No build type selected, default to Release" )
60- set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE )
61- endif ()
62-
6384if (DEFINED ENV{SLIC3R_STATIC})
6485 set (SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC} )
6586else ()
@@ -81,6 +102,8 @@ option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
81102option (SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1 )
82103option (SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0 )
83104option (SLIC3R_ASAN "Enable ASan on Clang and GCC" 0 )
105+ option (SLIC3R_ENABLE_TIME_ANALYTICS_EXPORT "Enable exporting slicer time analytics artifacts (layer/custom/prepare/thumbnail/meta)" 0 )
106+ option (SLIC3R_ENABLE_GCODE_IMPORT_PROFILE_OVERLAY_FOR_TEST "Enable test-only online printer profile overlay when importing G-code" 0 )
84107option (GENERATE_ORCA_HEADER "Enable generate header" 1 )
85108
86109# If SLIC3R_FHS is 1 -> SLIC3R_DESKTOP_INTEGRATION is always 0, othrewise variable.
@@ -135,6 +158,14 @@ if(SLIC3R_DESKTOP_INTEGRATION)
135158 add_definitions (-DSLIC3R_DESKTOP_INTEGRATION )
136159endif ()
137160
161+ if (SLIC3R_ENABLE_TIME_ANALYTICS_EXPORT)
162+ add_definitions (-DSLIC3R_ENABLE_TIME_ANALYTICS_EXPORT )
163+ endif ()
164+
165+ if (SLIC3R_ENABLE_GCODE_IMPORT_PROFILE_OVERLAY_FOR_TEST)
166+ add_definitions (-DSLIC3R_ENABLE_GCODE_IMPORT_PROFILE_OVERLAY_FOR_TEST )
167+ endif ()
168+
138169if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
139170 set (IS_CLANG_CL TRUE )
140171
@@ -278,6 +309,52 @@ if(WIN32)
278309 endif ()
279310endif ()
280311
312+ option (SLIC3R_ENABLE_IMATISTL "Enable ImatiSTL mesh repair backend on Linux/macOS" ON )
313+
314+ set (HAS_IMATISTL FALSE )
315+ unset (IMATISTL_INCLUDE_DIR)
316+ unset (IMATISTL_LIBRARY)
317+ unset (IMATISTL_DEP_LIBRARIES)
318+
319+ if (SLIC3R_ENABLE_IMATISTL AND (APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Linux" ))
320+ find_path (IMATISTL_INCLUDE_DIR
321+ NAMES imatistl.h ImatiSTL/imatistl.h
322+ PATH_SUFFIXES include include /ImatiSTL )
323+ find_library (IMATISTL_LIBRARY
324+ NAMES ImatiSTL imatiSTL imatistl
325+ PATH_SUFFIXES lib )
326+ find_library (IMATISTL_GMP_LIBRARY
327+ NAMES gmp libgmp
328+ PATH_SUFFIXES lib )
329+ find_library (IMATISTL_MPFR_LIBRARY
330+ NAMES mpfr libmpfr
331+ PATH_SUFFIXES lib )
332+
333+ if (IMATISTL_INCLUDE_DIR)
334+ get_filename_component (_imatistl_include_leaf "${IMATISTL_INCLUDE_DIR} " NAME )
335+ if (_imatistl_include_leaf STREQUAL "ImatiSTL" )
336+ get_filename_component (IMATISTL_INCLUDE_DIR "${IMATISTL_INCLUDE_DIR} " DIRECTORY )
337+ endif ()
338+ endif ()
339+
340+ if (IMATISTL_INCLUDE_DIR AND IMATISTL_LIBRARY)
341+ set (HAS_IMATISTL TRUE )
342+ if (IMATISTL_MPFR_LIBRARY)
343+ list (APPEND IMATISTL_DEP_LIBRARIES ${IMATISTL_MPFR_LIBRARY} )
344+ endif ()
345+ if (IMATISTL_GMP_LIBRARY)
346+ list (APPEND IMATISTL_DEP_LIBRARIES ${IMATISTL_GMP_LIBRARY} )
347+ endif ()
348+ message ("Building with ImatiSTL mesh repair support (deps/system library)" )
349+ else ()
350+ message ("Building without ImatiSTL mesh repair support" )
351+ endif ()
352+ endif ()
353+
354+ if (HAS_IMATISTL)
355+ add_definitions (-DHAS_IMATISTL )
356+ endif ()
357+
281358if (APPLE )
282359 message ("OS X SDK Path: ${CMAKE_OSX_SYSROOT} " )
283360 if (CMAKE_OSX_DEPLOYMENT_TARGET)
0 commit comments