Commit dce9bd6b authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix CMake warnings.

parent 3a27c46c
...@@ -57,7 +57,7 @@ else() ...@@ -57,7 +57,7 @@ else()
# Get build tools and flags for autotools projects (except for Windows Phone where we cannot build with MinGW) # Get build tools and flags for autotools projects (except for Windows Phone where we cannot build with MinGW)
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
linphone_builder_get_autotools_configuration() linphone_builder_get_autotools_configuration()
endif() endif()
......
...@@ -36,7 +36,7 @@ if(LINPHONE_BUILDER_CHECK_LATEST) ...@@ -36,7 +36,7 @@ if(LINPHONE_BUILDER_CHECK_LATEST)
OUTPUT_VARIABLE _builder_latest) OUTPUT_VARIABLE _builder_latest)
string(REPLACE "\t" ";" _builder_latest ${_builder_latest}) string(REPLACE "\t" ";" _builder_latest ${_builder_latest})
list(GET _builder_latest 0 _builder_latest_git_tag) list(GET _builder_latest 0 _builder_latest_git_tag)
if("${EP_${_builder_name}_GIT_TAG}" STREQUAL "${_builder_latest_git_tag}") if(EP_${_builder_name}_GIT_TAG STREQUAL "${_builder_latest_git_tag}")
message(STATUS "${_builder_name} is up-to-date") message(STATUS "${_builder_name} is up-to-date")
else() else()
message(STATUS "${_builder_name} is outdated: ${EP_${_builder_name}_GIT_TAG} instead of ${_builder_latest_git_tag} [${EP_${_builder_name}_GIT_TAG_LATEST}]") message(STATUS "${_builder_name} is outdated: ${EP_${_builder_name}_GIT_TAG} instead of ${_builder_latest_git_tag} [${EP_${_builder_name}_GIT_TAG_LATEST}]")
...@@ -176,7 +176,7 @@ else() ...@@ -176,7 +176,7 @@ else()
linphone_builder_add_builder_to_target(TARGET_ms2plugins x264) linphone_builder_add_builder_to_target(TARGET_ms2plugins x264)
linphone_builder_add_builder_to_target(TARGET_ms2plugins msx264) linphone_builder_add_builder_to_target(TARGET_ms2plugins msx264)
endif() endif()
if(ENABLE_VIDEO AND "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(ENABLE_VIDEO AND (CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone"))
linphone_builder_add_builder_to_target(TARGET_ms2plugins mswp8vid) linphone_builder_add_builder_to_target(TARGET_ms2plugins mswp8vid)
endif() endif()
endif() endif()
...@@ -193,7 +193,7 @@ else() ...@@ -193,7 +193,7 @@ else()
# Do not build sqlite3, xml2 and zlib on IOS, they are provided by the system # Do not build sqlite3, xml2 and zlib on IOS, they are provided by the system
linphone_builder_add_builder_to_target(TARGET_linphone sqlite3) linphone_builder_add_builder_to_target(TARGET_linphone sqlite3)
linphone_builder_add_builder_to_target(TARGET_linphone xml2) linphone_builder_add_builder_to_target(TARGET_linphone xml2)
if (NOT QNX) if(NOT QNX)
linphone_builder_add_builder_to_target(TARGET_linphone zlib) linphone_builder_add_builder_to_target(TARGET_linphone zlib)
endif() endif()
endif() endif()
......
...@@ -58,7 +58,7 @@ if (APPLE) ...@@ -58,7 +58,7 @@ if (APPLE)
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"") set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"")
endif() endif()
else() else()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64") if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"") set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"")
else() else()
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"") set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"")
......
...@@ -32,7 +32,7 @@ if(WIN32) ...@@ -32,7 +32,7 @@ if(WIN32)
list(APPEND SOURCE_FILES sqlite3.def) list(APPEND SOURCE_FILES sqlite3.def)
endif() endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
add_definitions( add_definitions(
-DSQLITE_OS_WINRT=1 -DSQLITE_OS_WINRT=1
-DSQLITE_WIN32_FILEMAPPING_API=1 -DSQLITE_WIN32_FILEMAPPING_API=1
......
...@@ -40,7 +40,7 @@ else() ...@@ -40,7 +40,7 @@ else()
set(EP_xml2_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}") set(EP_xml2_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_xml2_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/CMakeLists.txt" "<SOURCE_DIR>") set(EP_xml2_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/CMakeLists.txt" "<SOURCE_DIR>")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>") list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>")
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/windowsphone_port.h" "<SOURCE_DIR>") list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/windowsphone_port.h" "<SOURCE_DIR>")
endif() endif()
endif() endif()
...@@ -358,7 +358,7 @@ if(MSVC) ...@@ -358,7 +358,7 @@ if(MSVC)
elseif(NOT APPLE) elseif(NOT APPLE)
set_target_properties(xml2 PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms") set_target_properties(xml2 PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
endif() endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h") target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h")
endif() endif()
......
...@@ -155,19 +155,19 @@ endfunction() ...@@ -155,19 +155,19 @@ endfunction()
macro(linphone_builder_create_targets_list) macro(linphone_builder_create_targets_list)
set(LINPHONE_BUILDER_TARGETS ) set(LINPHONE_BUILDER_TARGETS )
if("${LINPHONE_BUILDER_TARGET}" STREQUAL "belle-sip") if(LINPHONE_BUILDER_TARGET STREQUAL "belle-sip")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip") list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "ortp") elseif(LINPHONE_BUILDER_TARGET STREQUAL "ortp")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp") list(APPEND LINPHONE_BUILDER_TARGETS "ortp")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "ms2") elseif(LINPHONE_BUILDER_TARGET STREQUAL "ms2")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2") list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "ms2-plugins") elseif(LINPHONE_BUILDER_TARGET STREQUAL "ms2-plugins")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2" "ms2-plugins") list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2" "ms2-plugins")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "linphone") elseif(LINPHONE_BUILDER_TARGET STREQUAL "linphone")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "ortp" "ms2" "ms2-plugins" "linphone") list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "ortp" "ms2" "ms2-plugins" "linphone")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "flexisip") elseif(LINPHONE_BUILDER_TARGET STREQUAL "flexisip")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "flexisip") list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "flexisip")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "odb") elseif(LINPHONE_BUILDER_TARGET STREQUAL "odb")
list(APPEND LINPHONE_BUILDER_TARGETS "odb" ) list(APPEND LINPHONE_BUILDER_TARGETS "odb" )
else() else()
message(FATAL_ERROR "Invalid LINPHONE_BUILDER_TARGET '${LINPHONE_BUILDER_TARGET}'") message(FATAL_ERROR "Invalid LINPHONE_BUILDER_TARGET '${LINPHONE_BUILDER_TARGET}'")
...@@ -221,25 +221,25 @@ endmacro() ...@@ -221,25 +221,25 @@ endmacro()
macro(linphone_builder_apply_flags) macro(linphone_builder_apply_flags)
foreach(BUILD_CONFIG "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO") foreach(BUILD_CONFIG "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO")
if(NOT "${LINPHONE_BUILDER_CPPFLAGS}" STREQUAL "") if(LINPHONE_BUILDER_CPPFLAGS)
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}") set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}")
set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}") set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}")
set(AUTOTOOLS_C_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}") set(AUTOTOOLS_C_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}")
set(AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}") set(AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CPPFLAGS}")
endif() endif()
if(NOT "${LINPHONE_BUILDER_CFLAGS}" STREQUAL "") if(LINPHONE_BUILDER_CFLAGS)
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CFLAGS}") set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CFLAGS}")
set(AUTOTOOLS_C_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CFLAGS}") set(AUTOTOOLS_C_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CFLAGS}")
endif() endif()
if(NOT "${LINPHONE_BUILDER_CXXFLAGS}" STREQUAL "") if(LINPHONE_BUILDER_CXXFLAGS)
set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CXXFLAGS}") set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CXXFLAGS}")
set(AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG} "{AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CXX_FLAGS}") set(AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG} "{AUTOTOOLS_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_CXX_FLAGS}")
endif() endif()
if(NOT "${LINPHONE_BUILDER_OBJCFLAGS}" STREQUAL "") if(LINPHONE_BUILDER_OBJCFLAGS)
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_OBJCFLAGS}") set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_OBJCFLAGS}")
set(AUTOTOOLS_OBJC_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_OBJC_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_OBJCFLAGS}") set(AUTOTOOLS_OBJC_FLAGS${BUILD_CONFIG} "${AUTOTOOLS_OBJC_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_OBJCFLAGS}")
endif() endif()
if(NOT "${LINPHONE_BUILDER_LDFLAGS}" STREQUAL "") if(LINPHONE_BUILDER_LDFLAGS)
# TODO: The two following lines should not be here # TODO: The two following lines should not be here
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_LDFLAGS}") set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_LDFLAGS}")
set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_LDFLAGS}") set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${LINPHONE_BUILDER_LDFLAGS}")
...@@ -254,7 +254,7 @@ endmacro() ...@@ -254,7 +254,7 @@ endmacro()
macro(linphone_builder_apply_cmake_flags_to_autotools_project PROJNAME) macro(linphone_builder_apply_cmake_flags_to_autotools_project PROJNAME)
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools") if(EP_${PROJNAME}_BUILD_METHOD STREQUAL "autotools")
set(BUILD_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel") set(BUILD_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
list(FIND BUILD_TYPES "${CMAKE_BUILD_TYPE}" BUILD_TYPE_FOUND) list(FIND BUILD_TYPES "${CMAKE_BUILD_TYPE}" BUILD_TYPE_FOUND)
set(BUILD_TYPE_SUFFIX "") set(BUILD_TYPE_SUFFIX "")
...@@ -273,7 +273,7 @@ endmacro() ...@@ -273,7 +273,7 @@ endmacro()
macro(linphone_builder_apply_extra_flags PROJNAME) macro(linphone_builder_apply_extra_flags PROJNAME)
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools") if(EP_${PROJNAME}_BUILD_METHOD STREQUAL "autotools")
set(ep_asflags "${ep_asflags} ${EP_${PROJNAME}_EXTRA_ASFLAGS}") set(ep_asflags "${ep_asflags} ${EP_${PROJNAME}_EXTRA_ASFLAGS}")
set(ep_cppflags "${ep_cppflags} ${EP_${PROJNAME}_EXTRA_CPPFLAGS}") set(ep_cppflags "${ep_cppflags} ${EP_${PROJNAME}_EXTRA_CPPFLAGS}")
set(ep_cflags "${ep_cflags} ${EP_${PROJNAME}_EXTRA_CFLAGS}") set(ep_cflags "${ep_cflags} ${EP_${PROJNAME}_EXTRA_CFLAGS}")
...@@ -282,13 +282,13 @@ macro(linphone_builder_apply_extra_flags PROJNAME) ...@@ -282,13 +282,13 @@ macro(linphone_builder_apply_extra_flags PROJNAME)
set(ep_ldflags "${ep_ldflags} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(ep_ldflags "${ep_ldflags} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
else() else()
foreach(BUILD_CONFIG "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO") foreach(BUILD_CONFIG "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO")
if(NOT "${EP_${PROJNAME}_EXTRA_CFLAGS}" STREQUAL "") if(EP_${PROJNAME}_EXTRA_CFLAGS)
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_CFLAGS}") set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_CFLAGS}")
endif() endif()
if(NOT "${EP_${PROJNAME}_EXTRA_CXXFLAGS}" STREQUAL "") if(EP_${PROJNAME}_EXTRA_CXXFLAGS)
set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_CXXFLAGS}") set(CMAKE_CXX_FLAGS${BUILD_CONFIG} "${CMAKE_CXX_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_CXXFLAGS}")
endif() endif()
if(NOT "${EP_${PROJNAME}_EXTRA_LDFLAGS}" STREQUAL "") if(EP_${PROJNAME}_EXTRA_LDFLAGS)
set(CMAKE_EXE_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_EXE_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_EXE_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_EXE_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_MODULE_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_MODULE_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_MODULE_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}") set(CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
...@@ -349,7 +349,7 @@ endmacro() ...@@ -349,7 +349,7 @@ endmacro()
# this function invokes configure_file() for the project, using the default file if # this function invokes configure_file() for the project, using the default file if
# the specific file is not defined # the specific file is not defined
function(linphone_builder_configure_file_for_project PROJNAME CMD DEFAULT_CONF_FILE OUTPUT) function(linphone_builder_configure_file_for_project PROJNAME CMD DEFAULT_CONF_FILE OUTPUT)
if("${EP_${PROJNAME}_${CMD}_COMMAND_SOURCE}" STREQUAL "") if(NOT EP_${PROJNAME}_${CMD}_COMMAND_SOURCE)
message(STATUS "Using default file ${DEFAULT_CONF_FILE} for ${CMD} step of ${PROJNAME}") message(STATUS "Using default file ${DEFAULT_CONF_FILE} for ${CMD} step of ${PROJNAME}")
configure_file(${DEFAULT_CONF_FILE} ${OUTPUT}) configure_file(${DEFAULT_CONF_FILE} ${OUTPUT})
else() else()
...@@ -396,14 +396,14 @@ function(linphone_builder_add_external_project PROJNAME) ...@@ -396,14 +396,14 @@ function(linphone_builder_add_external_project PROJNAME)
linphone_builder_apply_extra_flags(${PROJNAME}) linphone_builder_apply_extra_flags(${PROJNAME})
linphone_builder_expand_external_project_vars() linphone_builder_expand_external_project_vars()
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "prebuilt") if(EP_${PROJNAME}_BUILD_METHOD STREQUAL "prebuilt")
message("Using prebuilt ${PROJNAME}") message("Using prebuilt ${PROJNAME}")
set(BUILD_COMMANDS set(BUILD_COMMANDS
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "" CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo ""
BUILD_COMMAND ${CMAKE_COMMAND} -E echo "" BUILD_COMMAND ${CMAKE_COMMAND} -E echo ""
INSTALL_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=<SOURCE_DIR> -DINSTALL_DIR=${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install_prebuilt.cmake INSTALL_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=<SOURCE_DIR> -DINSTALL_DIR=${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install_prebuilt.cmake
) )
elseif("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "custom") elseif(EP_${PROJNAME}_BUILD_METHOD STREQUAL "custom")
set(ep_redirect_to_file "2>&1 >> ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}.log") set(ep_redirect_to_file "2>&1 >> ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}.log")
configure_file(${EP_${PROJNAME}_CONFIGURE_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh) configure_file(${EP_${PROJNAME}_CONFIGURE_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh)
configure_file(${EP_${PROJNAME}_BUILD_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.sh) configure_file(${EP_${PROJNAME}_BUILD_COMMAND_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.sh)
...@@ -422,19 +422,19 @@ function(linphone_builder_add_external_project PROJNAME) ...@@ -422,19 +422,19 @@ function(linphone_builder_add_external_project PROJNAME)
BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION} BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION}
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION} INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION}
) )
elseif("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools") elseif(EP_${PROJNAME}_BUILD_METHOD STREQUAL "autotools")
linphone_builder_create_autogen_command(${PROJNAME}) linphone_builder_create_autogen_command(${PROJNAME})
linphone_builder_create_configure_command(${PROJNAME}) linphone_builder_create_configure_command(${PROJNAME})
linphone_builder_create_build_command(${PROJNAME}) linphone_builder_create_build_command(${PROJNAME})
if("${EP_${PROJNAME}_CONFIG_H_FILE}" STREQUAL "") if(EP_${PROJNAME}_CONFIG_H_FILE)
set(ep_config_h_file config.h)
else()
set(ep_config_h_file ${EP_${PROJNAME}_CONFIG_H_FILE}) set(ep_config_h_file ${EP_${PROJNAME}_CONFIG_H_FILE})
endif()
if("${EP_${PROJNAME}_INSTALL_TARGET}" STREQUAL "")
set(ep_install_target "install")
else() else()
set(ep_config_h_file config.h)
endif()
if(EP_${PROJNAME}_INSTALL_TARGET)
set(ep_install_target "${EP_${PROJNAME}_INSTALL_TARGET}") set(ep_install_target "${EP_${PROJNAME}_INSTALL_TARGET}")
else()
set(ep_install_target "install")
endif() endif()
set(ep_redirect_to_file "2>&1 >> ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}.log") set(ep_redirect_to_file "2>&1 >> ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}.log")
...@@ -446,20 +446,20 @@ function(linphone_builder_add_external_project PROJNAME) ...@@ -446,20 +446,20 @@ function(linphone_builder_add_external_project PROJNAME)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mingw_install.bat.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.bat) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mingw_install.bat.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.bat)
# Build in source with MinGW as build out-of-source does not work # Build in source with MinGW as build out-of-source does not work
set(ep_build ${ep_source}) set(ep_build ${ep_source})
if(NOT "${ep_autogen_command}" STREQUAL "") if(ep_autogen_command)
set(ep_autogen_redirect_to_file ${ep_redirect_to_file}) set(ep_autogen_redirect_to_file ${ep_redirect_to_file})
endif() endif()
if(NOT "${ep_configure_command}" STREQUAL "") if(ep_configure_command)
set(ep_configure_redirect_to_file ${ep_redirect_to_file}) set(ep_configure_redirect_to_file ${ep_redirect_to_file})
endif() endif()
else() else()
set(SCRIPT_EXTENSION sh) set(SCRIPT_EXTENSION sh)
endif() endif()
if("${EP_${PROJNAME}_PKG_CONFIG}" STREQUAL "") if(EP_${PROJNAME}_PKG_CONFIG)
set(LINPHONE_BUILDER_PKG_CONFIG "${PKG_CONFIG_PROGRAM}")
else()
set(LINPHONE_BUILDER_PKG_CONFIG "${EP_${PROJNAME}_PKG_CONFIG}") set(LINPHONE_BUILDER_PKG_CONFIG "${EP_${PROJNAME}_PKG_CONFIG}")
else()
set(LINPHONE_BUILDER_PKG_CONFIG "${PKG_CONFIG_PROGRAM}")
endif() endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh)
...@@ -471,7 +471,7 @@ function(linphone_builder_add_external_project PROJNAME) ...@@ -471,7 +471,7 @@ function(linphone_builder_add_external_project PROJNAME)
BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION} BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION}
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION} INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION}
) )
elseif("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "rpm") elseif(EP_${PROJNAME}_BUILD_METHOD STREQUAL "rpm")
if(WIN32) if(WIN32)
message(SEND_ERROR "rpm build not supported on WIN32") message(SEND_ERROR "rpm build not supported on WIN32")
...@@ -480,47 +480,47 @@ function(linphone_builder_add_external_project PROJNAME) ...@@ -480,47 +480,47 @@ function(linphone_builder_add_external_project PROJNAME)
linphone_builder_create_autogen_command(${PROJNAME}) linphone_builder_create_autogen_command(${PROJNAME})
linphone_builder_create_configure_command(${PROJNAME}) linphone_builder_create_configure_command(${PROJNAME})
if("${EP_${PROJNAME}_CONFIG_H_FILE}" STREQUAL "") if(EP_${PROJNAME}_CONFIG_H_FILE)
set(ep_config_h_file config.h)
else()
set(ep_config_h_file ${EP_${PROJNAME}_CONFIG_H_FILE}) set(ep_config_h_file ${EP_${PROJNAME}_CONFIG_H_FILE})
else()
set(ep_config_h_file config.h)
endif() endif()
if("${EP_${PROJNAME}_INSTALL_TARGET}" STREQUAL "") if(EP_${PROJNAME}_INSTALL_TARGET)
set(ep_install_target "install")
else()
set(ep_install_target "${EP_${PROJNAME}_INSTALL_TARGET}") set(ep_install_target "${EP_${PROJNAME}_INSTALL_TARGET}")
else()
set(ep_install_target "install")
endif() endif()
if("${EP_${PROJNAME}_SPEC_FILE}" STREQUAL "") if(EP_${PROJNAME}_SPEC_FILE)
message( SEND_ERROR "rpm build requires EP_${PROJNAME}_SPEC_FILE to be defined")
else()
set(LINPHONE_BUILDER_SPEC_FILE "${EP_${PROJNAME}_SPEC_FILE}") set(LINPHONE_BUILDER_SPEC_FILE "${EP_${PROJNAME}_SPEC_FILE}")
else()
message(SEND_ERROR "rpm build requires EP_${PROJNAME}_SPEC_FILE to be defined")
endif() endif()
# a distinctive name of the generated RPM. It is used to find the rpms to install # a distinctive name of the generated RPM. It is used to find the rpms to install
# in the install step. Defaults to $PROJNAME but could be something else # in the install step. Defaults to $PROJNAME but could be something else
if("${EP_${PROJNAME}_RPMBUILD_NAME}" STREQUAL "") if(EP_${PROJNAME}_RPMBUILD_NAME)
set(LINPHONE_BUILDER_RPMBUILD_NAME "${PROJNAME}")
else()
set(LINPHONE_BUILDER_RPMBUILD_NAME "${EP_${PROJNAME}_RPMBUILD_NAME}") set(LINPHONE_BUILDER_RPMBUILD_NAME "${EP_${PROJNAME}_RPMBUILD_NAME}")
else()
set(LINPHONE_BUILDER_RPMBUILD_NAME "${PROJNAME}")
endif() endif()
# a distinctive name of the generated RPM. It is used to find the rpms to install # a distinctive name of the generated RPM. It is used to find the rpms to install
# in the install step. Defaults to $PROJNAME but could be something else # in the install step. Defaults to $PROJNAME but could be something else
if(NOT "${EP_${PROJNAME}_RPMBUILD_OPTIONS}" STREQUAL "") if(EP_${PROJNAME}_RPMBUILD_OPTIONS)
set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}") set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}")
endif() endif()
set(LINPHONE_BUILDER_SPEC_PREFIX "${EP_${PROJNAME}_SPEC_PREXIX}") set(LINPHONE_BUILDER_SPEC_PREFIX "${EP_${PROJNAME}_SPEC_PREXIX}")
if("${EP_${PROJNAME}_PKG_CONFIG}" STREQUAL "") if(EP_${PROJNAME}_PKG_CONFIG)
set(LINPHONE_BUILDER_PKG_CONFIG "${PKG_CONFIG_PROGRAM}")
else()
set(LINPHONE_BUILDER_PKG_CONFIG "${EP_${PROJNAME}_PKG_CONFIG}") set(LINPHONE_BUILDER_PKG_CONFIG "${EP_${PROJNAME}_PKG_CONFIG}")
else()
set(LINPHONE_BUILDER_PKG_CONFIG "${PKG_CONFIG_PROGRAM}")
endif() endif()
if(NOT "${EP_${PROJNAME}_CONFIGURE_EXTRA_CMD}" STREQUAL "") if(EP_${PROJNAME}_CONFIGURE_EXTRA_CMD)
set(LINPHONE_BUILDER_CONFIGURE_EXTRA_CMD "${EP_${PROJNAME}_CONFIGURE_EXTRA_CMD}") set(LINPHONE_BUILDER_CONFIGURE_EXTRA_CMD "${EP_${PROJNAME}_CONFIGURE_EXTRA_CMD}")
endif() endif()
......
...@@ -34,7 +34,7 @@ if(MSVC) ...@@ -34,7 +34,7 @@ if(MSVC)
message(FATAL_ERROR "Could not find MinGW!") message(FATAL_ERROR "Could not find MinGW!")
endif() endif()
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
find_file(GCC_LIBRARY find_file(GCC_LIBRARY
NAMES libgcc.a NAMES libgcc.a
HINTS "C:/MinGW/lib/gcc/mingw32/*" HINTS "C:/MinGW/lib/gcc/mingw32/*"
......
...@@ -81,7 +81,7 @@ endif() ...@@ -81,7 +81,7 @@ endif()
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" _IS_SYSTEM_DIR) list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" _IS_SYSTEM_DIR)
if("${_IS_SYSTEM_DIR}" STREQUAL "-1") if(_IS_SYSTEM_DIR STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif() endif()
......
...@@ -73,7 +73,7 @@ if(APPLE) ...@@ -73,7 +73,7 @@ if(APPLE)
endif() endif()
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" _IS_SYSTEM_DIR) list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" _IS_SYSTEM_DIR)
if("${_IS_SYSTEM_DIR}" STREQUAL "-1") if(_IS_SYSTEM_DIR STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif() endif()
message("cmake install rpath: ${CMAKE_INSTALL_RPATH}") message("cmake install rpath: ${CMAKE_INSTALL_RPATH}")
......
...@@ -176,7 +176,7 @@ if(MSVC) ...@@ -176,7 +176,7 @@ if(MSVC)
FILES_MATCHING PATTERN "libmswasapi.dll" FILES_MATCHING PATTERN "libmswasapi.dll"
) )
string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}") string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}")
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MSVC_DEBUG_SYSTEM_LIBRARIES "d") set(MSVC_DEBUG_SYSTEM_LIBRARIES "d")
endif() endif()
find_file(MSVCP_LIB "msvcp${MSVC_VERSION}0${MSVC_DEBUG_SYSTEM_LIBRARIES}.dll" PATHS "C:/Windows/System32") find_file(MSVCP_LIB "msvcp${MSVC_VERSION}0${MSVC_DEBUG_SYSTEM_LIBRARIES}.dll" PATHS "C:/Windows/System32")
......
...@@ -74,7 +74,7 @@ if(WIN32) ...@@ -74,7 +74,7 @@ if(WIN32)
set(PACKAGES_TO_BUILD "exe" "msi" "zip" "wheel") set(PACKAGES_TO_BUILD "exe" "msi" "zip" "wheel")
set(PY_MODULE_EXT ".pyd") set(PY_MODULE_EXT ".pyd")
string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}") string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}")
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MSVC_DEBUG_SYSTEM_LIBRARIES "d") set(MSVC_DEBUG_SYSTEM_LIBRARIES "d")
endif() endif()
find_file(MSVCP_LIB msvcp${MSVC_VERSION}0${MSVC_DEBUG_SYSTEM_LIBRARIES}.dll PATHS "C:/Windows/System32") find_file(MSVCP_LIB msvcp${MSVC_VERSION}0${MSVC_DEBUG_SYSTEM_LIBRARIES}.dll PATHS "C:/Windows/System32")
...@@ -148,7 +148,7 @@ set(PYLINPHONE_LDFLAGS "") ...@@ -148,7 +148,7 @@ set(PYLINPHONE_LDFLAGS "")
if(APPLE) if(APPLE)
set(PYLINPHONE_LDFLAGS "${LINPHONE_LDFLAGS_STR} -undefined dynamic_lookup") set(PYLINPHONE_LDFLAGS "${LINPHONE_LDFLAGS_STR} -undefined dynamic_lookup")
endif() endif()
if(NOT "${PYLINPHONE_LDFLAGS}" STREQUAL "") if(PYLINPHONE_LDFLAGS)
set_target_properties(pylinphone PROPERTIES LINK_FLAGS "${PYLINPHONE_LDFLAGS}") set_target_properties(pylinphone PROPERTIES LINK_FLAGS "${PYLINPHONE_LDFLAGS}")
endif() endif()
set_target_properties(pylinphone PROPERTIES OUTPUT_NAME linphone PREFIX "" SUFFIX "${PY_MODULE_EXT}") set_target_properties(pylinphone PROPERTIES OUTPUT_NAME linphone PREFIX "" SUFFIX "${PY_MODULE_EXT}")
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
if(MSVC) if(MSVC)
string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}") string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" MSVC_VERSION "${CMAKE_GENERATOR}")
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
find_file(MSVCR_LIB msvcr${MSVC_VERSION}0d.dll PATHS "C:/Windows/System32") find_file(MSVCR_LIB msvcr${MSVC_VERSION}0d.dll PATHS "C:/Windows/System32")
else() else()
find_file(MSVCR_LIB msvcr${MSVC_VERSION}0.dll PATHS "C:/Windows/System32") find_file(MSVCR_LIB msvcr${MSVC_VERSION}0.dll PATHS "C:/Windows/System32")
...@@ -45,7 +45,7 @@ if(UNIX AND NOT APPLE) ...@@ -45,7 +45,7 @@ if(UNIX AND NOT APPLE)
else() else()
file(COPY ${LINPHONE_DYNAMIC_LIBRARIES_TO_INSTALL} DESTINATION "${OUTPUT_DIR}/linphone") file(COPY ${LINPHONE_DYNAMIC_LIBRARIES_TO_INSTALL} DESTINATION "${OUTPUT_DIR}/linphone")
endif() endif()
if(MSVC AND NOT "${MSVC_VERSION}" STREQUAL "9") if(MSVC AND NOT MSVC_VERSION STREQUAL "9")
file(COPY ${MSVCR_LIB} DESTINATION "${OUTPUT_DIR}/linphone") file(COPY ${MSVCR_LIB} DESTINATION "${OUTPUT_DIR}/linphone")
endif() endif()
get_filename_component(LINPHONE_PYTHON_MODULE_PATH "${LINPHONE_PYTHON_MODULE}" DIRECTORY) get_filename_component(LINPHONE_PYTHON_MODULE_PATH "${LINPHONE_PYTHON_MODULE}" DIRECTORY)
...@@ -63,7 +63,7 @@ file(COPY "${LINPHONE_SOURCE_DIR}/tester/rcfiles" DESTINATION "${OUTPUT_DIR}/lin ...@@ -63,7 +63,7 @@ file(COPY "${LINPHONE_SOURCE_DIR}/tester/rcfiles" DESTINATION "${OUTPUT_DIR}/lin
file(COPY "${LINPHONE_SOURCE_DIR}/tester/sounds" DESTINATION "${OUTPUT_DIR}/linphone/unittests/") file(COPY "${LINPHONE_SOURCE_DIR}/tester/sounds" DESTINATION "${OUTPUT_DIR}/linphone/unittests/")
file(COPY "${LINPHONE_SOURCE_DIR}/tester/tester_hosts" DESTINATION "${OUTPUT_DIR}/linphone/unittests/") file(COPY "${LINPHONE_SOURCE_DIR}/tester/tester_hosts" DESTINATION "${OUTPUT_DIR}/linphone/unittests/")
file(GLOB_RECURSE LINPHONE_DATA_FILES RELATIVE "${OUTPUT_DIR}/linphone" "${OUTPUT_DIR}/linphone/*") file(GLOB_RECURSE LINPHONE_DATA_FILES RELATIVE "${OUTPUT_DIR}/linphone" "${OUTPUT_DIR}/linphone/*")
if("${PACKAGE_TYPE}" STREQUAL "msi") if(PACKAGE_TYPE STREQUAL "msi")
set(BUILD_VERSION ${LINPHONE_VERSION}) set(BUILD_VERSION ${LINPHONE_VERSION})
else() else()
set(BUILD_VERSION ${LINPHONE_GIT_REVISION}) set(BUILD_VERSION ${LINPHONE_GIT_REVISION})
......