Slic3r was split to a Slic3r.dll / Slic3r.exe / Slic3r-console.exe /

Slic3r-noconsole.exe on Windows.
This commit is contained in:
bubnikv 2018-10-26 11:57:52 +02:00
parent f651182101
commit 21caa9de48
3 changed files with 55 additions and 12 deletions

View file

@ -57,12 +57,18 @@ add_subdirectory(slic3r)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc @ONLY)
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)
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-gui")
else()
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-console")
endif()
if (MSVC)
add_library(slic3r SHARED slic3r.cpp)
else ()
add_executable(slic3r slic3r.cpp)
endif ()
if (NOT MSVC)
if(SLIC3R_GUI)
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-gui")
else()
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-console")
endif()
endif ()
target_link_libraries(slic3r libslic3r)
if (APPLE)
@ -113,6 +119,27 @@ if (SLIC3R_GUI)
endif ()
endif ()
# On Windows, a shim application is required to produce a console / non console version of the Slic3r application.
# Also the shim may load the Mesa software OpenGL renderer if the default renderer does not support OpenGL 2.0 and higher.
if (MSVC)
add_executable(slic3r_app_gui WIN32 slic3r_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
target_compile_definitions(slic3r_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE -DSLIC3R_WRAPPER_GUI)
add_dependencies(slic3r_app_gui slic3r)
target_link_libraries(slic3r_app_gui "-lShell32.lib")
set_target_properties(slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r")
add_executable(slic3r_app_console slic3r_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
target_compile_definitions(slic3r_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE -DSLIC3R_WRAPPER_NOGUI)
add_dependencies(slic3r_app_console slic3r)
set_target_properties(slic3r_app_console PROPERTIES OUTPUT_NAME "slic3r-console")
add_executable(slic3r_app_noconsole WIN32 slic3r_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
target_compile_definitions(slic3r_app_noconsole PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE -DSLIC3R_WRAPPER_NOGUI)
add_dependencies(slic3r_app_noconsole slic3r)
target_link_libraries(slic3r_app_gui "-lShell32.lib")
set_target_properties(slic3r_app_noconsole PROPERTIES OUTPUT_NAME "slic3r-noconsole")
endif ()
# Link the resources dir to where Slic3r GUI expects it
if (MSVC)
if (CMAKE_CONFIGURATION_TYPES)