Added various manifests,
added auto generation of includes and manifests from version and build variables, resurrected SLIC3R_LOGLEVEL env var.
This commit is contained in:
parent
9f2cd347e3
commit
96e035b2f8
@ -1,6 +1,9 @@
|
|||||||
project(Slic3r)
|
project(Slic3r)
|
||||||
cmake_minimum_required(VERSION 3.2)
|
cmake_minimum_required(VERSION 3.2)
|
||||||
|
|
||||||
|
include("version.inc")
|
||||||
|
set(SLIC3R_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
message(STATUS "No build type selected, default to Release")
|
message(STATUS "No build type selected, default to Release")
|
||||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
||||||
@ -108,12 +111,12 @@ if (0)
|
|||||||
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
|
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
|
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||||
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
|
||||||
set(CMAKE_C_FLAGS "/MD /Od /Zi /DNDEBUG /DWIN32 /DTBB_USE_ASSERT")
|
set(CMAKE_C_FLAGS "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find and configure boost
|
# Find and configure boost
|
||||||
|
@ -53,9 +53,11 @@ endif()
|
|||||||
add_subdirectory(slic3r)
|
add_subdirectory(slic3r)
|
||||||
|
|
||||||
# Create a slic3r executable
|
# Create a slic3r executable
|
||||||
#FIXME add Windows resource file
|
# Process mainfests for various platforms.
|
||||||
#add_executable(slic3r slic3r.cpp slic3r.rc)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc @ONLY)
|
||||||
add_executable(slic3r slic3r.cpp)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.manifest @ONLY)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)
|
||||||
|
add_executable(slic3r slic3r.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
|
||||||
if(SLIC3R_GUI)
|
if(SLIC3R_GUI)
|
||||||
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-gui")
|
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-gui")
|
||||||
else()
|
else()
|
||||||
@ -67,7 +69,10 @@ if (APPLE)
|
|||||||
# add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE)
|
# add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE)
|
||||||
# -liconv: boost links to libiconv by default
|
# -liconv: boost links to libiconv by default
|
||||||
target_link_libraries(slic3r "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
|
target_link_libraries(slic3r "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
|
||||||
elseif (NOT MSVC)
|
elseif (MSVC)
|
||||||
|
# Manifest is provided through slic3r.rc, don't generate your own.
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
|
||||||
|
else ()
|
||||||
target_link_libraries(slic3r -ldl -lstdc++)
|
target_link_libraries(slic3r -ldl -lstdc++)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
project(libslic3r)
|
project(libslic3r)
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libslic3r_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h @ONLY)
|
||||||
|
|
||||||
add_library(libslic3r STATIC
|
add_library(libslic3r STATIC
|
||||||
BoundingBox.cpp
|
BoundingBox.cpp
|
||||||
BoundingBox.hpp
|
BoundingBox.hpp
|
||||||
@ -96,6 +98,7 @@ add_library(libslic3r STATIC
|
|||||||
Layer.hpp
|
Layer.hpp
|
||||||
LayerRegion.cpp
|
LayerRegion.cpp
|
||||||
libslic3r.h
|
libslic3r.h
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h"
|
||||||
Line.cpp
|
Line.cpp
|
||||||
Line.hpp
|
Line.hpp
|
||||||
Model.cpp
|
Model.cpp
|
||||||
@ -149,7 +152,7 @@ add_library(libslic3r STATIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB ${PNG_DEFINITIONS})
|
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB ${PNG_DEFINITIONS})
|
||||||
target_include_directories(libslic3r PUBLIC BEFORE ${LIBNEST2D_INCLUDES} ${PNG_INCLUDE_DIRS})
|
target_include_directories(libslic3r PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${LIBNEST2D_INCLUDES} ${PNG_INCLUDE_DIRS})
|
||||||
target_link_libraries(libslic3r
|
target_link_libraries(libslic3r
|
||||||
${LIBNEST2D_LIBRARIES}
|
${LIBNEST2D_LIBRARIES}
|
||||||
admesh
|
admesh
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef _libslic3r_h_
|
#ifndef _libslic3r_h_
|
||||||
#define _libslic3r_h_
|
#define _libslic3r_h_
|
||||||
|
|
||||||
|
#include "libslic3r_version.h"
|
||||||
|
|
||||||
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
|
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -15,10 +17,6 @@
|
|||||||
|
|
||||||
#include "Technologies.hpp"
|
#include "Technologies.hpp"
|
||||||
|
|
||||||
#define SLIC3R_FORK_NAME "Slic3r Prusa Edition"
|
|
||||||
#define SLIC3R_VERSION "1.41.0"
|
|
||||||
#define SLIC3R_BUILD "UNKNOWN"
|
|
||||||
|
|
||||||
typedef int32_t coord_t;
|
typedef int32_t coord_t;
|
||||||
typedef double coordf_t;
|
typedef double coordf_t;
|
||||||
|
|
||||||
|
8
src/libslic3r/libslic3r_version.h.in
Normal file
8
src/libslic3r/libslic3r_version.h.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __SLIC3R_VERSION_H
|
||||||
|
#define __SLIC3R_VERSION_H
|
||||||
|
|
||||||
|
#define SLIC3R_FORK_NAME "@SLIC3R_FORK_NAME@"
|
||||||
|
#define SLIC3R_VERSION "@SLIC3R_VERSION@"
|
||||||
|
#define SLIC3R_BUILD "@SLIC3R_BUILD@"
|
||||||
|
|
||||||
|
#endif /* __SLIC3R_VERSION_H */
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
|
||||||
<assemblyIdentity version="SLIC3R_RC_VERSION_DOTS" name="Slic3r" type="Win32" />
|
<assemblyIdentity version="@SLIC3R_RC_VERSION_DOTS@" name="Slic3r" type="Win32" />
|
||||||
<description>Perl</description>
|
<description>Perl</description>
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
@ -1,6 +1,6 @@
|
|||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION SLIC3R_RC_VERSION
|
FILEVERSION @SLIC3R_RC_VERSION@
|
||||||
PRODUCTVERSION SLIC3R_RC_VERSION
|
PRODUCTVERSION @SLIC3R_RC_VERSION@
|
||||||
{
|
{
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
{
|
{
|
||||||
@ -8,9 +8,9 @@ PRODUCTVERSION SLIC3R_RC_VERSION
|
|||||||
{
|
{
|
||||||
VALUE "CompanyName", "Prusa Research"
|
VALUE "CompanyName", "Prusa Research"
|
||||||
VALUE "FileDescription", "Slic3r Prusa Edition"
|
VALUE "FileDescription", "Slic3r Prusa Edition"
|
||||||
VALUE "FileVersion", "SLIC3R_BUILD_ID"
|
VALUE "FileVersion", "@SLIC3R_BUILD_ID@"
|
||||||
VALUE "ProductName", "Slic3r Prusa Edition"
|
VALUE "ProductName", "Slic3r Prusa Edition"
|
||||||
VALUE "ProductVersion", "SLIC3R_BUILD_ID"
|
VALUE "ProductVersion", "@SLIC3R_BUILD_ID@"
|
||||||
VALUE "InternalName", "Slic3r Prusa Edition"
|
VALUE "InternalName", "Slic3r Prusa Edition"
|
||||||
VALUE "LegalCopyright", "Copyright \251 2011-2017 Alessandro Ranelucci, \251 2016 Prusa Research"
|
VALUE "LegalCopyright", "Copyright \251 2011-2017 Alessandro Ranelucci, \251 2016 Prusa Research"
|
||||||
VALUE "OriginalFilename", "slic3r.exe"
|
VALUE "OriginalFilename", "slic3r.exe"
|
||||||
@ -21,5 +21,5 @@ PRODUCTVERSION SLIC3R_RC_VERSION
|
|||||||
VALUE "Translation", 0x409, 1252
|
VALUE "Translation", 0x409, 1252
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2 ICON "../resources/icons/Slic3r.ico"
|
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/Slic3r.ico"
|
||||||
1 24 "slic3r.manifest"
|
1 24 "slic3r.manifest"
|
32
src/platform/osx/Info.plist.in
Normal file
32
src/platform/osx/Info.plist.in
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>Slic3r</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>Slic3r Copyright (C) 2011-2017 Alessandro Ranellucci, (C) 2016-2018 Prusa Reseach</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>Slic3r.icns</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>Slic3r</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>Slic3r @SLIC3R_BUILD_ID@</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.prusa3d.slic3r/</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>@SLIC3R_BUILD_ID@</string>
|
||||||
|
<key>CGDisableCoalescedUpdates</key>
|
||||||
|
<false/>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -27,6 +27,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/nowide/args.hpp>
|
#include <boost/nowide/args.hpp>
|
||||||
|
#include <boost/nowide/cenv.hpp>
|
||||||
#include <boost/nowide/iostream.hpp>
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
|
||||||
#ifdef USE_WX
|
#ifdef USE_WX
|
||||||
@ -48,6 +49,16 @@ int main(int argc, char **argv)
|
|||||||
//FIXME On Windows, we want to receive the arguments as 16bit characters!
|
//FIXME On Windows, we want to receive the arguments as 16bit characters!
|
||||||
boost::nowide::args a(argc, argv);
|
boost::nowide::args a(argc, argv);
|
||||||
|
|
||||||
|
{
|
||||||
|
const char *loglevel = boost::nowide::getenv("SLIC3R_LOGLEVEL");
|
||||||
|
if (loglevel != nullptr) {
|
||||||
|
if (loglevel[0] >= '0' && loglevel[0] <= '9' && loglevel[1] == 0)
|
||||||
|
set_logging_level(loglevel[0] - '0');
|
||||||
|
else
|
||||||
|
boost::nowide::cerr << "Invalid SLIC3R_LOGLEVEL environment variable: " << loglevel << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// parse all command line options into a DynamicConfig
|
// parse all command line options into a DynamicConfig
|
||||||
DynamicPrintAndCLIConfig config;
|
DynamicPrintAndCLIConfig config;
|
||||||
t_config_option_keys input_files;
|
t_config_option_keys input_files;
|
||||||
@ -89,7 +100,7 @@ int main(int argc, char **argv)
|
|||||||
// apply command line options to a more handy CLIConfig
|
// apply command line options to a more handy CLIConfig
|
||||||
CLIConfig cli_config;
|
CLIConfig cli_config;
|
||||||
cli_config.apply(config, true);
|
cli_config.apply(config, true);
|
||||||
set_local_dir(cli_config.datadir.value);
|
set_data_dir(cli_config.datadir.value);
|
||||||
|
|
||||||
DynamicPrintConfig print_config;
|
DynamicPrintConfig print_config;
|
||||||
|
|
||||||
|
@ -116,10 +116,15 @@ void MainFrame::init_tabpanel()
|
|||||||
auto panel = m_tabpanel->GetCurrentPage();
|
auto panel = m_tabpanel->GetCurrentPage();
|
||||||
// panel->OnActivate(); if panel->can('OnActivate');
|
// panel->OnActivate(); if panel->can('OnActivate');
|
||||||
|
|
||||||
std::vector<std::string> tab_names = { "print", "filament", "printer" };
|
for (auto& tab_name : { "print", "filament", "printer" }) {
|
||||||
for (auto& tab_name : tab_names) {
|
if (tab_name == panel->GetName()) {
|
||||||
if (tab_name == panel->GetName())
|
// On GTK, the wxEVT_NOTEBOOK_PAGE_CHANGED event is triggered
|
||||||
m_options_tabs.at(tab_name)->OnActivate();
|
// before the MainFrame is fully set up.
|
||||||
|
auto it = m_options_tabs.find(tab_name);
|
||||||
|
assert(it != m_options_tabs.end());
|
||||||
|
if (it != m_options_tabs.end())
|
||||||
|
it->second->OnActivate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
9
version.inc
Normal file
9
version.inc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Included by CMakeLists, edited by the build script
|
||||||
|
# (the version numbers are generated by the build script from the git current label)
|
||||||
|
|
||||||
|
set(SLIC3R_FORK_NAME "Slic3r Prusa Edition")
|
||||||
|
set(SLIC3R_VERSION "1.42.0-alpha")
|
||||||
|
set(SLIC3R_BUILD "UNKNOWN")
|
||||||
|
set(SLIC3R_RC_VERSION "1,42,0,0")
|
||||||
|
set(SLIC3R_RC_VERSION_DOTS "1.42.0.0")
|
||||||
|
set(SLIC3R_BUILD_ID "${SLIC3R_VERSION}+${SLIC3R_BUILD}")
|
Loading…
Reference in New Issue
Block a user