mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
cmake: add flags to only build the compiler
... and to use an external compiler For example, this is how one only build the compiler: ``` cmake .. -DSLINT_BUILD_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=/tmp/slint_compiler make install ``` And this only build the runtime ``` cmake .. -DSLINT_FEATURE_COMPILER=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install_runtime make install ``` And then this can be used in a project like so: ``` cmake .. -DCMAKE_PREFIX_PATH=/tmp/install_runtime/ -DSLINT_COMPILER=/tmp/install_compiler/bin/slint-compiler ```
This commit is contained in:
parent
d299f0bf3e
commit
14f7fe4ba2
5 changed files with 265 additions and 243 deletions
|
@ -14,7 +14,13 @@ endif()
|
|||
add_library(@slint_cpp_impl@ @cmake_lib_type@ IMPORTED)
|
||||
set_target_properties(@slint_cpp_impl@ PROPERTIES @SLINT_LIB_PROPERTIES@)
|
||||
|
||||
if (@SLINT_FEATURE_COMPILER@)
|
||||
set(SLINT_COMPILER @SLINT_COMPILER@ CACHE STRING "Path to the slint-compiler executable")
|
||||
if (SLINT_COMPILER)
|
||||
set(SLINT_STYLE @_SLINT_STYLE@ CACHE STRING "The Slint widget style")
|
||||
add_executable(Slint::slint-compiler IMPORTED GLOBAL)
|
||||
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION ${SLINT_COMPILER})
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
|
||||
elseif (@SLINT_FEATURE_COMPILER@)
|
||||
add_executable(Slint::slint-compiler IMPORTED GLOBAL)
|
||||
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue