Skip to content

Commit 7356c56

Browse files
committed
Feature: Build the project fork from CuraEngine 4.8
1 parent 83c65a1 commit 7356c56

File tree

3 files changed

+35
-34
lines changed

3 files changed

+35
-34
lines changed

CMakeLists.txt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#Copyright (c) 2020 Ultimaker B.V.
2-
#CuraEngine is released under the terms of the AGPLv3 or higher.
2+
#LunarSlicer is released under the terms of the AGPLv3 or higher.
33

44
cmake_minimum_required(VERSION 3.6.0)
55

6-
project(CuraEngine)
6+
project(LunarSlicer VERSION 1.0.0)
77

88
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
99

10-
option(ENABLE_ARCUS "Enable support for ARCUS" ON)
10+
option(ENABLE_ARCUS "Enable support for ARCUS" OFF)
1111

1212
if (MSVC)
1313
option(MSVC_STATIC_RUNTIME "Link the MSVC runtime statically" OFF)
@@ -62,7 +62,7 @@ option(BUILD_TESTS OFF)
6262

6363
# Add a compiler flag to check the output for insane values if we are in debug mode.
6464
if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG" OR CMAKE_BUILD_TYPE_UPPER MATCHES "RELWITHDEBINFO")
65-
message(STATUS "Building debug release of CuraEngine.")
65+
message(STATUS "Building debug release of LunarSlicer.")
6666
if (NOT MSVC)
6767
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -O0 -g -fno-omit-frame-pointer")
6868
endif()
@@ -263,27 +263,27 @@ if (ENABLE_ARCUS)
263263
protobuf_generate_cpp(engine_PB_SRCS engine_PB_HEADERS Cura.proto)
264264
endif ()
265265

266-
# Compiling CuraEngine itself.
267-
add_library(_CuraEngine STATIC ${engine_SRCS} ${engine_PB_SRCS}) #First compile all of CuraEngine as library, allowing this to be re-used for tests.
266+
# Compiling LunarSlicer itself.
267+
add_library(_LunarSlicer STATIC ${engine_SRCS} ${engine_PB_SRCS}) #First compile all of LunarSlicer as library, allowing this to be re-used for tests.
268268

269269
if (CuraEngine_Download_Stb)
270-
add_dependencies(_CuraEngine stb)
270+
add_dependencies(_LunarSlicer stb)
271271
endif()
272272
if(USE_SYSTEM_LIBS)
273-
target_link_libraries(_CuraEngine ${Polyclipping_LIBRARIES})
273+
target_link_libraries(_LunarSlicer ${Polyclipping_LIBRARIES})
274274
else()
275-
target_link_libraries(_CuraEngine clipper)
275+
target_link_libraries(_LunarSlicer clipper)
276276
endif()
277277

278278
if (ENABLE_ARCUS)
279-
target_link_libraries(_CuraEngine Arcus)
279+
target_link_libraries(_LunarSlicer Arcus)
280280
endif ()
281281

282-
set_target_properties(_CuraEngine PROPERTIES COMPILE_DEFINITIONS "VERSION=\"${CURA_ENGINE_VERSION}\"")
282+
set_target_properties(_LunarSlicer PROPERTIES COMPILE_DEFINITIONS "VERSION=\"${CURA_ENGINE_VERSION}\"")
283283

284284
if(WIN32)
285285
message(STATUS "Using windres")
286-
set(RES_FILES "CuraEngine.rc")
286+
# set(RES_FILES "LunarSlicer.rc")
287287
ENABLE_LANGUAGE(RC)
288288
if(NOT MSVC)
289289
SET(CMAKE_RC_COMPILER_INIT windres)
@@ -294,17 +294,17 @@ if(WIN32)
294294
endif(WIN32)
295295

296296
if (UNIX)
297-
target_link_libraries(_CuraEngine pthread)
297+
target_link_libraries(_LunarSlicer pthread)
298298
endif()
299299

300300
if (NOT WIN32)
301-
add_executable(CuraEngine src/main.cpp) # Then compile main.cpp as separate executable, and link the library to it.
301+
add_executable(LunarSlicer src/main.cpp) # Then compile main.cpp as separate executable, and link the library to it.
302302
else()
303-
add_executable(CuraEngine src/main.cpp ${RES_FILES}) # ..., but don't forget the glitter!
303+
add_executable(LunarSlicer src/main.cpp ${RES_FILES}) # ..., but don't forget the glitter!
304304
endif(NOT WIN32)
305305

306-
target_link_libraries(CuraEngine _CuraEngine)
307-
set_target_properties(CuraEngine PROPERTIES COMPILE_DEFINITIONS "VERSION=\"${CURA_ENGINE_VERSION}\"")
306+
target_link_libraries(LunarSlicer _LunarSlicer)
307+
set_target_properties(LunarSlicer PROPERTIES COMPILE_DEFINITIONS "VERSION=\"${CURA_ENGINE_VERSION}\"")
308308

309309
# Compiling the test environment.
310310
if (BUILD_TESTS)
@@ -317,58 +317,58 @@ if (BUILD_TESTS)
317317
find_package(GMock REQUIRED)
318318
include_directories(${GTEST_INCLUDE_DIRS})
319319
include_directories(${GMOCK_INCLUDE_DIRS})
320-
add_dependencies(_CuraEngine GTest::GTest GTest::Main GMock::GMock GMock::Main)
320+
add_dependencies(_LunarSlicer GTest::GTest GTest::Main GMock::GMock GMock::Main)
321321
add_definitions(-DBUILD_TESTS)
322322

323-
target_compile_definitions(_CuraEngine PUBLIC BUILD_TESTS=1)
323+
target_compile_definitions(_LunarSlicer PUBLIC BUILD_TESTS=1)
324324

325325
#To make sure that the tests are built before running them, add the building of these tests as an additional test.
326326
add_custom_target(build_all_tests)
327327
add_test(BuildTests "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}" --target build_all_tests)
328328

329329
foreach (test ${engine_TEST})
330330
add_executable(${test} tests/main.cpp ${engine_TEST_HELPERS} tests/${test}.cpp)
331-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
331+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
332332
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
333333
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
334334
endforeach()
335335
foreach (test ${engine_TEST_INFILL})
336336
add_executable(${test} tests/main.cpp tests/infill/${test}.cpp)
337-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
337+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
338338
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
339339
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
340340
endforeach()
341341
foreach (test ${engine_TEST_INTEGRATION})
342342
add_executable(${test} tests/main.cpp tests/integration/${test}.cpp)
343-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
343+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
344344
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
345345
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
346346
endforeach()
347347
foreach (test ${engine_TEST_SETTINGS})
348348
add_executable(${test} tests/main.cpp tests/settings/${test}.cpp)
349-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
349+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
350350
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
351351
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
352352
endforeach()
353353
if (ENABLE_ARCUS)
354354
foreach (test ${engine_TEST_ARCUS})
355355
add_executable(${test} tests/main.cpp ${engine_TEST_ARCUS_HELPERS} tests/arcus/${test}.cpp)
356-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
356+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
357357
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
358358
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
359359
endforeach()
360360
endif ()
361361
foreach (test ${engine_TEST_UTILS})
362362
add_executable(${test} tests/main.cpp tests/utils/${test}.cpp)
363-
target_link_libraries(${test} _CuraEngine ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
363+
target_link_libraries(${test} _LunarSlicer ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
364364
add_test(NAME ${test} COMMAND "${test}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/")
365365
add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target.
366366
endforeach()
367367
endif()
368368

369-
# Installing CuraEngine.
369+
# Installing LunarSlicer.
370370
include(GNUInstallDirs)
371-
install(TARGETS CuraEngine DESTINATION "${CMAKE_INSTALL_BINDIR}")
371+
install(TARGETS LunarSlicer DESTINATION "${CMAKE_INSTALL_BINDIR}")
372372
# For MinGW64 cross compiling on Debian, we create a ZIP package instead of a DEB
373373
# Because it's the Windows build system that should install the files.
374374
if (CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME MATCHES "Windows")

src/timeEstimate.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class TimeEstimateCalculator
6868
};
6969

7070
private:
71-
Velocity max_feedrate[NUM_AXIS] = {600, 600, 40, 25}; // mm/s
72-
Velocity minimumfeedrate = 0.01;
73-
Acceleration acceleration = 3000;
74-
Acceleration max_acceleration[NUM_AXIS] = {9000, 9000, 100, 10000};
75-
Velocity max_xy_jerk = 20.0;
76-
Velocity max_z_jerk = 0.4;
71+
Velocity max_feedrate[NUM_AXIS] = {120, 120, 40, 25}; // mm/s
72+
Velocity minimumfeedrate = 0.05;
73+
Acceleration acceleration = 1000;
74+
Acceleration max_acceleration[NUM_AXIS] = {3000, 3000, 100, 10000};
75+
Velocity max_xy_jerk = 10.0;
76+
Velocity max_z_jerk = 0.3;
7777
Velocity max_e_jerk = 5.0;
7878
Duration extra_time = 0.0;
7979

src/utils/getpath.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ std::string getPathName(const std::string& filePath) {
2525
DWORD dir_path_size = path_size - (path_size - (file_name_start - buffer));
2626
std::string folder_name{buffer, dir_path_size};
2727
#else
28-
char buffer[filePath.size()];
28+
char buffer[filePath.size() + 1];
29+
buffer[filePath.size()] = '\0';
2930
std::strcpy(buffer, filePath.c_str()); // copy the string because dirname(.) changes the input string!!!
3031
std::string folder_name{dirname(buffer)};
3132
#endif

0 commit comments

Comments
 (0)