Commit 6f32fb91 authored by Jehan Monnier's avatar Jehan Monnier

Enable cmake builder group mode

parent cbd8d5cc
......@@ -161,9 +161,9 @@ function (PREPEND list prefix)
endfunction ()
# Force absolute paths.
PREPEND(SOURCES "${CMAKE_SOURCE_DIR}/")
PREPEND(HEADERS "${CMAKE_SOURCE_DIR}/")
PREPEND(QRC_RESOURCES "${CMAKE_SOURCE_DIR}/")
PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/")
PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/")
PREPEND(QRC_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/")
# ------------------------------------------------------------------------------
# Compute QML files list.
......@@ -180,14 +180,14 @@ foreach (line ${QRC_RESOURCES_CONTENT})
${line})
string(REGEX MATCH "\\.[a-z]+$" isUi ${result})
if (NOT ${isUi} STREQUAL "")
list(APPEND QML_SOURCES "${CMAKE_SOURCE_DIR}/${result}")
list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}")
endif ()
endforeach ()
if(NOT WIN32)
add_custom_target(
check_qml DEPENDS ${QML_SOURCES}
COMMAND "${CMAKE_SOURCE_DIR}/tools/check_qml_syntax"
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax"
)
endif()
......@@ -196,8 +196,8 @@ endif()
# ------------------------------------------------------------------------------
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_SOURCE_DIR}/tools/private/pre-commit"
"${CMAKE_SOURCE_DIR}/../.git/hooks/pre-commit"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit"
"${CMAKE_CURRENT_SOURCE_DIR}/../.git/hooks/pre-commit"
)
# ------------------------------------------------------------------------------
......@@ -215,7 +215,7 @@ endif()
# Add languages support.
add_subdirectory(${LANGUAGES_DIRECTORY})
list(APPEND QRC_RESOURCES "${CMAKE_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}")
list(APPEND QRC_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}")
# Add qrc. (images, qml, translations...)
qt5_add_resources(RESOURCES ${QRC_RESOURCES})
......@@ -232,8 +232,7 @@ if(NOT WIN32)
add_dependencies(update_translations check_qml)
endif()
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}")
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE "${LINPHONE_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}")
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE "${LINPHONE_INCLUDE_DIRS}" "${LINPHONECXX_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}")
foreach (package ${QT5_PACKAGES})
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE "${Qt5${package}_INCLUDE_DIRS}")
# `qt5_create_translation` is provided from `LinguistTools` package.
......
......@@ -13,7 +13,7 @@ set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)
set(TS_FILES)
set(I18N_CONTENT "<!DOCTYPE RCC>\n<RCC version=\"1.0\">\n <qresource prefix=\"/\">\n")
foreach (lang ${LANGUAGES})
list(APPEND TS_FILES "${CMAKE_SOURCE_DIR}/${LANGUAGES_DIRECTORY}/${lang}.ts")
list(APPEND TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${lang}.ts")
# Note: the below `languages/` path is not the same as the `${LANGUAGES_DIRECTORY}` value.
# It's the symbolic path used by the linphone binary in the qrc model.
......@@ -22,11 +22,10 @@ foreach (lang ${LANGUAGES})
endforeach ()
set(I18N_CONTENT "${I18N_CONTENT} </qresource>\n</RCC>\n")
file(WRITE "${CMAKE_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}" "${I18N_CONTENT}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}")
# Create `qm` files from `ts` files.
qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${QML_SOURCES} OPTIONS -no-obsolete)
# Translations target must be called by `make`|`make all`.
add_custom_target(update_translations DEPENDS ${QM_FILES})
......
bcg729 @ 20f7bdd8
Subproject commit 9b07c787fdc60463e5746a4f4f8530d40f2eb53c
Subproject commit 20f7bdd8118cc518015a500033de45d39702f0ed
linphone @ 5e382aa5
Subproject commit 4ab81b467f805df37e37d7dbaab844173d418a4f
Subproject commit 5e382aa5033c96a68ba336b06eae6cbb8ed8e5e5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment