update cmake config file

update cmake config file

Signed-off-by: Ronan Le Martret <18c24d1e59fd6c0a745b9d66ccd59271e1af72fe@iot.bzh>

--- conf.d/cmake/config.cmake
+++ conf.d/cmake/config.cmake
@@ -61,8 +61,9 @@
 # -----------------------------
 set (PKG_REQUIRED_LIST
 	json-c
-	libsystemd
+	libsystemd>=222
 	afb-daemon
+	libmicrohttpd>=0.9.55
 )

 # Static constante definition
@@ -76,7 +77,7 @@
 # Print a helper message when every thing is finished
 # ----------------------------------------------------
 set(CLOSING_MESSAGE "Test with: afb-daemon --rootdir=\$\$(pwd)/package --ldpaths=\$\$(pwd)/package/lib --port=1234 --roothttp=\$\$(pwd)/package/htdocs --tracereq=common --token=\"1\" --verbose")
-set(WIDGET_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
+set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")

 # (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable]
 # ---------------------------------------------------------------------
@@ -88,24 +89,27 @@
 # -----------------------------------
 set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in)

-# Mandatory widget Mimetype specification
-# --------------------------------------------------
+# Mandatory widget Mimetype specification of the main unit
+# --------------------------------------------------------------------------
 # Choose between :
-# - application/vnd.agl.service
-# - application/vnd.agl.native
-# - application/x-executable
-# - text/html
+#- text/html : HTML application,
+#	content.src designates the home page of the application
 #
-set(WIDGET_TYPE application/vnd.agl.service)
+#- application/vnd.agl.native : AGL compatible native,
+#	content.src designates the relative path of the binary.
+#
+# - application/vnd.agl.service: AGL service, content.src is not used.
+#
+#- ***application/x-executable***: Native application,
+#	content.src designates the relative path of the binary.
+#	For such application, only security setup is made.
+#
+set(WIDGET_TYPE MimeType_Not_Set)

-# Mandatory Widget entry point file.
-# ----------------------------------------------------
-# This is the file that will be executed, loaded,...
-# at launch time by the application framework
-#
-# !IMPORTANT! : Service Widget Mimetype has to specified
-# the WIDGET_ENTRY_POINT can then be any file
-# "config.xml" is a good choice as always present and constant
+# Mandatory Widget entry point file of the main unit
+# --------------------------------------------------------------
+# This is the file that will be executed, loaded,
+# at launch time by the application framework.
 #
 set(WIDGET_ENTRY_POINT config.xml)


Support Ninja generator for MSVC

Support Ninja generator for MSVC

--- conan.cmake
+++ conan.cmake
@@ -2,114 +2,131 @@

 function(_get_msvc_ide_version result)
     set(${result} "" PARENT_SCOPE)
-    if(CMAKE_VS_PLATFORM_TOOLSET)
-        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_VS_PLATFORM_TOOLSET}")
-        list(GET output 0 _toolset_version)
-        if(_toolset_version LESS 142)
-            if ("${_toolset_version}" EQUAL "141")
-                set(_msvc_version "15")
+    if(${CMAKE_GENERATOR} STREQUAL "Ninja")
+        string(REGEX MATCHALL "[0-9]+" output "$ENV{VisualStudioVersion}")
+        list(GET output 0 _msvc_version)
+        set(${result} ${_msvc_version} PARENT_SCOPE)
+    else()
+        if(CMAKE_VS_PLATFORM_TOOLSET)
+            string(REGEX MATCHALL "[0-9]+" output "${CMAKE_VS_PLATFORM_TOOLSET}")
+            list(GET output 0 _toolset_version)
+            if(_toolset_version LESS 142)
+                if ("${_toolset_version}" EQUAL "141")
+                    set(_msvc_version "15")
+                else()
+                    string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
+                endif()
+                set(${result} ${_msvc_version} PARENT_SCOPE)
+                return()
             else()
-                string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
+                message(STATUS "Conan **WARNING** : Unknown MSVC toolset ${_toolset_version}")
             endif()
-            set(${result} ${_msvc_version} PARENT_SCOPE)
-            return()
-        else()
-            message(STATUS "Conan **WARNING** : Unknown MSVC toolset ${_toolset_version}")
-        endif()
-    endif()
-
-    string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
-    list(GET output 0 _msvc_version)
-    set(${result} ${_msvc_version} PARENT_SCOPE)
+        endif()
+
+        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
+        list(GET output 0 _msvc_version)
+        set(${result} ${_msvc_version} PARENT_SCOPE)
+    endif()
 endfunction()

 function(conan_cmake_settings result)
