mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
cmake: windows: add the jami-core to the project
Change-Id: Ieeeb8bbf3d032fb9595b6f76a49ab8027dad7d99
This commit is contained in:
parent
38e5d0967a
commit
3e17a9b247
4 changed files with 33 additions and 32 deletions
|
@ -30,6 +30,7 @@ else()
|
|||
endif()
|
||||
|
||||
option(WITH_DAEMON_SUBMODULE "Build with daemon submodule" ON)
|
||||
option(JAMICORE_AS_SUBDIR "Build Jami-core as a subdir dependency" OFF)
|
||||
option(ENABLE_TESTS "Build with tests" OFF)
|
||||
option(WITH_WEBENGINE "Build with WebEngine" ON)
|
||||
if(WITH_WEBENGINE)
|
||||
|
@ -50,6 +51,19 @@ if(ENABLE_ASAN AND NOT MSVC)
|
|||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
# jami-core
|
||||
if(NOT WITH_DAEMON_SUBMODULE)
|
||||
set(DAEMON_DIR ${PROJECT_SOURCE_DIR}/../daemon)
|
||||
else()
|
||||
set(DAEMON_DIR ${PROJECT_SOURCE_DIR}/daemon)
|
||||
endif()
|
||||
|
||||
# For now only MSVC is supported for building Jami-core within the
|
||||
# client cmake.
|
||||
if(JAMICORE_AS_SUBDIR)
|
||||
add_subdirectory(${DAEMON_DIR})
|
||||
endif()
|
||||
|
||||
# init some variables for includes, libs, etc.
|
||||
set(CLIENT_INCLUDE_DIRS, "")
|
||||
set(CLIENT_LINK_DIRS, "")
|
||||
|
@ -67,14 +81,6 @@ set(CMAKE_AUTORCC ON)
|
|||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# Main project directories:
|
||||
|
||||
# jami-daemon
|
||||
if(NOT WITH_DAEMON_SUBMODULE)
|
||||
set(DAEMON_DIR ${PROJECT_SOURCE_DIR}/../daemon)
|
||||
else()
|
||||
set(DAEMON_DIR ${PROJECT_SOURCE_DIR}/daemon)
|
||||
endif()
|
||||
# src
|
||||
set(LIBCLIENT_SRC_DIR ${PROJECT_SOURCE_DIR}/src/libclient)
|
||||
set(APP_SRC_DIR ${PROJECT_SOURCE_DIR}/src/app)
|
||||
|
@ -106,16 +112,6 @@ else()
|
|||
message(FATAL_ERROR "Qt 6.4 or higher is required. Found ${QT_VERSION}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(DEFAULT_BUILD_TYPE "Debug")
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
endif()
|
||||
set(OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/x64/${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
# libjamiclient
|
||||
add_subdirectory(${LIBCLIENT_SRC_DIR})
|
||||
|
||||
|
|
8
build.py
8
build.py
|
@ -364,13 +364,7 @@ def cwd(path):
|
|||
def run_install(args):
|
||||
# Platforms with special compilation scripts
|
||||
if args.distribution == WIN32_DISTRIBUTION_NAME:
|
||||
if args.pywinmake:
|
||||
with cwd('daemon'):
|
||||
execute_script(['git submodule update --init'])
|
||||
execute_script(['python -m pip install extras/scripts/pywinmake'])
|
||||
execute_script(['python extras/scripts/winmake.py'])
|
||||
execute_script(['python extras/scripts/winmake.py --base-dir compat/msvc'])
|
||||
else:
|
||||
if not args.pywinmake:
|
||||
with cwd('daemon/compat/msvc'):
|
||||
execute_script([f'python winmake.py -iv -s {args.sdk} -b daemon'])
|
||||
|
||||
|
|
|
@ -190,13 +190,9 @@ def init_submodules():
|
|||
"""Initialize any git submodules in the project."""
|
||||
print("Initializing submodules...")
|
||||
|
||||
if execute_cmd(["git", "submodule", "update", "--init"], False):
|
||||
if execute_cmd(["git", "submodule", "update", "--init", "--recursive"], False):
|
||||
print("Submodule initialization error.")
|
||||
else:
|
||||
if execute_cmd(["git", "submodule", "update", "--recursive"], False):
|
||||
print("Submodule recursive checkout error.")
|
||||
else:
|
||||
print("Submodule recursive checkout finished.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def build_deps():
|
||||
|
@ -269,7 +265,7 @@ def build(config_str, qt_dir, tests):
|
|||
# We need to update the minimum SDK version to be able to
|
||||
# build with system theme support
|
||||
cmake_options = [
|
||||
"-DWITH_DAEMON_SUBMODULE=ON",
|
||||
"-DJAMICORE_AS_SUBDIR=ON",
|
||||
"-DCMAKE_PREFIX_PATH=" + qt_dir,
|
||||
"-DCMAKE_MSVCIDE_RUN_PATH=" + qt_dir + "\\bin",
|
||||
"-DCMAKE_INSTALL_PREFIX=" + os.getcwd(),
|
||||
|
|
|
@ -225,6 +225,10 @@ Qt${QT_VERSION_MAJOR} enabled.")
|
|||
add_subdirectory(qtwrapper)
|
||||
include_directories(qtwrapper)
|
||||
|
||||
if(JAMICORE_AS_SUBDIR)
|
||||
add_dependencies(qtwrapper jami-core)
|
||||
endif()
|
||||
|
||||
if(${VERBOSE_IPC} MATCHES true)
|
||||
message(STATUS "Adding more debug output")
|
||||
add_definitions(-DVERBOSE_IPC=true)
|
||||
|
@ -470,6 +474,17 @@ add_library(${LIBCLIENT_NAME} STATIC
|
|||
${LIBCLIENT_SOURCES}
|
||||
${LIBCLIENT_HEADERS_API}
|
||||
${LIBCLIENT_HEADERS_MOC})
|
||||
|
||||
if(JAMICORE_AS_SUBDIR)
|
||||
# Define the project dependencies depending on the build type.
|
||||
if(ENABLE_LIBWRAP)
|
||||
add_dependencies(qtwrapper jami-core)
|
||||
add_dependencies(${LIBCLIENT_NAME} qtwrapper)
|
||||
else()
|
||||
add_dependencies(${LIBCLIENT_NAME} jami-core)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(QT_LIB ${QT_LIBS})
|
||||
target_link_libraries(${LIBCLIENT_NAME} ${QT_LIB})
|
||||
endforeach()
|
||||
|
|
Loading…
Add table
Reference in a new issue