Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-08-28 20:11:16 +0300
committerbubnikv <bubnikv@gmail.com>2017-08-28 20:11:16 +0300
commit0cb491e13522e8d5847354c57bd6568e534ee733 (patch)
treea7895c95537bff4e05b0f24a40eabd9321bd206f /CMakeLists.txt
parentcf2f29a5f11a13e436e8a10ed04894818f438270 (diff)
CMake build process:
Added the "test" target to execute the perl prove unit / integration tests. Added a post-build step to copy the XS.dll & Slic3r/XS.pm to local-lib.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a4d478fe..65b326d4a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,8 +25,26 @@ if (MSVC AND SLIC3R_MSVC_COMPILE_PARALLEL)
add_compile_options(/MP)
endif ()
+# Find the Perl interpreter, add local-lib to PATH and PERL5LIB environment variables,
+# so the locally installed modules (mainly the Alien::wxPerl) will be reached.
+if (WIN32)
+ set(ENV_PATH_SEPARATOR ";")
+else()
+ set(ENV_PATH_SEPARATOR ":")
+endif()
+set(ENV{PATH} "${PROJECT_SOURCE_DIR}/local-lib/bin${ENV_PATH_SEPARATOR}$ENV{PATH}")
+set(ENV{PERL5LIB} "${PROJECT_SOURCE_DIR}/local-lib/lib/perl${ENV_PATH_SEPARATOR}$ENV{PERL5LIB}")
+message("PATH: $ENV{PATH}")
+message("PERL5LIB: $ENV{PERL5LIB}")
+find_package(Perl REQUIRED)
+
add_subdirectory(xs)
+enable_testing ()
+get_filename_component(PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
+add_test (NAME xs COMMAND "${PERL_EXECUTABLE}" ${PERL_BIN_PATH}/prove -I ${PROJECT_SOURCE_DIR}/local-lib/lib/perl5 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/xs)
+add_test (NAME integration COMMAND "${PERL_EXECUTABLE}" ${PERL_BIN_PATH}/prove WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+
install(PROGRAMS slic3r.pl DESTINATION bin RENAME slic3r-prusa3d)
file(GLOB MyVar var/*.png)