diff --git a/CMakeLists.txt b/CMakeLists.txt index d059463..8f0df15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,9 @@ set(solvespace_VERSION_MINOR 0) string(SUBSTRING "${GIT_COMMIT_HASH}" 0 8 solvespace_GIT_HASH) set(ENABLE_GUI ON CACHE BOOL - "Whether the graphical interface is enabled (command line interface always is)") + "Whether the graphical interface is enabled") +set(ENABLE_CLI ON CACHE BOOL + "Whether the command line interface is enabled") set(ENABLE_TESTS ON CACHE BOOL "Whether the test suite will be built and run") set(ENABLE_COVERAGE OFF CACHE BOOL @@ -157,7 +159,6 @@ if(WIN32 OR APPLE) list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src) else() # On Linux and BSDs we're a good citizen and link to system libraries. - find_package(Backtrace) find_package(PkgConfig REQUIRED) find_package(ZLIB REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6946da3..2c79442 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -359,20 +359,22 @@ target_compile_options(solvespace-headless # solvespace command-line executable -add_executable(solvespace-cli - platform/entrycli.cpp - $) +if(ENABLE_CLI) + add_executable(solvespace-cli + platform/entrycli.cpp + $) -target_link_libraries(solvespace-cli - solvespace-core - solvespace-headless) + target_link_libraries(solvespace-cli + solvespace-core + solvespace-headless) -add_dependencies(solvespace-cli - resources) + add_dependencies(solvespace-cli + resources) -if(MSVC) - set_target_properties(solvespace-cli PROPERTIES - LINK_FLAGS "/INCREMENTAL:NO /OPT:REF") + if(MSVC) + set_target_properties(solvespace-cli PROPERTIES + LINK_FLAGS "/INCREMENTAL:NO /OPT:REF") + endif() endif() # solvespace unix package @@ -382,8 +384,10 @@ if(NOT (WIN32 OR APPLE)) install(TARGETS solvespace RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() - install(TARGETS solvespace-cli - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(ENABLE_CLI) + install(TARGETS solvespace-cli + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() endif() # solvespace macOS package