-  #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER})
-  #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER_ID})
-  #message(STATUS "VERSION " ${CMAKE_CXX_COMPILER_VERSION})
-  # message(STATUS "FLAGS " ${CMAKE_LANG_FLAGS})
-  #message(STATUS "LIB ARCH " ${CMAKE_CXX_LIBRARY_ARCHITECTURE})
-  #message(STATUS "BUILD TYPE " ${CMAKE_BUILD_TYPE})
-  #message(STATUS "GENERATOR " ${CMAKE_GENERATOR})
-  #message(STATUS "GENERATOR WIN64 " ${CMAKE_CL_64})
-
-  message(STATUS "Conan ** WARNING** : This detection of settings from cmake is experimental and incomplete. "
-                  "Please check 'conan.cmake' and contribute")
-
-  if(CONAN_CMAKE_MULTI)
-    set(_SETTINGS -g cmake_multi)
-  else()
-    set(_SETTINGS -g cmake)
-  endif()
-  if(CMAKE_BUILD_TYPE)
-    set(_SETTINGS ${_SETTINGS} -s build_type=${CMAKE_BUILD_TYPE})
-  else()
-    message(FATAL_ERROR "Please specify in command line CMAKE_BUILD_TYPE (-DCMAKE_BUILD_TYPE=Release)")
-  endif()
-
-  #handle -s os setting
-  if(CMAKE_SYSTEM_NAME)
-  #use default conan os setting if CMAKE_SYSTEM_NAME is not defined
-    set(CONAN_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
-    if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-        set(CONAN_SYSTEM_NAME Macos)
-    endif()
-    set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD)
-    list (FIND CONAN_SUPPORTED_PLATFORMS "${CONAN_SYSTEM_NAME}" _index)
-    if (${_index} GREATER -1)
-    #check if the cmake system is a conan supported one
-      set(_SETTINGS ${_SETTINGS} -s os=${CONAN_SYSTEM_NAME})
-    else()
-      message(FATAL_ERROR "cmake system ${CONAN_SYSTEM_NAME} is not supported by conan. Use one of ${CONAN_SUPPORTED_PLATFORMS}")
-    endif()
-  endif()
-
-  if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
-    # using GCC
-    # TODO: Handle other params
-    string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
-    list(GET VERSION_LIST 0 MAJOR)
-    list(GET VERSION_LIST 1 MINOR)
-    conan_cmake_detect_gnu_libcxx(_LIBCXX)
-    set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})
-  elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
-      # using AppleClang
-      string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
-      list(GET VERSION_LIST 0 MAJOR)
-      list(GET VERSION_LIST 1 MINOR)
-      set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
-  elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
-      # using Clang
-      string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
-      list(GET VERSION_LIST 0 MAJOR)
-      list(GET VERSION_LIST 1 MINOR)
-      set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
-  elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
-      set(_VISUAL "Visual Studio")
-      _get_msvc_ide_version(_VISUAL_VERSION)
-      if("${_VISUAL_VERSION}" STREQUAL "")
-          message(FATAL_ERROR "Visual Studio not recognized")
-      else()
-          set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=${_VISUAL_VERSION})
-      endif()
-
-      if(${CMAKE_GENERATOR} MATCHES "Win64")
-          set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-      elseif (${CMAKE_GENERATOR} MATCHES "ARM")
-          message(STATUS "Conan: Using default ARM architecture from MSVC")
-          set(_SETTINGS ${_SETTINGS} -s arch=armv6)
-      else()
-          set(_SETTINGS ${_SETTINGS} -s arch=x86)
-      endif()
-
-    conan_cmake_detect_vs_runtime(_vs_runtime)
-    message(STATUS "Detected VS runtime: ${_vs_runtime}")
-    set(_SETTINGS ${_SETTINGS} -s compiler.runtime=${_vs_runtime})
-  else()
-      message(FATAL_ERROR "Conan: compiler setup not recognized")
-  endif()
-
-  set(${result} ${_SETTINGS} PARENT_SCOPE)
+    #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER})
+    #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER_ID})
+    #message(STATUS "VERSION " ${CMAKE_CXX_COMPILER_VERSION})
+    #message(STATUS "FLAGS " ${CMAKE_LANG_FLAGS})
+    #message(STATUS "LIB ARCH " ${CMAKE_CXX_LIBRARY_ARCHITECTURE})
+    #message(STATUS "BUILD TYPE " ${CMAKE_BUILD_TYPE})
+    #message(STATUS "GENERATOR " ${CMAKE_GENERATOR})
+    #message(STATUS "GENERATOR WIN64 " ${CMAKE_CL_64})
+
+    message(STATUS "Conan ** WARNING** : This detection of settings from cmake is experimental and incomplete. "
+                    "Please check 'conan.cmake' and contribute")
+
+    if(CONAN_CMAKE_MULTI)
+        set(_SETTINGS -g cmake_multi)
+    else()
+        set(_SETTINGS -g cmake)
+    endif()
+    if(CMAKE_BUILD_TYPE)
+        set(_SETTINGS ${_SETTINGS} -s build_type=${CMAKE_BUILD_TYPE})
+    else()
+        message(FATAL_ERROR "Please specify in command line CMAKE_BUILD_TYPE (-DCMAKE_BUILD_TYPE=Release)")
+    endif()
+
+    #handle -s os setting
+    if(CMAKE_SYSTEM_NAME)
+    #use default conan os setting if CMAKE_SYSTEM_NAME is not defined
+        set(CONAN_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
+        if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+            set(CONAN_SYSTEM_NAME Macos)
+        endif()
+        set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD)
+        list (FIND CONAN_SUPPORTED_PLATFORMS "${CONAN_SYSTEM_NAME}" _index)
+        if (${_index} GREATER -1)
+            #check if the cmake system is a conan supported one
+            set(_SETTINGS ${_SETTINGS} -s os=${CONAN_SYSTEM_NAME})
+        else()
+            message(FATAL_ERROR "cmake system ${CONAN_SYSTEM_NAME} is not supported by conan. Use one of ${CONAN_SUPPORTED_PLATFORMS}")
+        endif()
+    endif()
+
+    if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
+        # using GCC
+        # TODO: Handle other params
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        list(GET VERSION_LIST 0 MAJOR)
+        list(GET VERSION_LIST 1 MINOR)
+        conan_cmake_detect_gnu_libcxx(_LIBCXX)
+        set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})
+    elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
+        # using AppleClang
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        list(GET VERSION_LIST 0 MAJOR)
+        list(GET VERSION_LIST 1 MINOR)
+        set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
+    elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+        # using Clang
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        list(GET VERSION_LIST 0 MAJOR)
+        list(GET VERSION_LIST 1 MINOR)
+        set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
+    elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
+        set(_VISUAL "Visual Studio")
+        _get_msvc_ide_version(_VISUAL_VERSION)
+        if("${_VISUAL_VERSION}" STREQUAL "")
+            message(FATAL_ERROR "Visual Studio not recognized")
+        else()
+            set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=${_VISUAL_VERSION})
+        endif()
+
+        if(${CMAKE_GENERATOR} STREQUAL "Ninja")
+            if($ENV{Platform} STREQUAL "X64")
+                set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
+            elseif($ENV{Platform} STREQUAL "ARM")
+                message(STATUS "Conan: Using default ARM architecture from MSVC")
+                set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+            else()
+                set(_SETTINGS ${_SETTINGS} -s arch=x86)
+            endif()
+        else()
+            if(${CMAKE_GENERATOR} MATCHES "Win64")
+                set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
+            elseif (${CMAKE_GENERATOR} MATCHES "ARM")
+                message(STATUS "Conan: Using default ARM architecture from MSVC")
+                set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+            else()
+                set(_SETTINGS ${_SETTINGS} -s arch=x86)
+            endif()
+        endif()
+
+        conan_cmake_detect_vs_runtime(_vs_runtime)
+        message(STATUS "Detected VS runtime: ${_vs_runtime}")
+        set(_SETTINGS ${_SETTINGS} -s compiler.runtime=${_vs_runtime})
+    else()
+        message(FATAL_ERROR "Conan: compiler setup not recognized")
+    endif()
+
+    set(${result} ${_SETTINGS} PARENT_SCOPE)
 endfunction()

@@ -199,7 +216,7 @@
     execute_process(COMMAND ${conan_command} ${conan_args}
                      RESULT_VARIABLE return_code
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
+
     if(NOT "${return_code}" STREQUAL "0")
       message(FATAL_ERROR "Conan install failed='${return_code}'")
     endif()


update

update

--- modules/capnproto.cmake
+++ modules/capnproto.cmake
@@ -9,6 +9,9 @@

   # Module subdirectory
   add_subdirectory("capnproto")
+
+  # Cygwin workaround: https://github.com/capnproto/capnproto/pull/696
+  set_target_properties(kj PROPERTIES INTERFACE_COMPILE_FEATURES "")

   # Module folder
   set_target_properties(capnp PROPERTIES FOLDER modules/capnproto)


Fix check tests being disabled when cross compiling. (#6962)

@antiagainst noticed that https://github.com/google/iree/pull/6352 accidently disabled our check tests when cross compiling on the https://buildkite.com/iree/iree-android-arm64-v8a pipeline.

Before: https://buildkite.com/iree/iree-android-arm64-v8a/builds/4550
After: https://buildkite.com/iree/iree-android-arm64-v8a/builds/4551

That PR forced `IREE_TARGET_BACKENDS_TO_BUILD` to an empty list when `IREE_BUILD_COMPILER` is off, which led to overly aggressive filtering in `iree_check_test.cmake`.

--- build_tools/cmake/iree_check_test.cmake
+++ build_tools/cmake/iree_check_test.cmake
@@ -229,8 +229,16 @@
   if(NOT DEFINED IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
     message(SEND_ERROR "Unknown backend '${_RULE_TARGET_BACKEND}'. Check IREE_ALL_TARGET_BACKENDS.")
   endif()
-  if(NOT IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
-    return()
+  if(DEFINED IREE_HOST_BINARY_ROOT)
+    # If we're not building the host tools from source under this configuration,
+    # such as when cross compiling, then we can't easily check for which
+    # compiler target backends are enabled. Just assume all are enabled and only
+    # rely on the runtime HAL driver check above for filtering.
+  else()
+    # We are building the host tools, so check enabled compiler target backends.
+    if(NOT IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
+      return()
+    endif()
   endif()

   foreach(_SRC IN LISTS _RULE_SRCS)


silence warning that breaks default GCC 5.x build

--- cmake/gcc.cmake
+++ cmake/gcc.cmake
@@ -14,7 +14,7 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-strict-aliasing  -std=c++11")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-strict-aliasing  -std=c++11 -Wno-narrowing")
 SET(CMAKE_CXX_FLAGS_DEBUG          "-DDEBUG  -g     -Wstrict-aliasing=1")
 SET(CMAKE_CXX_FLAGS_RELEASE        "-DNDEBUG    -O3 -Wstrict-aliasing=1 -ffast-math ")
 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -g -O3 -Wstrict-aliasing=1 -ffast-math ")


v2x: Rename test function.

v2x: Rename test function.

Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>

--- utils/vlog/tests/v2x_tests.cmake
+++ utils/vlog/tests/v2x_tests.cmake
@@ -1,9 +1,9 @@
 # Creating new target to call all the added tests
 add_custom_target(all_v2x_tests ALL)

-function(V2X_GENERIC_TEST)
+function(V2X_TEST_GENERIC)
   # ~~~
-  # V2X_GENERIC_TEST(
+  # V2X_TEST_GENERIC(
   #   NAME name
   #   TYPE pb_type | model
   #   )
@@ -18,19 +18,19 @@
   #
   # In addition it adds the newly created target to the `all_v2x_tests` dependencies. (all tests will be performed with `make all_v2x_tests`)
   #
-  # Usage: v2x_generic_test(NAME <test_name> TYPE <model|pb_type>) (All fields are required)
+  # Usage: v2x_test_generic(NAME <test_name> TYPE <model|pb_type>) (All fields are required)

   set(oneValueArgs NAME TYPE)
   cmake_parse_arguments(
-    V2X_GENERIC_TEST
+    V2X_TEST_GENERIC
     "${options}"
     "${oneValueArgs}"
     "${multiValueArgs}"
     ${ARGN}
   )

-  set(TYPE ${V2X_GENERIC_TEST_TYPE})
-  set(NAME ${V2X_GENERIC_TEST_NAME})
+  set(TYPE ${V2X_TEST_GENERIC_TYPE})
+  set(NAME ${V2X_TEST_GENERIC_NAME})

   # pb_type checking
   set(GOLDEN_XML golden.${TYPE}.xml)
@@ -51,7 +51,7 @@
     POST_BUILD
     COMMAND cp ${ACTUAL_XML} ${CMAKE_CURRENT_SOURCE_DIR}/golden.${TYPE}.xml
     )
-endfunction(V2X_GENERIC_TEST)
+endfunction(V2X_TEST_GENERIC)

 function(V2X_TEST_MODEL)
   # ~~~
@@ -61,7 +61,7 @@
   #   )
   # ~~~
   #
-  # This function is to test only the model XML generation. It will call V2X_GENERIC_TEST with the field TYPE set to `model`.
+  # This function is to test only the model XML generation. It will call V2X_TEST_GENERIC with the field TYPE set to `model`.
   #
   # NAME name of the test.
   # TOP_MODULE name of the top verilog module that has to be tested.
@@ -83,7 +83,7 @@
   set(SRC ${NAME}.sim.v)
   v2x(NAME ${NAME} SRCS ${SRC} TOP_MODULE ${TOP_MODULE})

-  v2x_generic_test(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE model)
+  v2x_test_generic(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE model)

   add_custom_target(${NAME}_diff ALL DEPENDS ${NAME}_model_diff)
 endfunction(V2X_TEST_MODEL)
@@ -96,7 +96,7 @@
   #   )
   # ~~~
   #
-  # This function is to test only the pb_type XML generation. It will call V2X_GENERIC_TEST with the field TYPE set to `pb_type`
+  # This function is to test only the pb_type XML generation. It will call V2X_TEST_GENERIC with the field TYPE set to `pb_type`
   #
   # NAME name of the test.
   # TOP_MODULE name of the top verilog module that has to be tested.
@@ -118,7 +118,7 @@
   set(SRC ${NAME}.sim.v)
   v2x(NAME ${NAME} SRCS ${SRC} TOP_MODULE ${TOP_MODULE})

-  v2x_generic_test(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE pb_type)
+  v2x_test_generic(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE pb_type)

   add_custom_target(${NAME}_diff ALL DEPENDS ${NAME}_pb_type_diff)
 endfunction(V2X_TEST_PB_TYPE)
@@ -131,7 +131,7 @@
   #   )
   # ~~~
   #
-  # This function is to test both the pb_type XML generation. It will call V2X_GENERIC_TEST multiple times first with the field TYPE set to `pb_type`
+  # This function is to test both the pb_type XML generation. It will call V2X_TEST_GENERIC multiple times first with the field TYPE set to `pb_type`
   # then with `model`
   #
   # NAME name of the test.
@@ -154,8 +154,8 @@
   set(SRC ${NAME}.sim.v)
   v2x(NAME ${NAME} SRCS ${SRC} TOP_MODULE ${TOP_MODULE})

-  v2x_generic_test(NAME ${NAME} TOP_MODULE ${MODULE} TYPE pb_type)
-  v2x_generic_test(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE model)
+  v2x_test_generic(NAME ${NAME} TOP_MODULE ${MODULE} TYPE pb_type)
+  v2x_test_generic(NAME ${NAME} TOP_MODULE ${TOP_MODULE} TYPE model)
   vpr_test_pbtype(NAME ${NAME})

   add_custom_target(${NAME}_diff ALL DEPENDS ${NAME}_pb_type_diff ${NAME}_model_diff)


Fix Ansible client tests dependencies

Fix Ansible client tests dependencies

Since ansible_client_test_vagrant_up is defined first, this has been
working on accident. Additionally since DEPENDS in CTest is more of a
sort than anything, this was never triggering an error despite there not
being a vagrant_up test.

--- devops/ansible_vagrant.cmake
+++ devops/ansible_vagrant.cmake
@@ -16,7 +16,7 @@
     )

   set_tests_properties("${name}" PROPERTIES
-    DEPENDS vagrant_up
+    DEPENDS ansible_client_test_vagrant_up
     RUN_SERIAL ON
     ENVIRONMENT "${VAGRANT_ENV_VARS}"
     # This happens in the case where vagrant up fails, failing to generate a valid host file.


Fixed LFS support on unix.

Fixed LFS support on unix.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -13,31 +13,6 @@
       add_definitions(-fPIC)
     endif (WITH_FPIC)

-    if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-      # with large file support
-      execute_process(
-        COMMAND
-          getconf LFS64_CFLAGS
-        OUTPUT_VARIABLE
-          _lfs_CFLAGS
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    else (CMAKE_SIZEOF_VOID_P MATCHES "8")
-      # with large file support
-      execute_process(
-        COMMAND
-          getconf LFS_CFLAGS
-        OUTPUT_VARIABLE
-          _lfs_CFLAGS
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-      string(REGEX REPLACE "[\r\n]" " " "${_lfs_CFLAGS}" "${${_lfs_CFLAGS}}")
-
-      add_definitions(${_lfs_CFLAGS})
-    endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
-
     check_c_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
     if (WITH_STACK_PROTECTOR)
       add_definitions(-fstack-protector)
@@ -49,6 +24,31 @@
     endif (WITH_FORTIFY_SOURCE)

   endif (CMAKE_COMPILER_IS_GNUCC)
+
+  if (CMAKE_SIZEOF_VOID_P MATCHES "8")
+   # with large file support
+   execute_process(
+     COMMAND
+       getconf LFS64_CFLAGS
+     OUTPUT_VARIABLE
+       _lfs_CFLAGS
+     ERROR_QUIET
+     OUTPUT_STRIP_TRAILING_WHITESPACE
+   )
+ else (CMAKE_SIZEOF_VOID_P MATCHES "8")
+   # with large file support
+   execute_process(
+     COMMAND
+       getconf LFS_CFLAGS
+     OUTPUT_VARIABLE
+       _lfs_CFLAGS
+     ERROR_QUIET
+     OUTPUT_STRIP_TRAILING_WHITESPACE
+   )
+ endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ string(REGEX REPLACE "[\r\n]" " " "${_lfs_CFLAGS}" "${${_lfs_CFLAGS}}")
+ add_definitions(${_lfs_CFLAGS})
+
 endif (UNIX AND NOT WIN32)

 # suppress warning about "deprecated" functions


cmake: AVX512 with clang

cmake: AVX512 with clang

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -223,7 +223,7 @@
     ocv_update(CPU_SSSE3_FLAGS_ON "-mssse3")
     ocv_update(CPU_SSE2_FLAGS_ON "-msse2")
     ocv_update(CPU_SSE_FLAGS_ON "-msse")
-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
+    if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0"))  # GCC >= 5.0
       # -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi
       ocv_update(CPU_AVX_512F_FLAGS_ON "-mavx512f")
       ocv_update(CPU_AVX512_SKX_FLAGS_ON "-mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq")


cmake: toolchain_cc_imacros: don't use the long argument form

Commit f57ba2d30c2d ("cmake: toolchain_cc_imacros: don't use space
separated arguments") moved toolchain_cc_imacros() to using the long
argument format in order to avoid spaces that CMake uses to delimitate
and deduplicate arguments.

It seems that xcc doesn't support the --imacros=foo form. However
it does support the short "combined" -imacrosfoo form (without space).
So let's use that instead and document the caviat.

Signed-off-by: Nicolas Pitre <76342682d5afc62854e1102d9578521fe1ed6813@baylibre.com>

--- cmake/compiler/gcc/target_imacros.cmake
+++ cmake/compiler/gcc/target_imacros.cmake
@@ -4,6 +4,12 @@

 macro(toolchain_cc_imacros header_file)

-  zephyr_compile_options(--imacros=${header_file})
+  # We cannot use the "-imacros foo" form here as CMake insists on
+  # deduplicating arguments, meaning that subsequent usages after the
+  # first one will see the "-imacros " part removed.
+  # gcc and clang support the "--imacros=foo" form but not xcc.
+  # Let's use the "combined" form (without space) which is supported
+  # by everyone so far.
+  zephyr_compile_options(-imacros${header_file})

 endmacro()


Added llvm version 3.6.2

Added llvm version 3.6.2

--- cmake/Modules/FindLibClang.cmake
+++ cmake/Modules/FindLibClang.cmake
@@ -14,7 +14,8 @@
 #               Known LLVM release numbers.

 # most recent versions come first
-set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.6.1
+set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.6.2
+  3.6.1
   3.6
   3.5.1
   3.5.0                   #Arch Linux


cmake: update SwiftSupport from XCTest

cmake: update SwiftSupport from XCTest

Update the swift support CMake rules from XCTest.  This adds support for
additional features like partial module compilation which improves
incremental builds.  It allows for executable and library builds.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -1,49 +1,55 @@

 include(CMakeParseArguments)

-function(add_swift_library library)
-  set(options)
+function(add_swift_target target)
+  set(options LIBRARY)
   set(single_value_options MODULE_NAME;MODULE_LINK_NAME;MODULE_PATH;MODULE_CACHE_PATH;OUTPUT;TARGET)
-  set(multiple_value_options SOURCES;SWIFT_FLAGS;CFLAGS;DEPENDS)
+  set(multiple_value_options CFLAGS;DEPENDS;LINK_FLAGS;SOURCES;SWIFT_FLAGS)

-  cmake_parse_arguments(ASL "${options}" "${single_value_options}" "${multiple_value_options}" ${ARGN})
+  cmake_parse_arguments(AST "${options}" "${single_value_options}" "${multiple_value_options}" ${ARGN})

   set(flags ${CMAKE_SWIFT_FLAGS})
+  set(link_flags)

-  list(APPEND flags -emit-library)
-
-  if(ASL_TARGET)
-    list(APPEND FLAGS -target;${ASL_TARGET})
+  if(AST_TARGET)
+    list(APPEND flags -target;${AST_TARGET})
   endif()
-  if(ASL_MODULE_NAME)
-    list(APPEND flags -module-name;${ASL_MODULE_NAME})
+  if(AST_MODULE_NAME)
+    list(APPEND flags -module-name;${AST_MODULE_NAME})
+  else()
+    list(APPEND flags -module-name;${target})
   endif()
-  if(ASL_MODULE_LINK_NAME)
-    list(APPEND flags -module-link-name;${ASL_MODULE_LINK_NAME})
+  if(AST_MODULE_LINK_NAME)
+    list(APPEND flags -module-link-name;${AST_MODULE_LINK_NAME})
   endif()
-  if(ASL_MODULE_PATH)
-    list(APPEND flags -emit-module-path;${ASL_MODULE_PATH})
+  if(AST_MODULE_CACHE_PATH)
+    list(APPEND flags -module-cache-path;${AST_MODULE_CACHE_PATH})
   endif()
-  if(ASL_MODULE_CACHE_PATH)
-    list(APPEND flags -module-cache-path;${ASL_MODULE_CACHE_PATH})
-  endif()
-  if(ASL_SWIFT_FLAGS)
-    foreach(flag ${ASL_SWIFT_FLAGS})
+  if(AST_SWIFT_FLAGS)
+    foreach(flag ${AST_SWIFT_FLAGS})
       list(APPEND flags ${flag})
     endforeach()
   endif()
-  if(ASL_CFLAGS)
-    foreach(flag ${ASL_CFLAGS})
+  if(AST_CFLAGS)
+    foreach(flag ${AST_CFLAGS})
       list(APPEND flags -Xcc;${flag})
     endforeach()
   endif()
-
-  # FIXME: We shouldn't /have/ to build things in a single process.
-  # <rdar://problem/15972329>
-  list(APPEND flags -force-single-frontend-invocation)
+  if(AST_LINK_FLAGS)
+    foreach(flag ${AST_LINK_FLAGS})
+      list(APPEND link_flags ${flag})
+    endforeach()
+  endif()
+  if(NOT AST_OUTPUT)
+    if(AST_LIBRARY)
+      set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+    else()
+      set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${target}${CMAKE_EXECUTABLE_SUFFIX})
+    endif()
+  endif()

   set(sources)
-  foreach(source ${ASL_SOURCES})
+  foreach(source ${AST_SOURCES})
     get_filename_component(location ${source} PATH)
     if(IS_ABSOLUTE ${location})
       list(APPEND sources ${source})
@@ -52,25 +58,77 @@
     endif()
   endforeach()

-  get_filename_component(module_directory ${ASL_MODULE_PATH} DIRECTORY)
+  set(objs)
+  set(mods)
+  set(docs)
+  set(i 0)
+  foreach(source ${sources})
+    get_filename_component(name ${source} NAME)

+    set(obj ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${name}${CMAKE_C_OUTPUT_EXTENSION})
+    set(mod ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${name}.swiftmodule)
+    set(doc ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${name}.swiftdoc)
+
+    set(all_sources ${sources})
+    list(INSERT all_sources ${i} -primary-file)
+
+    add_custom_command(OUTPUT
+                         ${obj}
+                         ${mod}
+                         ${doc}
+                       DEPENDS
+                         ${source}
+                       COMMAND
+                         ${CMAKE_SWIFT_COMPILER} -frontend ${flags} -emit-module-path ${mod} -emit-module-doc-path ${doc} -o ${obj} -c ${all_sources})
+
+    list(APPEND objs ${obj})
+    list(APPEND mods ${mod})
+    list(APPEND docs ${doc})
+
+    math(EXPR i "${i}+1")
+  endforeach()
+
+  if(AST_LIBRARY)
+    get_filename_component(module_directory ${AST_MODULE_PATH} DIRECTORY)
+
+    set(module ${AST_MODULE_PATH})
+    set(documentation ${module_directory}/${AST_MODULE_NAME}.swiftdoc)
+
+    add_custom_command(OUTPUT
+                         ${module}
+                         ${documentation}
+                       DEPENDS
+                         ${mods}
+                         ${docs}
+                       COMMAND
+                         ${CMAKE_SWIFT_COMPILER} -frontend ${flags} -sil-merge-partial-modules -emit-module ${mods} -o ${module} -emit-module-doc-path ${documentation})
+  endif()
+
+  if(AST_LIBRARY)
+    set(emit_library -emit-library)
+  endif()
   add_custom_command(OUTPUT
-                       ${ASL_OUTPUT}
-                       ${ASL_MODULE_PATH}
-                       ${module_directory}/${ASL_MODULE_NAME}.swiftdoc
+                       ${AST_OUTPUT}
                      DEPENDS
-                       ${ASL_SOURCES}
-                       ${CMAKE_SWIFT_COMPILER}
-                       ${ASL_DEPENDS}
+                       ${objs}
                      COMMAND
-                       ${CMAKE_COMMAND} -E make_directory ${module_directory}
+                       ${CMAKE_SWIFT_COMPILER} ${emit_library} ${link_flags} -o ${AST_OUTPUT} ${objs}
                      COMMAND
-                       ${CMAKE_SWIFT_COMPILER} ${flags} -c ${sources} -o ${ASL_OUTPUT})
-  add_custom_target(${library}
+                       ${CMAKE_COMMAND} -E copy ${AST_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR})
+  add_custom_target(${target}
+                    ALL
                     DEPENDS
-                       ${ASL_OUTPUT}
-                       ${ASL_MODULE_PATH}
-                       ${module_directory}/${ASL_MODULE_NAME}.swiftdoc)
+                       ${AST_OUTPUT}
+                       ${module}
+                       ${documentation})
+endfunction()
+
+function(add_swift_library library)
+  add_swift_target(${library} LIBRARY ${ARGN})
+endfunction()
+
+function(add_swift_executable executable)
+  add_swift_target(${executable} ${ARGN})
 endfunction()

 # Returns the current achitecture name in a variable


compiler checks work for visual studio mex argument processing starting to work for visual studio (still need to handle all the arguments)

--- cmake/mex.cmake
+++ cmake/mex.cmake
@@ -4,12 +4,24 @@
 #cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

 macro(get_mex_option option)
-  # writes MEX_${option}
-
+  # usage: get_mex_option(option [, option_name])
+  # writes MEX_${option_name}
+  if ( ${ARGC} GREATER 1 )
+    set(option_name ${ARGV1})
+  else()
+    set(option_name ${option})
+  endif()
+
   # todo: do the string parsing using CMAKE commands to make it less platform dependent
   execute_process(COMMAND ${mex} -v COMMAND grep ${option} COMMAND head -n 1 COMMAND cut -d "=" -f2 OUTPUT_VARIABLE value ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(STRIP ${value} svalue)
-  set(MEX_${option} ${svalue} PARENT_SCOPE)
+  if ( NOT value )
+    message(WARNING "Could not find MEX_${option_name} using mex -v")
+  else()
+    string(STRIP ${value} svalue)
+    set(MEX_${option_name} ${svalue} PARENT_SCOPE)
+  endif()
+
+  message(STATUS "MEX_${option_name} = ${svalue}")
 endmacro()

 macro(get_mex_arguments afterstring)
@@ -28,28 +40,24 @@
   if ( NOT matlab )
      message(FATAL_ERROR "Could not find matlab executable")
   endif()
-  if ( CYGWIN )
+  if ( WIN32 )
     # matlab -n is not supported on windows (asked matlab for a work-around)
     get_filename_component(_matlab_root ${matlab} PATH)
     get_filename_component(_matlab_root ${_matlab_root} PATH)
-#  elseif ( WIN32 )
-#    execute_process(COMMAND ${matlab} -nosplash -nojvm -r "h=fopen('.matlabroot','w'); fprintf(h,'MATLAB = %s\\n',matlabroot); fclose(h); exit" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-#    execute_process(COMMAND grep -e "MATLAB \\+=" ${CMAKE_BINARY_DIR}/.matlabroot COMMAND cut -d "=" -f2 OUTPUT_VARIABLE _matlab_root)
   else()
     execute_process(COMMAND ${matlab} -n COMMAND grep -e "MATLAB \\+=" COMMAND cut -d "=" -f2 OUTPUT_VARIABLE _matlab_root)
   endif()
   if (NOT _matlab_root)
-    message(FATAL_ERROR "Failed to extract MATLAB_ROOT from running matlab -n")
+    message(FATAL_ERROR "Failed to extract MATLAB_ROOT")
   endif()
   string(STRIP ${_matlab_root} MATLAB_ROOT)

-  if ( CYGWIN )
-    find_program(mexext mexext.bat PATHS ${MATLAB_ROOT}/bin)
-    find_program(mex mex.bat PATHS ${MATLAB_ROOT}/bin)
-  else ()
-    find_program(mexext mexext PATHS ${MATLAB_ROOT}/bin)
-    find_program(mex mex PATHS ${MATLAB_ROOT}/bin)
-  endif()
+  find_program(mex NAMES mex mex.bat HINTS ${MATLAB_ROOT}/bin)
+  if (NOT mex)
+     message(FATAL_ERROR "Failed to find mex executable")
+  endif()
+
+  find_program(mexext NAMES mexext mexext.bat HINTS ${MATLAB_ROOT}/bin)
   execute_process(COMMAND ${mexext} OUTPUT_VARIABLE MEX_EXT OUTPUT_STRIP_TRAILING_WHITESPACE)
   if (NOT MEX_EXT)
      message(FATAL_ERROR "Failed to extract MEX_EXT")
@@ -59,19 +67,23 @@
   set(mex ${mex} PARENT_SCOPE)
   set(MEX_EXT ${MEX_EXT} PARENT_SCOPE)

-  get_mex_option(CC)
-
-  get_mex_option(CFLAGS)
-  get_mex_option(CDEBUGFLAGS)
-  get_mex_option(COPTIMFLAGS)
-  get_mex_option(CLIBS)
-  get_mex_arguments(CC)
+  if ( WIN32 )
+    get_mex_option(COMPILER CC)
+    get_mex_option(COMPILER CXX)
+  else()
+    get_mex_option(CC)
+
+    get_mex_option(CFLAGS)
+    get_mex_option(CDEBUGFLAGS)
+    get_mex_option(COPTIMFLAGS)
+    get_mex_option(CLIBS)
+    get_mex_arguments(CC)

-  get_mex_option(CXX)
-  get_mex_option(CXXDEBUGFLAGS)
-  get_mex_option(CXXOPTIMFLAGS)
-  get_mex_option(CXXLIBS)
-  get_mex_arguments(CXX)
+    get_mex_option(CXX)
+    get_mex_option(CXXDEBUGFLAGS)
+    get_mex_option(CXXOPTIMFLAGS)
+    get_mex_option(CXXLIBS)
+    get_mex_arguments(CXX)

 #  not supporting fortran yet below, so might as well comment these out
 #  get_mex_option(FC)
@@ -81,14 +93,15 @@
 #  get_mex_option(FLIBS)
 #  get_mex_arguments(FC)

-  get_mex_option(LD)
-  get_mex_option(LDFLAGS)
-  get_mex_option(LDDEBUGFLAGS)
-  get_mex_option(LDOPTIMFLAGS)
-  get_mex_option(LDEXTENSION)
-  get_mex_arguments(LD)
+    get_mex_option(LD)
+    get_mex_option(LDFLAGS)
+    get_mex_option(LDDEBUGFLAGS)
+    get_mex_option(LDOPTIMFLAGS)
+    get_mex_option(LDEXTENSION)
+    get_mex_arguments(LD)

 #  note: skipping LDCXX (and just always use LD)
+  endif()

 endfunction()

@@ -193,6 +206,18 @@

 endfunction()

+function(get_compiler_version outvar compiler)
+  if ( MSVC )
+    execute_process(COMMAND ${compiler} ERROR_VARIABLE ver ERROR_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE junk)
+  else()
+    separate_arguments(c_args UNIX_COMMAND ${compiler})
+    list(APPEND c_args "-dumpversion")
+    execute_process(COMMAND ${c_args} OUTPUT_VARIABLE ver OUTPUT_STRIP_TRAILING_WHITESPACE)
+  endif()
+  set(${outvar} ${ver} PARENT_SCOPE)
+
+endfunction()
+
 ## calls compilers with --version option and checks the output
 # calls compilers with -dumpversion and checks the output
 # (because it appears that ccache messes with the --version output)
@@ -201,13 +226,8 @@
 # this seems to be a more robust and less complex method than trying to call xcrun -find, readlink to follow symlinks, etc.
 function(compare_compilers outvar compiler1 compiler2)

-  separate_arguments(c1_args UNIX_COMMAND ${compiler1})
-  list(APPEND c1_args "-dumpversion")
-  execute_process(COMMAND ${c1_args} OUTPUT_VARIABLE c1_ver OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-  separate_arguments(c2_args UNIX_COMMAND ${compiler2})
-  list(APPEND c2_args "-dumpversion")
-  execute_process(COMMAND ${c2_args} OUTPUT_VARIABLE c2_ver OUTPUT_STRIP_TRAILING_WHITESPACE)
+  get_compiler_version(c1_ver ${compiler1})
+  get_compiler_version(c2_ver ${compiler2})

   if (c1_ver AND c2_ver AND "${c1_ver}" STREQUAL "${c2_ver}")
     set(${outvar} TRUE PARENT_SCOPE)
@@ -222,14 +242,14 @@

 mex_setup()

-compare_compilers(compilers_match "${MEX_CC}" "${CMAKE_C_COMPILER}")
+compare_compilers(compilers_match "${CMAKE_C_COMPILER}" "${MEX_CC}")
 if (NOT compilers_match)
-   message(FATAL_ERROR "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
+   message(FATAL_ERROR "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  You must use the same compilers.  You can either:\n  a) reconfigure the mex compiler by running 'mex -setup' in  MATLAB, or\n  b) Set the default compiler for cmake by setting the CC environment variable in your terminal.\n")
 endif()

-compare_compilers(compilers_match ${MEX_CXX} ${CMAKE_CXX_COMPILER})
+compare_compilers(compilers_match "${CMAKE_CXX_COMPILER}" "${MEX_CXX}")
 if (NOT compilers_match)
-   message(FATAL_ERROR "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
+   message(FATAL_ERROR "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  You must use the same compilers.  You can either:\n  a) Configure the mex compiler by running 'mex -setup' in  MATLAB, or \n  b) Set the default compiler for cmake by setting the CC environment variable in your terminal.")
 endif()

 # NOTE:  would like to check LD also, but it appears to be difficult with cmake  (there is not explicit linker executable variable, only the make rule), and  even my mex code assumes that LD==LDCXX for simplicity.


change dependencies.cmake for LIBSEDML

change dependencies.cmake for LIBSEDML

--- cmake-set-dependencies.cmake
+++ cmake-set-dependencies.cmake
@@ -48,6 +48,14 @@
 set (LIBSBML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsbml-static.lib CACHE FILEPATH "libSBML library" FORCE)
 endif()

+# libsedml
+if (NOT EXISTS ${LIBSEDML_INCLUDE_DIR})
+set (LIBSEDML_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "SEDML include directory" FORCE)
+endif()
+if (NOT EXISTS ${LIBSEDML_LIBRARY})
+set (LIBSEDML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsedml-static.a CACHE FILEPATH "libSEDML library" FORCE)
+endif()
+
 # raptor
 if (NOT EXISTS ${RAPTOR_INCLUDE_DIR})
 set (RAPTOR_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "raptor include directory" FORCE)