Rename the SixtyFPS CMake interface

This commit is contained in:
Simon Hausmann 2022-02-02 09:52:37 +01:00
parent c333b4de2b
commit b1a70f9e58
31 changed files with 161 additions and 152 deletions

View file

@ -12,14 +12,14 @@ if(_IMPORT_PREFIX STREQUAL "/")
endif()
add_library(slint-cpp-shared SHARED IMPORTED)
set_target_properties(slint-cpp-shared PROPERTIES @SIXTYFPS_LIB_PROPERTIES@)
set_target_properties(slint-cpp-shared PROPERTIES @SLINT_LIB_PROPERTIES@)
add_executable(SixtyFPS::slint-compiler IMPORTED GLOBAL)
set_target_properties(SixtyFPS::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler${CMAKE_EXECUTABLE_SUFFIX}")
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}")
set(_IMPORT_PREFIX)
include("${CMAKE_CURRENT_LIST_DIR}/SixtyFPSTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SixtyFPSMacro.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SlintTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
set(SIXTYFPS_STYLE @SIXTYFPS_STYLE_DEFAULT@ CACHE STRING "The SixtyFPS widget style")
set(SLINT_STYLE @SLINT_STYLE_DEFAULT@ CACHE STRING "The Slint widget style")

View file

@ -1,7 +1,7 @@
# Copyright © SixtyFPS GmbH <info@sixtyfps.io>
# SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
function(SIXTYFPS_TARGET_60_SOURCES target)
function(SLINT_TARGET_SOURCES target)
foreach (it IN ITEMS ${ARGN})
get_filename_component(_60_BASE_NAME ${it} NAME_WE)
get_filename_component(_60_ABSOLUTE ${it} REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
@ -14,10 +14,10 @@ function(SIXTYFPS_TARGET_60_SOURCES target)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
COMMAND SixtyFPS::slint-compiler ${_60_ABSOLUTE}
COMMAND Slint::slint-compiler ${_60_ABSOLUTE}
-o ${_60_BASE_NAME_REL}.h --depfile ${_60_BASE_NAME_REL}.d
--style ${SIXTYFPS_STYLE}
DEPENDS SixtyFPS::slint-compiler ${_60_ABSOLUTE}
--style ${SLINT_STYLE}
DEPENDS Slint::slint-compiler ${_60_ABSOLUTE}
COMMENT "Generating ${_60_BASE_NAME}.h"
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.d
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@ -27,10 +27,10 @@ function(SIXTYFPS_TARGET_60_SOURCES target)
file(GLOB ALL_60S "${_60_DIR}/*.60")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
COMMAND SixtyFPS::slint-compiler ${_60_ABSOLUTE}
COMMAND Slint::slint-compiler ${_60_ABSOLUTE}
-o ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
--style ${SIXTYFPS_STYLE}
DEPENDS SixtyFPS::slint-compiler ${_60_ABSOLUTE} ${ALL_60S}
--style ${SLINT_STYLE}
DEPENDS Slint::slint-compiler ${_60_ABSOLUTE} ${ALL_60S}
COMMENT "Generating ${_60_BASE_NAME}.h"
)
endif(CMAKE_GENERATOR STREQUAL "Ninja")