Skip to content
Snippets Groups Projects
Commit 3e17a9b2 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

cmake: windows: add the jami-core to the project

Change-Id: Ieeeb8bbf3d032fb9595b6f76a49ab8027dad7d99
parent 38e5d096
Branches
Tags
No related merge requests found
...@@ -30,6 +30,7 @@ else() ...@@ -30,6 +30,7 @@ else()
endif() endif()
option(WITH_DAEMON_SUBMODULE "Build with daemon submodule" ON) 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(ENABLE_TESTS "Build with tests" OFF)
option(WITH_WEBENGINE "Build with WebEngine" ON) option(WITH_WEBENGINE "Build with WebEngine" ON)
if(WITH_WEBENGINE) if(WITH_WEBENGINE)
...@@ -50,6 +51,19 @@ if(ENABLE_ASAN AND NOT MSVC) ...@@ -50,6 +51,19 @@ if(ENABLE_ASAN AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif() 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. # init some variables for includes, libs, etc.
set(CLIENT_INCLUDE_DIRS, "") set(CLIENT_INCLUDE_DIRS, "")
set(CLIENT_LINK_DIRS, "") set(CLIENT_LINK_DIRS, "")
...@@ -67,14 +81,6 @@ set(CMAKE_AUTORCC ON) ...@@ -67,14 +81,6 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR 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 # src
set(LIBCLIENT_SRC_DIR ${PROJECT_SOURCE_DIR}/src/libclient) set(LIBCLIENT_SRC_DIR ${PROJECT_SOURCE_DIR}/src/libclient)
set(APP_SRC_DIR ${PROJECT_SOURCE_DIR}/src/app) set(APP_SRC_DIR ${PROJECT_SOURCE_DIR}/src/app)
...@@ -106,16 +112,6 @@ else() ...@@ -106,16 +112,6 @@ else()
message(FATAL_ERROR "Qt 6.4 or higher is required. Found ${QT_VERSION}") message(FATAL_ERROR "Qt 6.4 or higher is required. Found ${QT_VERSION}")
endif() 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 # libjamiclient
add_subdirectory(${LIBCLIENT_SRC_DIR}) add_subdirectory(${LIBCLIENT_SRC_DIR})
......
...@@ -364,13 +364,7 @@ def cwd(path): ...@@ -364,13 +364,7 @@ def cwd(path):
def run_install(args): def run_install(args):
# Platforms with special compilation scripts # Platforms with special compilation scripts
if args.distribution == WIN32_DISTRIBUTION_NAME: if args.distribution == WIN32_DISTRIBUTION_NAME:
if args.pywinmake: if not 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:
with cwd('daemon/compat/msvc'): with cwd('daemon/compat/msvc'):
execute_script([f'python winmake.py -iv -s {args.sdk} -b daemon']) execute_script([f'python winmake.py -iv -s {args.sdk} -b daemon'])
......
...@@ -190,13 +190,9 @@ def init_submodules(): ...@@ -190,13 +190,9 @@ def init_submodules():
"""Initialize any git submodules in the project.""" """Initialize any git submodules in the project."""
print("Initializing submodules...") print("Initializing submodules...")
if execute_cmd(["git", "submodule", "update", "--init"], False): if execute_cmd(["git", "submodule", "update", "--init", "--recursive"], False):
print("Submodule initialization error.") print("Submodule initialization error.")
else: sys.exit(1)
if execute_cmd(["git", "submodule", "update", "--recursive"], False):
print("Submodule recursive checkout error.")
else:
print("Submodule recursive checkout finished.")
def build_deps(): def build_deps():
...@@ -269,7 +265,7 @@ def build(config_str, qt_dir, tests): ...@@ -269,7 +265,7 @@ def build(config_str, qt_dir, tests):
# We need to update the minimum SDK version to be able to # We need to update the minimum SDK version to be able to
# build with system theme support # build with system theme support
cmake_options = [ cmake_options = [
"-DWITH_DAEMON_SUBMODULE=ON", "-DJAMICORE_AS_SUBDIR=ON",
"-DCMAKE_PREFIX_PATH=" + qt_dir, "-DCMAKE_PREFIX_PATH=" + qt_dir,
"-DCMAKE_MSVCIDE_RUN_PATH=" + qt_dir + "\\bin", "-DCMAKE_MSVCIDE_RUN_PATH=" + qt_dir + "\\bin",
"-DCMAKE_INSTALL_PREFIX=" + os.getcwd(), "-DCMAKE_INSTALL_PREFIX=" + os.getcwd(),
......
...@@ -225,6 +225,10 @@ Qt${QT_VERSION_MAJOR} enabled.") ...@@ -225,6 +225,10 @@ Qt${QT_VERSION_MAJOR} enabled.")
add_subdirectory(qtwrapper) add_subdirectory(qtwrapper)
include_directories(qtwrapper) include_directories(qtwrapper)
if(JAMICORE_AS_SUBDIR)
add_dependencies(qtwrapper jami-core)
endif()
if(${VERBOSE_IPC} MATCHES true) if(${VERBOSE_IPC} MATCHES true)
message(STATUS "Adding more debug output") message(STATUS "Adding more debug output")
add_definitions(-DVERBOSE_IPC=true) add_definitions(-DVERBOSE_IPC=true)
...@@ -470,6 +474,17 @@ add_library(${LIBCLIENT_NAME} STATIC ...@@ -470,6 +474,17 @@ add_library(${LIBCLIENT_NAME} STATIC
${LIBCLIENT_SOURCES} ${LIBCLIENT_SOURCES}
${LIBCLIENT_HEADERS_API} ${LIBCLIENT_HEADERS_API}
${LIBCLIENT_HEADERS_MOC}) ${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}) foreach(QT_LIB ${QT_LIBS})
target_link_libraries(${LIBCLIENT_NAME} ${QT_LIB}) target_link_libraries(${LIBCLIENT_NAME} ${QT_LIB})
endforeach() endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment