Getting ExternalProject for capnp working on Windows.

--- external/CapnProto.cmake
+++ external/CapnProto.cmake
@@ -32,12 +32,13 @@

 if (NOT CAPNP_FOUND)
   # Build Cap'n Proto from source.
-  if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
+  if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
     set(CAPNP_ARGS "-DCAPNP_LITE=1")
+    set(CAPNP_CXX_FLAGS "-std=c++11 -m${BITNESS}")
   else()
     set(CAPNP_ARGS "")
+    set(CAPNP_CXX_FLAGS "-fPIC -std=c++11 -m${BITNESS}")
   endif()
-  set(CAPNP_CXX_FLAGS "-fPIC -std=c++11 -m64")
   ExternalProject_Add(
     CapnProto
     GIT_REPOSITORY https://github.com/sandstorm-io/capnproto.git
@@ -58,6 +59,7 @@
   set(LIB_CAPNP ${LIB_PRE}/${STATIC_PRE}capnp${STATIC_SUF})
   set(LIB_CAPNPC ${LIB_PRE}/${STATIC_PRE}capnpc${STATIC_SUF})
   set(CAPNP_LIBRARIES ${LIB_KJ} ${LIB_CAPNP} ${LIB_CAPNPC})
+  set(CAPNP_LIBRARIES_LITE ${LIB_KJ} ${LIB_CAPNP})
   set(CAPNP_INCLUDE_DIRS ${INCLUDE_PRE})
   set(CAPNP_EXECUTABLE ${BIN_PRE}/capnp)
   set(CAPNPC_CXX_EXECUTABLE ${BIN_PRE}/capnpc-c++)
@@ -82,6 +84,7 @@

 # Set the relevant variables in the parent scope.
 set(CAPNP_LIBRARIES ${CAPNP_LIBRARIES} PARENT_SCOPE)
+set(CAPNP_LIBRARIES_LITE ${CAPNP_LIBRARIES_LITE} PARENT_SCOPE)
 set(CAPNP_INCLUDE_DIRS ${CAPNP_INCLUDE_DIRS} PARENT_SCOPE)
 set(CAPNP_EXECUTABLE ${CAPNP_EXECUTABLE} PARENT_SCOPE)
 set(CAPNPC_CXX_EXECUTABLE ${CAPNPC_CXX_EXECUTABLE} PARENT_SCOPE)


Issue an error if config.hpp is not found.

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -323,7 +323,9 @@
     endif()

   endif("${ARMA_USE_WRAPPER}" STREQUAL "")
-
+else(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")
+  message(FATAL_ERROR "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp not "
+      "found!  Cannot determine what to link against.")
 endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")

 if (ARMA_NEED_LIBRARY)


* Update to searching .hpp

* Update to searching .hpp

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1278 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/Sagase.cmake
+++ CMakeModules/Sagase.cmake
@@ -124,9 +124,8 @@
     set (found_ FALSE)

     foreach (name_ ${PKG_NAMES})
-
+
         string (TOUPPER ${name_} name_upper_)
-
         # find_package can't handle packages in all caps.
         # cmake is a macro language, which means it defines global variables,
         # which it tries to namespace by choosing all caps variable names,
@@ -205,9 +204,15 @@

         # try using "COMPONENTS" as possible file names (without prefix or extension)
         foreach (component_ ${PKG_COMPONENTS})
+            # get C header path
+            find_path (${PREFIX}_${component_}_INCLUDE_DIR ${component_}.h ${include_paths})

-            # get header path
-            find_path (${PREFIX}_${component_}_INCLUDE_DIR ${component_}.h ${include_paths})
+            if (${PREFIX}_${component_}_INCLUDE_DIR)
+                set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${PREFIX}_${component_}_INCLUDE_DIR})
+            endif ()
+
+			# get C++ header path
+            find_path (${PREFIX}_${component_}_INCLUDE_DIR ${component_}.hpp ${include_paths})

             if (${PREFIX}_${component_}_INCLUDE_DIR)
                 set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${PREFIX}_${component_}_INCLUDE_DIR})
@@ -227,7 +232,7 @@

     # stop process if nothing is found through any means
     if (NOT found_ AND NOT ${PREFIX}_INCLUDE_DIRS AND NOT ${PREFIX}_LIBRARY_DIRS AND NOT ${PREFIX}_LIBRARIES)
-        message (FATAL_ERROR "!! sagase: unable to configure " ${PREFIX})
+		message (FATAL_ERROR "!! sagase: unable to configure " ${PREFIX})
     endif ()

     # remove duplicate entires from return variables


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -1,89 +1,6 @@
 [Desktop Entry]
 Name=Instant Messaging
-Name[bs]=Brze poruke
-Name[ca]=Contactes de missatgeria instantània
-Name[ca@valencia]=Contactes de missatgeria instantània
-Name[cs]=Kontakty komunikátoru
-Name[da]=Instant messaging-kontakter
-Name[de]=Instant-Messenger-Kontakte
-Name[el]=Επαφές στγμιαίων μηνυμάτων
-Name[es]=Contactos de mensajería instantánea
-Name[et]=Kiirsuhtluskontaktid
-Name[fi]=Pikaviestinkäyttäjät
-Name[fr]=Contacts de messagerie instantanée
-Name[ga]=Teagmhálacha Teachtaireachtaí Meandracha
-Name[gl]=Contactos de mensaxería instantánea
-Name[hu]=Azonnali üzenetküldési partnerek
-Name[ia]=Contactos de messageria instantanee
-Name[it]=Contatti di messaggistica istantanea
-Name[kk]=Лезде хабарласу контакттар тізімі
-Name[km]=ទំនាក់ទំនងការផ្ញើសារបន្ទាន់
-Name[lt]=Greitųjų žinučių kontaktai
-Name[mr]=त्वरित संदेश संपर्क
-Name[nb]=Lynmeldingskontakter
-Name[nl]=Contactpersonen van Instant Messaging
-Name[pa]=ਤੁਰੰਤ ਸੁਨੇਹਾ ਸੰਪਰਕ
-Name[pl]=Kontakty komunikatorów internetowych
-Name[pt]=Contactos das Mensagens Instantâneas
-Name[pt_BR]=Contatos de mensagens instantâneas
-Name[ro]=Contacte de mesagerie instantanee
-Name[ru]=Контакты системы обмена сообщениями
-Name[sk]=Kontakty priamej komunikácie
-Name[sl]=Stiki hipnega sporočanja
-Name[sr]=Брзогласнички контакти
-Name[sr@ijekavian]=Брзогласнички контакти
-Name[sr@ijekavianlatin]=Brzoglasnički kontakti
-Name[sr@latin]=Brzoglasnički kontakti
-Name[sv]=Direktmeddelandekontakter
-Name[tr]=Anında Mesajlaşma Kişileri
-Name[ug]=مۇڭداشقۇ ئالاقەداشلىرى
-Name[uk]=Контакти миттєвого обміну повідомленнями
-Name[wa]=Soçons del messaedjreye sol moumint
-Name[x-test]=xxInstant Messaging Contactsxx
-Name[zh_CN]=即时通讯联系人
-Name[zh_TW]=即時訊息聯絡人
 Comment=Start a chat with any of your IM contacts or change your IM status
-Comment[bs]=Počnite ćaskanje s nekim od IM kontakta
-Comment[ca]=Inicia un xat amb qualsevol dels vostres contactes de MI
-Comment[ca@valencia]=Inicia un xat amb qualsevol dels vostres contactes de MI
-Comment[cs]=Začít rozhovor s kterýmkoliv vaším kontaktem v IM
-Comment[da]=Start chat med en af dine IM-kontakter
-Comment[de]=Chats mit ihren Kontakten starten
-Comment[el]=Έναρξη συνομιλίας με οποιαδήποτε επαφή στιγμιαίων μηνυμάτων
-Comment[es]=Iniciar una charla con cualquiera de sus contactos de MI
-Comment[et]=Vestluse alustamine mõne oma kiirsuhtluskontaktiga
-Comment[fi]=Aloita keskustelu muun pikaviestinkäyttäjän kanssa
-Comment[fr]=Démarre une discussion avec n'importe lequel de vos contacts de messagerie instantanée
-Comment[ga]=Déan comhrá le teagmháil TM
-Comment[gl]=Inicie unha conversa con calquera dos seus contactos
-Comment[hu]=Csevegjen az azonnali üzenetküldési partnereivel
-Comment[ia]=Starta conversation con qualcunque de tu contactos de IM
-Comment[it]=Avvia una chat con un tuo contatto di messaggistica istantanea
-Comment[kk]=Кез-келген лезде хабарласу контактыңызбен чат-әңгімені бастау
-Comment[km]=ចាប់ផ្ដើមជជែកជាមួយទំនាក់ទំនងការផ្ញើសារបន្ទាន់របស់អ្នក
-Comment[lt]=Pradėti pokalbį su bet kuriuo TP kontaktu
-Comment[mr]=तुमच्या आयएम संपर्कातील कोणाशीही गप्पा मारा
-Comment[nb]=Start en prat med en av dine LM-kontakter
-Comment[nl]=Begin een chat met een van uw IM-contactpersonen
-Comment[pa]=ਆਪਣੇ ਕਿਸੇ ਆਈਐਮ ਸੰਪਰਕ ਨਾਲ ਗੱਲ ਸ਼ੁਰੂ ਕਰੋ
-Comment[pl]=Rozpocznij rozmowę z kimkolwiek z twoich kontaktów z komunikatora
-Comment[pt]=Iniciar uma conversa com qualquer um dos seus contactos MI
-Comment[pt_BR]=Inicia um bate-papo com qualquer um dos seus contatos de MI
-Comment[ro]=Începeți o discuție cu oricare dintre contactele de mesagerie instantanee
-Comment[ru]=Общение с любым собеседником системы обмена сообщениями
-Comment[sk]=Spustiť rozhovor s nejakým z vašich IM kontaktov
-Comment[sl]=Začnite klepet s katerimkoli izmed vaših stikov hipnega sporočanja
-Comment[sr]=Започните ћаскање преко ИМ контакта
-Comment[sr@ijekavian]=Започните ћаскање преко ИМ контакта
-Comment[sr@ijekavianlatin]=Započnite ćaskanje preko IM kontakta
-Comment[sr@latin]=Započnite ćaskanje preko IM kontakta
-Comment[sv]=Börja chatta med någon direktmeddelandekontakt
-Comment[tr]=IM kişilerinizden biriyle sohbete başlayın
-Comment[uk]=Почати спілкування з будь-яким з ваших контактів у системах обміну повідомленнями
-Comment[wa]=Ataker on berdelaedje avou tolminme ké soçon di MSM
-Comment[x-test]=xxStart chat with any of your IM contactsxx
-Comment[zh_CN]=与任意您的即时通讯联系人开始聊天
-Comment[zh_TW]=與您的即時訊息聯絡人開始聊天
 Icon=user-online

 X-KDE-ServiceTypes=Plasma/Runner


Change download method of TinyXML-2 to Git clone

--- CMakeExternals/tinyxml2.cmake
+++ CMakeExternals/tinyxml2.cmake
@@ -26,8 +26,8 @@

   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/tinyxml2-8.0.0.tar.gz
-     URL_MD5 5dc535c8b34ee621fe2128f072d275b5
+     GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
+     GIT_TAG 8.0.0
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS


Fix corner case where found version is equal to the required version.

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -88,11 +88,11 @@
 #  VERSION_VAR ARMADILLO_VERSION_STRING)
 # version_var fails with cmake < 2.8.4.

-if ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
+if ("${ARMADILLO_VERSION_STRING}" VERSION_LESS "${Armadillo_FIND_VERSION}")
+  message(FATAL_ERROR "Armadillo version ${Armadillo_FIND_VERSION} required (found ${ARMADILLO_VERSION_STRING}).")
+else ("${ARMADILLO_VERSION_STRING}" VERSION_LESS "${Armadillo_FIND_VERSION}")
   message(STATUS "Found Armadillo version ${ARMADILLO_VERSION_STRING} (required ${Armadillo_FIND_VERSION}).")
-else ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
-  message(FATAL_ERROR "Armadillo version ${Armadillo_FIND_VERSION} required (found ${ARMADILLO_VERSION_STRING}).")
-endif ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
+endif ("${ARMADILLO_VERSION_STRING}" VERSION_LESS "${Armadillo_FIND_VERSION}")

 if (ARMADILLO_FOUND)


COMP (#4527): due to vtkDebugLeaks and static StateMachineFactory and EventMapper, temporarily disabling StateMachineTest

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -34,7 +34,7 @@
   #mitkSegmentationInterpolationTest.cpp
   mitkSlicedGeometry3DTest.cpp
   mitkSliceNavigationControllerTest.cpp
-  mitkStateMachineTest.cpp
+  #mitkStateMachineTest.cpp
   mitkStateMachineFactoryTest.cpp
   mitkStateTest.cpp
   mitkSurfaceTest.cpp


COMP: do not make .app bundle for mapla and monteverdi

--- CMake/MonteverdiApplicationMacros.cmake
+++ CMake/MonteverdiApplicationMacros.cmake
@@ -11,23 +11,12 @@
     add_executable(${APPLICATION_NAME}
       WIN32
       ${APPLICATION_SOURCES})
-  elseif(APPLE)
-    add_executable(${APPLICATION_NAME}
-      MACOSX_BUNDLE
-      ${APPLICATION_SOURCES})
-
-  else() #Linux
+  else() #Unix
     add_executable(${APPLICATION_NAME}
       ${APPLICATION_SOURCES})
   endif()

   set(EXECUTABLE_NAME ${APPLICATION_NAME})
-  if(APPLE)
-
-    string(SUBSTRING ${APPLICATION_NAME} 0 1 FIRST_LETTER)
-    string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
-    string(REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" APPLICATION_OUTPUT_NAME "${APPLICATION_NAME}")
-  endif()

   if (APPLICATION_OUTPUT_NAME)
     set_target_properties(${APPLICATION_NAME} PROPERTIES OUTPUT_NAME ${APPLICATION_OUTPUT_NAME})


BUG: extension not set on uninstall script

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -19,12 +19,16 @@
   #selftester
   set(selftester_CMD ${pkg_extracted_dir}/tools/selftester.bat)
   set(selftester_ARGS "/q")
+  #uninstall OTB
+  set(uninstall_otb_CMD ${pkg_extracted_dir}/tools/uninstall_otb.bat)
 else()
   set(install_package_ARGS "--noprogress;--target;${pkg_extracted_dir}")
   set(install_package_CMD "${PACKAGE_OUTPUT_FILE}")
   #selftester
   set(selftester_CMD ${pkg_extracted_dir}/tools/selftester.sh)
   set(selftester_ARGS)
+  #uninstall OTB
+  set(uninstall_otb_CMD ${pkg_extracted_dir}/tools/uninstall_otb.sh)
 endif()
 add_test(
   NAME Tu_install_package
@@ -49,7 +53,7 @@

 add_test(
   NAME Tu_uninstall_otb
-  COMMAND ${pkg_extracted_dir}/tools/uninstall_otb${my_ext}
+  COMMAND ${uninstall_otb_CMD}
   WORKING_DIRECTORY ${testing_dir}
   )


iox-#468 add xml generation for iceoryx website

Signed-off-by: Dietrich Krönke <ea45bc0219d3b6c3a6b9cf3abdfa172e6bfa16ff@apex.ai>

--- iceoryx_utils/cmake/IceoryxDoxygen.cmake
+++ iceoryx_utils/cmake/IceoryxDoxygen.cmake
@@ -18,6 +18,9 @@

     set(DOXYGEN_GENERATE_HTML YES)
     set(DOXYGEN_GENERATE_LATEX YES)
+    set(DOXYGEN_GENERATE_XML YES)
+    set(DOXYGEN_XML_OUTPUT xml)
+
     set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/doc/${PROJECT_NAME})

     if(EXISTS "/usr/share/plantuml/plantuml.jar")


create_lib_symlink: fix docu

create_lib_symlink: fix docu

--- scripts/cmake/Modules/LibAddMacros.cmake
+++ scripts/cmake/Modules/LibAddMacros.cmake
@@ -10,7 +10,10 @@
 # ~~~
 # Create a symlink for a plugin both in lib and at installation
 #
-# Parameter: PLUGIN: install symlink in TARGET_PLUGIN_FOLDER subdirectory
+# Parameters:
+# - PLUGIN: install symlink in TARGET_PLUGIN_FOLDER subdirectory
+# - JAVA: install symlink for Java in share/java
+# - otherwise: install symlink for normal libraries
 #
 # create_lib_symlink src dest - create a symbolic link from src -> dest
 # ~~~


Fix TBB fallback message

Fix TBB fallback message

--- CMake/hoomd/FindTBB.cmake
+++ CMake/hoomd/FindTBB.cmake
@@ -30,7 +30,7 @@
 if(TBB_LIBRARY AND NOT TARGET TBB::tbb)
     add_library(TBB::tbb UNKNOWN IMPORTED)
     set_target_properties(TBB::tbb PROPERTIES
-        IMPORTED_LOCATION "${TBB_LIBRARY}"
+        IMPORTED_LOCATION_RELEASE "${TBB_LIBRARY}"
         INTERFACE_INCLUDE_DIRECTORIES "${TBB_INCLUDE_DIR}")

     if (TBB_USE_GLIBCXX_VERSION)


Work for older CMake versions (2.8.2) and finding older Armadillo versions.

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -66,6 +66,13 @@
     # WARNING: The number of spaces before the version name is not one.
     string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")

+    string(COMPARE EQUAL "${ARMADILLO_VERSION_MAJOR}" "${_armadillo_HEADER_CONTENTS}" EQUAL_STRING)
+    if (EQUAL_STRING)
+      string(REGEX REPLACE ".*static const unsigned int major = ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
+      string(REGEX REPLACE ".*static const unsigned int minor = ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
+      string(REGEX REPLACE ".*static const unsigned int patch = ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
+    endif (EQUAL_STRING)
+
   endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")

   set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
@@ -77,9 +84,16 @@
 # Checks 'RECQUIRED', 'QUIET' and versions.
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Armadillo
-  REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
-  VERSION_VAR ARMADILLO_VERSION_STRING)
+  REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR)
+#  VERSION_VAR ARMADILLO_VERSION_STRING)
 # version_var fails with cmake < 2.8.4.
+
+if ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
+  message(STATUS "Found Armadillo version ${ARMADILLO_VERSION_STRING} (required ${Armadillo_FIND_VERSION}).")
+else ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
+  message(FATAL_ERROR "Armadillo version ${Armadillo_FIND_VERSION} required (found ${ARMADILLO_VERSION_STRING}).")
+endif ("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "${Armadillo_FIND_VERSION}")
+

 if (ARMADILLO_FOUND)
   set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})


* Update to searching .hpp


--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -8,6 +8,7 @@
 Name[de]=Instant-Messaging
 Name[el]=Στιγμιαία μηνύματα
 Name[es]=Mensajería instantánea
+Name[et]=Kiirsuhtlus
 Name[fi]=Pikaviestintä
 Name[fr]=Messagerie instantanée
 Name[gl]=Mensaxería instantánea
@@ -47,6 +48,7 @@
 Comment[de]=Chats mit ihren Kontakten starten oder Ihren IM-Status ändern
 Comment[el]=Έναρξη συνομιλίας με οποιαδήποτε επαφή στιγμιαίων μηνυμάτων ή αλλαγή της κατάστασής σας
 Comment[es]=Iniciar una conversación con cualquiera de sus contactos de MI o cambiar su estado de MI
+Comment[et]=Vestluse alustamine mõne oma kiirsuhtluskontaktiga või enda kiirsuhtlusoleku muutmine
 Comment[fi]=Aloita keskustelu muun pikaviestinkäyttäjän kanssa tai vaihda pikaviestintilaasi
 Comment[fr]=Démarre une discussion avec n'importe lequel de vos contacts de messagerie instantanée ou change l'état de celle-ci
 Comment[gl]=Inicie unha conversa con calquera dos seus contactos ou cambie seu estado na IM


--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -29,6 +29,7 @@
 Name[sr@ijekavianlatin]=DirectShow‑9
 Name[sr@latin]=DirectShow‑9
 Name[sv]=DirectShow 9
+Name[ug]=DirectShow9
 Name[uk]=DirectShow9
 Name[x-test]=xxDirectShow9xx
 Name[zh_TW]=DirectShow9


Fix for errors with integration tests failing to find libcrypto.so.0.9.7

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -209,7 +209,7 @@
         libapr-1.so.0
         libaprutil-1.so.0
         libatk-1.0.so
-        libcrypto.so
+        libcrypto.so.0.9.7
         libdb-4.2.so
         libexpat.so
         libgmock_main.so


Fix for inclusion of CommonCPack without having used common_library.

This is a legit use case, for example when only building a final
application.

--- CommonPackageConfig.cmake
+++ CommonPackageConfig.cmake
@@ -58,8 +58,8 @@
         DESTINATION ${CMAKE_MODULE_INSTALL_PATH}
 )

-# No export(EXPORT) in CMake 2
-if(CMAKE_MAJOR_VERSION LESS 3 OR NOT TARGET ${PROJECT_NAME})
+# No export(EXPORT) in CMake 2 or if common_library has not been used.
+if(CMAKE_MAJOR_VERSION LESS 3 OR NOT TARGET ${PROJECT_NAME}_ALIAS)
   return()
 endif()


simplify wasi-sdk toolchain file a bit

simplify wasi-sdk toolchain file a bit

--- cmake-toolchains/wasisdk.toolchain.cmake
+++ cmake-toolchains/wasisdk.toolchain.cmake
@@ -22,7 +22,6 @@
 set(WASISDK_LINKER_FLAGS)
 set(WASISDK_LINKER_FLAGS_RELEASE)
 set(WASISDK_EXE_LINKER_FLAGS)
-set(WASISDK_AR_FLAGS)

 if (NOT FIPS_EXCEPTIONS)
     set(WASISDK_CXX_FLAGS "${WASISDK_CXX_FLAGS} -fno-exceptions")
@@ -36,30 +35,32 @@

 set(CMAKE_SYSTEM_NAME Generic)
 set(CMAKE_SYSTEM_VERSION 1)
-set(COMPILING ON)
-set(CMAKE_CROSSCOMPILING TRUE)
-set(CMAKE_SYSTEM_PROCESSOR x86)
+set(CMAKE_SYSTEM_PROCESSOR wasm32)
+set(CMAKE_CONFIGURATION_TYPES Debug Release Profiling)
+set(CMAKE_C_COMPILER_TARGET "wasm32-wasi")
+set(CMAKE_CXX_COMPILER_TARGET "wasm32-wasi")
+set(CMAKE_SYSROOT "${WASISDK_SYSROOT}")
 set(CMAKE_C_COMPILER_WORKS TRUE)
 set(CMAKE_CXX_COMPILER_WORKS TRUE)

-# define configurations
-set(CMAKE_CONFIGURATION_TYPES Debug Release Profiling)
-
+if(WIN32)
+    set(WASI_HOST_EXE_SUFFIX ".exe")
+else()
+    set(WASI_HOST_EXE_SUFFIX "")
+endif()
 # specify cross-compilers
-set(CMAKE_C_COMPILER "${WASISDK_ROOT}/bin/clang" CACHE PATH "gcc" FORCE)
-set(CMAKE_CXX_COMPILER "${WASISDK_ROOT}/bin/clang++" CACHE PATH "g++" FORCE)
-set(CMAKE_AR "${WASISDK_ROOT}/bin/ar" CACHE PATH "archive" FORCE)
-set(CMAKE_LINKER "${WASISDK_ROOT}/bin/clang" CACHE PATH "linker" FORCE)
-set(CMAKE_RANLIB "${WASISDK_ROOT}/bin/ranlib" CACHE PATH "ranlib" FORCE)
+set(CMAKE_C_COMPILER "${WASISDK_ROOT}/bin/clang${WASI_HOST_EXE_SUFFIX}" CACHE PATH "gcc" FORCE)
+set(CMAKE_CXX_COMPILER "${WASISDK_ROOT}/bin/clang++${WASI_HOST_EXE_SUFFIX}" CACHE PATH "g++" FORCE)
+set(CMAKE_AR "${WASISDK_ROOT}/bin/ar${WASI_HOST_EXE_SUFFIX}" CACHE PATH "archive" FORCE)
+set(CMAKE_LINKER "${WASISDK_ROOT}/bin/clang${WASI_HOST_EXE_SUFFIX}" CACHE PATH "linker" FORCE)
+set(CMAKE_RANLIB "${WASISDK_ROOT}/bin/ranlib${WASI_HOST_EXE_SUFFIX}" CACHE PATH "ranlib" FORCE)

 # only search for libraries and includes in the toolchain
-set(CMAKE_FIND_ROOT_PATH ${WASISDK_SYSROOT})
+#set(CMAKE_FIND_ROOT_PATH ${WASISDK_SYSROOT})
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
-
-set(CMAKE_SYSROOT "${WASISDK_SYSROOT}")

 set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
 set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
@@ -73,26 +74,6 @@

 set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
 set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
-
-set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-set(CMAKE_SIZEOF_CHAR 1)
-set(CMAKE_SIZEOF_UNSIGNED_SHORT 2)
-set(CMAKE_SIZEOF_SHORT 2)
-set(CMAKE_SIZEOF_INT 4)
-set(CMAKE_SIZEOF_UNSIGNED_LONG 4)
-set(CMAKE_SIZEOF_UNSIGNED_INT 4)
-set(CMAKE_SIZEOF_LONG 4)
-set(CMAKE_SIZEOF_VOID_P 4)
-set(CMAKE_SIZEOF_FLOAT 4)
-set(CMAKE_SIZEOF_DOUBLE 8)
-set(CMAKE_C_SIZEOF_DATA_PTR 4)
-set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
-set(CMAKE_HAVE_LIMITS_H 1)
-set(CMAKE_HAVE_UNISTD_H 1)
-set(CMAKE_HAVE_PTHREAD_H 1)
-set(CMAKE_HAVE_SYS_PRCTL_H 1)
-set(CMAKE_WORDS_BIGENDIAN 0)
-set(CMAKE_DL_LIBS)

 # c++ compiler flags
 set(CMAKE_CXX_FLAGS "${WASISDK_COMMON_FLAGS} ${WASISDK_CXX_FLAGS} -fstrict-aliasing -Wall -Wno-multichar -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-deprecated-writable-strings -Wno-unused-volatile-lvalue -Wno-inconsistent-missing-override -Wno-expansion-to-defined")
@@ -111,9 +92,6 @@
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${WASISDK_OPT} ${WASISDK_COMMON_FLAGS_RELEASE} ${WASISDK_LINKER_FLAGS_RELEASE}")
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-O0 -g")
 set(CMAKE_EXE_LINKER_FLAGS_PROFILING "--profiling ${WASISDK_OPT} ${WASISDK_LINKER_FLAGS_RELEASE}")
-
-# static library flags (for CMAKE_AR)
-set(CMAKE_STATIC_LINKER_FLAGS "${WASISDK_AR_FLAGS}")

 # dynamic lib linker flags
 set(CMAKE_SHARED_LINKER_FLAGS "-shared ${WASISDK_COMMON_FLAGS} ${WASISDK_LINKER_FLAGS}")


cmake 2.8.10 has slight changes to the internal API

--- cmake/CMakeDetermineCSharpCompiler.cmake
+++ cmake/CMakeDetermineCSharpCompiler.cmake
@@ -92,7 +92,11 @@
 endif (CMAKE_CSharp_COMPILER)

 # configure variables set in this file for fast reload later on
+if(NOT CMAKE_PLATFORM_INFO_DIR) # pre-2.8.10
+  set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
+endif()
+
 configure_file(${CMAKE_SOURCE_DIR}/cmake/CMakeCSharpCompiler.cmake.in
-  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCSharpCompiler.cmake IMMEDIATE @ONLY)
+  ${CMAKE_PLATFORM_INFO_DIR}/CMakeCSharpCompiler.cmake IMMEDIATE @ONLY)
 set(CMAKE_CSharp_COMPILER_ENV_VAR "CSC")


CMake: Bugfix: Export -pthread when trying to link

It turns out that clang is a bit more picky and wants to have -pthread
on the command line.

--- cmake/checks/check_01_cxx_features.cmake
+++ cmake/checks/check_01_cxx_features.cmake
@@ -217,6 +217,7 @@
       "
       DEAL_II_HAVE_CXX11_SHARED_PTR)

+    PUSH_CMAKE_REQUIRED("-pthread")
     CHECK_CXX_SOURCE_COMPILES(
       "
       #include <thread>
@@ -224,6 +225,8 @@
       int main(){ std::thread t(f,1); t.join(); return 0; }
       "
       DEAL_II_HAVE_CXX11_THREAD)
+    RESET_CMAKE_REQUIRED()
+    PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")

     CHECK_CXX_SOURCE_COMPILES(
       "


[cmake] Temporarily revert enforcement of minimum GCC version increase

Summary:
This is temporary, until bot that builds public facing LLVM
documentation is upgraded. It reverts only the cmake change in r284497,
but leaves the doc changes in place to preserve intent.

Reviewers: aaron.ballman

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D26078

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@285406 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/CheckCompilerVersion.cmake
+++ cmake/modules/CheckCompilerVersion.cmake
@@ -8,8 +8,9 @@

   if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
-        message(FATAL_ERROR "Host GCC version must be at least 4.8!")
+      # FIXME: Change this to 4.8 once documentation builder bot is upgraded
+      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
+        message(FATAL_ERROR "Host GCC version must be at least 4.7!")
       endif()
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
       if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
@@ -35,7 +36,8 @@
 int main() { return (float)x; }"
           LLVM_NO_OLD_LIBSTDCXX)
         if(NOT LLVM_NO_OLD_LIBSTDCXX)
-          message(FATAL_ERROR "Host Clang must be able to find libstdc++4.8 or newer!")
+          # FIXME: Change this to 4.8 once documentation builder bot is upgraded
+          message(FATAL_ERROR "Host Clang must be able to find libstdc++4.7 or newer!")
         endif()
         set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
         set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})


From Wang Rui, "The OSG book I'm working on will focus on helping beginners build
latest OSG source code with Visual Studio 2010 express, without
setting too many options and without facing unexpected errors. But at
present, the compilation process will fail because the INSTALL project
'cannot find' generated DLLs while copying files. I have looked into
the build directory and found that the places of generated file
folders were just different from previous VS versions. In this case,
the old hack in OsgMacroUtils.cmake may become invalid:

MACRO(HANDLE_MSVC_DLL)
       #this is a hack... the build place is set to lib/<debug or
release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
       #the .lib will be crated in ../ so going straight in lib by
the IMPORT_PREFIX property
       #because we want dll placed in OUTPUT_BINDIR ie the bin folder
sibling of lib, we can use ../../bin to go there,
       ...
       ELSE(NOT MSVC_IDE)
           SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX
"../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
       ENDIF(NOT MSVC_IDE)
ENDMACRO(HANDLE_MSVC_DLL)

Here the prefix "../../bin" may need to be fixed. I just modified it to:

IF(MSVC_VERSION LESS 1600)
    SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX
"../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF()

It should keep compatible with old MSVC versions. There are similar
fixes in the SETUP_PLUGIN and SETUP_EXE macros. I haven't tested them
on more platforms.
"

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -170,7 +170,9 @@
             IF(NOT MSVC_IDE)
                 SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
             ELSE(NOT MSVC_IDE)
-                SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/")
+                IF(MSVC_VERSION LESS 1600)
+                    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/")
+                ENDIF()
             ENDIF(NOT MSVC_IDE)
         ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
             IF(OSG_MSVC_VERSIONED_DLL)
@@ -274,7 +276,9 @@
     SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES MINSIZEREL_OUTPUT_NAME "${TARGET_NAME}${CMAKE_MINSIZEREL_POSTFIX}")

     IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
+        IF(MSVC_VERSION LESS 1600)
             SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")
+        ENDIF()
     ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)

     SETUP_LINK_LIBRARIES()
@@ -373,7 +377,9 @@
                     )
             ENDIF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
         ELSE(NOT MSVC_IDE)
-            SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
+            IF(MSVC_VERSION LESS 1600)
+                SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
+            ENDIF()
         ENDIF(NOT MSVC_IDE)

 #     SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")


Move the Qt module to private dependency

Change-Id: I5487becf01f9f7d83f3fe020cd5031b2e3986e0a

--- Rendering/Qt/module.cmake
+++ Rendering/Qt/module.cmake
@@ -3,10 +3,10 @@
     Qt
   DEPENDS
     vtkRenderingLabel
-    vtkGUISupportQt
   PRIVATE_DEPENDS
     vtkFiltersTexture
     vtkFiltersSources
+    vtkGUISupportQt
   TEST_DEPENDS
     vtkTestingCore
   )


Adding kinect driver from svn in externals (rev that includes our build fix to the driver in svn)

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -64,9 +64,9 @@
 set(velodyne_revision 852)
 set(velodyne_depends common_utils)

-#set(kinect_url https://svn.csail.mit.edu/rrg_pods/drivers/kinect)
-#set(kinect_revision 961)
-#set(kinect_depends libbot-drc)
+set(kinect_url https://svn.csail.mit.edu/rrg_pods/drivers/kinect)
+set(kinect_revision 962)
+set(kinect_depends libbot-drc)

 set(microstrain_comm_url https://svn.csail.mit.edu/rrg_pods/drivers/microstrain_comm)
 set(microstrain_comm_revision 853)
@@ -169,7 +169,7 @@
   isam_include
   visualization
   #velodyne
-  #kinect
+  kinect
   microstrain_comm
   fovis-git
   estimate-pose


Fix FindGLEW cmake variable. _PATH -> _DIR.

--- CMakeModules/FindGLEW.cmake
+++ CMakeModules/FindGLEW.cmake
@@ -3,44 +3,44 @@
 # Once done this will define
 #
 # GLEW_FOUND
-# GLEW_INCLUDE_PATH
+# GLEW_INCLUDE_DIR
 # GLEW_LIBRARY
 #

 IF (WIN32)
-	FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
-		$ENV{PROGRAMFILES}/GLEW/include
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
-		DOC "The directory where GL/glew.h resides")
-	FIND_LIBRARY( GLEW_LIBRARY
-		NAMES glew GLEW glew32 glew32s
-		PATHS
-		$ENV{PROGRAMFILES}/GLEW/lib
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
-		${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
-		DOC "The GLEW library")
+    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
+        $ENV{PROGRAMFILES}/GLEW/include
+        ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
+        DOC "The directory where GL/glew.h resides")
+    FIND_LIBRARY( GLEW_LIBRARY
+        NAMES glew GLEW glew32 glew32s
+        PATHS
+        $ENV{PROGRAMFILES}/GLEW/lib
+        ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
+        ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
+        DOC "The GLEW library")
 ELSE (WIN32)
-	FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
-		/usr/include
-		/usr/local/include
-		/sw/include
-		/opt/local/include
-		DOC "The directory where GL/glew.h resides")
-	FIND_LIBRARY( GLEW_LIBRARY
-		NAMES GLEW glew
-		PATHS
-		/usr/lib64
-		/usr/lib
-		/usr/local/lib64
-		/usr/local/lib
-		/sw/lib
-		/opt/local/lib
-		DOC "The GLEW library")
+    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
+        /usr/include
+        /usr/local/include
+        /sw/include
+        /opt/local/include
+        DOC "The directory where GL/glew.h resides")
+    FIND_LIBRARY( GLEW_LIBRARY
+        NAMES GLEW glew
+        PATHS
+        /usr/lib64
+        /usr/lib
+        /usr/local/lib64
+        /usr/local/lib
+        /sw/lib
+        /opt/local/lib
+        DOC "The GLEW library")
 ENDIF (WIN32)

-IF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)
+IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
         SET( GLEW_FOUND TRUE )
-ENDIF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)
+ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)

 IF (GLEW_FOUND)
    IF (NOT GLEW_FIND_QUIETLY)


Fix minor bug in FindPHP5.cmake

Fix minor bug in FindPHP5.cmake

--- CMakeModules/FindPHP5.cmake
+++ CMakeModules/FindPHP5.cmake
@@ -80,7 +80,7 @@
         string(REGEX REPLACE "PHP ([0-9]+\\.[0-9]+\\.[0-9_.]+).*"
                "\\1" PHP5_VERSION_STRING "${var}")
       else()
-        if(NOT PHP5_FAIL_QUIETLY)
+        if(NOT PHP5_FIND_QUIETLY)
           message(WARNING "regex not supported: {$var}.")
         endif()
       endif()


Added ImageMagick as 3rd-party library

Added ImageMagick as 3rd-party library

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -178,6 +178,7 @@
 add_target(HTTPD httpd)
 add_target(HTTPXX httpxx)
 add_target(ICU icu)
+add_target(IMAGEMAGICK imagemagick)
 add_target(IMAP_2007F imap-2007f)
 add_target(ISO_3166 iso_3166)
 add_target(ISO_639 iso_639)
@@ -1582,6 +1583,45 @@
   WORKING_DIRECTORY ${ICU_PREFIX}/lib)

 ################################################################################
+# ImageMagick. TODO(qfiard): Make portable.
+if (APPLE AND NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "" AND
+    NOT EXISTS ${CMAKE_OSX_SYSROOT}/usr/include/crt_externs.h)
+  message(WARNING "crt_externs.h is missing from ${CMAKE_OSX_SYSROOT}/usr/include, please copy it from somewhere to compile ImageMagick")
+endif ()
+set(IMAGEMAGICK_CONFIGURE_COMMAND
+    <SOURCE_DIR>/configure --prefix=${IMAGEMAGICK_PREFIX} ${HOST}
+        CC=${CMAKE_C_COMPILER}
+        CXX=${CMAKE_CXX_COMPILER} CFLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+        CXXFLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
+        LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
+        FREETYPE_CFLAGS=-I${FREETYPE_PREFIX}/include
+        FREETYPE_LIBS="-L${FREETYPE_PREFIX}/lib -lfreetype"
+        ${CONFIGURE_LIB_TYPE}
+        PKG_CONFIG=)
+set(IMAGEMAGICK_CXX_FLAGS "${CMAKE_CXX_FLAGS_WITH_ARCHS}")
+if (NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
+  set(IMAGEMAGICK_CONFIGURE_COMMAND ${IMAGEMAGICK_CONFIGURE_COMMAND}
+      --with-sysroot=${CMAKE_OSX_SYSROOT})
+endif ()
+if (IOS_BUILD)
+  set(IMAGEMAGICK_CONFIGURE_COMMAND ${IMAGEMAGICK_CONFIGURE_COMMAND}
+      --without-x)
+endif ()
+add_external_project(
+  ${IMAGEMAGICK_TARGET}
+  PREFIX ${IMAGEMAGICK_PREFIX}
+  DOWNLOAD_DIR ${IMAGEMAGICK_PREFIX}/download
+  DOWNLOAD_COMMAND
+      wget -O ImageMagick-6.8.9-0.tar.bz2 http://www.imagemagick.org/download/ImageMagick-6.8.9-0.tar.bz2 &&
+      gpg --verify ${THIRD_PARTY_SOURCE_DIR}/ImageMagick-6.8.9-0.tar.bz2.sig
+          ImageMagick-6.8.9-0.tar.bz2 &&
+      cd <SOURCE_DIR> &&
+      tar --strip-components 1 -xvf
+          ${IMAGEMAGICK_PREFIX}/download/ImageMagick-6.8.9-0.tar.bz2
+  CONFIGURE_COMMAND ${IMAGEMAGICK_CONFIGURE_COMMAND})
+add_dependencies(${IMAGEMAGICK_TARGET} ${FREETYPE_TARGET})
+
+################################################################################
 # IMAP-2007f. TODO(qfiard): Make portable.
 add_external_project(
   ${IMAP_2007F_TARGET}


Update BdeTestDriverUtils.cmake

Update BdeTestDriverUtils.cmake

--- BdeBuildSystem/BdeTestDriverUtils.cmake
+++ BdeBuildSystem/BdeTestDriverUtils.cmake
@@ -125,7 +125,7 @@
                 add_custom_target(${test_name}.t)
             endif()

-            message(STATUS "Adding ${test_name}.t -> ${test_target_name}.t")
+            message(TRACE "Adding ${test_name}.t -> ${test_target_name}.t")
             add_dependencies(${test_name}.t ${test_target_name}.t)
         endif()
     endforeach()


Fixed include path for libcxx

Fixed include path for libcxx

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1493,7 +1493,7 @@

 ################################################################################
 # libcxxabi.
-ExternalProject_Get_Property(${LIBCXX_HEADERS_TARGET} SOURCE_DIR)
+ExternalProject_Get_Property(${LIBCXX_TARGET} SOURCE_DIR)
 set(LIBCXXABI_OPTIONS "-I${SOURCE_DIR}/include")
 add_external_project(
   ${LIBCXXABI_TARGET}


x11_egl: use correct cmake variable name for GLES1 include path

This commit reverts most of 7b4a66f99 that included a hack to search
for include directory next to the library path. This was invalid since
used variable name PKG_GLES1_INCLUDE_DIRS is false, correct name is
GLES1_INCLUDE_DIRS which is properly set by the PKG_CHECK_MODULES call.

This change has been succesfully tested on Fedora and Ubuntu distros by
setting up a custom PKG_CONFIG_PATH.

VK-GL-CTS issue: 1573

Change-Id: I158d816d28f5bbf30288f6226bd5c9e30cf85285
Signed-off-by: Tapani Pälli <cdcb67a5e49297de94340ca09f25994bd5e7f762@intel.com>

--- targets/x11_egl/x11_egl.cmake
+++ targets/x11_egl/x11_egl.cmake
@@ -39,16 +39,7 @@
 	set(DEQP_SUPPORT_GLES1	ON)
 	set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARIES})
 	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS}")
-	if ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
-		# PKG_GLES1_INCLUDE_DIRS empty, see if matching include
-		# path (GLES/gl.h) exists beside library directory
-		set(GLES1_INCLUDE "${GLES1_LIBDIR}/../include")
-		if (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
-			include_directories(${GLES1_INCLUDE})
-		else()
-			message(FATAL_ERROR "Could not find include path for GLES1 headers")
-		endif (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
-	endif ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+	include_directories(${GLES1_INCLUDE_DIRS})
 endif (GLES1_LIBRARIES)

 set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES})


Fixed an issue where glog was being treated as a cmake project during the configure process.

--- cmake/BuildExternalGLog.cmake
+++ cmake/BuildExternalGLog.cmake
@@ -20,7 +20,7 @@
 	UPDATE_COMMAND ""
 	SOURCE_DIR ${glog_source}
 	BINARY_DIR ${glog_binary}
-	CONFIGURE_COMMAND ${glog_configure}
+	CONFIGURE_COMMAND "${glog_configure}"
 	BUILD_COMMAND ${glog_build}
 	INSTALL_COMMAND ""
 )


other openmp link

other openmp link

--- cmake/Dependencies_core.cmake
+++ cmake/Dependencies_core.cmake
@@ -34,10 +34,10 @@

     #PackageHelperTarget(OpenMP::OpenMP_CXX OPENMP_FOUND)
     PackageHelper(OpenMP ${OPENMP_FOUND} "${OPENMP_INCLUDE_DIRS}" "${OpenMP_CXX_LIB_NAMES}")
-    # if(OPENMP_FOUND)
-    #   list(APPEND SAIGA_CXX_FLAGS ${OpenMP_CXX_FLAGS})
-    #   list(APPEND SAIGA_LD_FLAGS ${OpenMP_CXX_FLAGS})
-    # endif()
+     if(OPENMP_FOUND)
+       list(APPEND SAIGA_CXX_FLAGS ${OpenMP_CXX_FLAGS})
+       list(APPEND SAIGA_LD_FLAGS ${OpenMP_CXX_FLAGS})
+     endif()

     #        # This line doesn't work with nvcc + gcc8.3. Just uncomment it.
     #        if(SAIGA_CXX_GNU)


Restore support for samp-server-cli.bat script

--- cmake/FindSAMPServerCLI.cmake
+++ cmake/FindSAMPServerCLI.cmake
@@ -1,7 +1,8 @@
 include(FindPackageHandleStandardArgs)

 if(WIN32)
-  set(_SAMPServerCLI_EXECUTABLE_NAME samp-server-cli.exe)
+  set(_SAMPServerCLI_EXECUTABLE_NAME samp-server-cli.bat
+                                     samp-server-cli.exe)
 else()
   set(_SAMPServerCLI_EXECUTABLE_NAME samp-server-cli)
 endif()


Set python version in build name

Set python version in build name

--- cmake/circle_continuous.cmake
+++ cmake/circle_continuous.cmake
@@ -5,7 +5,7 @@

 set(test_group $ENV{TEST_GROUP})
 set(CTEST_SITE "CircleCI")
-set(CTEST_BUILD_NAME "Linux-$ENV{CIRCLE_BRANCH}-${test_group}")
+set(CTEST_BUILD_NAME "Linux-$ENV{CIRCLE_BRANCH}-$ENV{PYTHON_VERSION}-${test_group}")
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
 set(cfg_options
   -DPYTHON_COVERAGE=ON


CMake: mark CLCACHE_EXE as advanced.

CMake: mark CLCACHE_EXE as advanced.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -70,8 +70,13 @@

   set(CMAKE_REQUIRED_FLAGS ${_ORIGINAL_CMAKE_REQUIRED_FLAGS})

+  if(WIN32)
+    mark_as_advanced(CLCACHE_EXE)
+  else()
+    mark_as_advanced(CCACHE_EXE)
+  endif()
+
   mark_as_advanced(
-    CCACHE_EXE
     CLANG_TIDY_EXE
     CLANG_FORMAT_EXE
     FIND_EXE


Remove test for determining libXml2 capabilities.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -84,41 +84,6 @@
   find_package(LibXml2 REQUIRED)
 endif()

-# Try and determine what type of libxml2 we have found.  Required for knowing what answers
-# our tests need as the test answers differ on the version libXml2.
-set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
-set(_TEST_SRC "${libCellML_SOURCE_DIR}/cmake/test_libxml2.cpp")
-if(HAVE_LIBXML2_CONFIG)
-  set(_COMPILE_DEFINITIONS)
-  set(_LINK_DEFINITIONS LINK_LIBRARIES xml2)
-else()
-  set(_COMPILE_DEFINITIONS COMPILE_DEFINITIONS "-I${LIBXML2_INCLUDE_DIR}" "-I${PROJECT_BINARY_DIR}/src")
-  set(_LINK_DEFINITIONS LINK_LIBRARIES "${LIBXML2_LIBRARIES}")
-endif()
-try_run(RUN_TEST_LIBXML2_RESULT COMPILE_TEST_LIBXML2_RESULT
-        ${libCellML_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-        ${_TEST_SRC}
-        ${_COMPILE_DEFINITIONS}
-        ${_LINK_DEFINITIONS}
-        LINK_OPTIONS "${LIBXML2_LIBRARIES}"
-        COMPILE_OUTPUT_VARIABLE _COMPILE
-        RUN_OUTPUT_VARIABLE _OUTPUT)
-
-if(COMPILE_TEST_LIBXML2_RESULT AND RUN_TEST_LIBXML2_RESULT STREQUAL "0")
-  string(FIND "${_OUTPUT}" "cellml:units" _NAMESPACE_INDEX)
-  if(_NAMESPACE_INDEX STREQUAL "-1")
-    # libXml2 is not namespace aware.
-    set(HAVE_LIBXML2_NAMESPACE_AWARE FALSE)
-  else()
-    # libXml2 is namespace aware.
-    set(HAVE_LIBXML2_NAMESPACE_AWARE TRUE)
-  endif()
-else()
-  # Couldn't determine libXml2's knowledge of namespaces.
-  message(STATUS "Undetermined libXml2 namespace understanding.")
-  set(HAVE_LIBXML2_NAMESPACE_UNKNOWN TRUE)
-endif()
-
 if(CLANG_FORMAT_EXE AND GIT_EXE)
   set(CLANG_FORMAT_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executables required to run the ClangFormat test are available.")
 endif()


GMock: build CMake arguments in a single location

I.e. Don't Repeat Yourself (DRY).

--- cmake/modules/FindGMock.cmake
+++ cmake/modules/FindGMock.cmake
@@ -265,6 +265,9 @@
         set(GTEST_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
         set(GTEST_LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
     endif()
+    if(WIN32)
+        list(APPEND GTEST_CMAKE_ARGS -Dgtest_disable_pthreads=ON)
+    endif()

     if("${GMOCK_SRC_DIR}" STREQUAL "")
         message(STATUS "Downloading GMock / GTest version ${GMOCK_VER} from git")
@@ -285,7 +288,6 @@
                 LOG_CONFIGURE ON
                 LOG_BUILD ON
                 CMAKE_ARGS
-                    -Dgtest_disable_pthreads=${MINGW}
                     ${GTEST_CMAKE_ARGS}
                 BINARY_DIR ${GTEST_BIN_DIR}
                 BUILD_BYPRODUCTS
@@ -309,7 +311,6 @@
                 LOG_CONFIGURE ON
                 LOG_BUILD ON
                 CMAKE_ARGS
-                    -Dgtest_disable_pthreads=${MINGW}
                     ${GTEST_CMAKE_ARGS}
                 BINARY_DIR ${GMOCK_BIN_DIR}
                 BUILD_BYPRODUCTS
@@ -351,7 +352,6 @@
                 LOG_CONFIGURE ON
                 LOG_BUILD ON
                 CMAKE_ARGS
-                    -Dgtest_disable_pthreads=${MINGW}
                     ${GTEST_CMAKE_ARGS}
                 BINARY_DIR "${GMOCK_BIN_DIR}"
                 BUILD_BYPRODUCTS
@@ -412,7 +412,6 @@
             LOG_CONFIGURE ON
             LOG_BUILD ON
             CMAKE_ARGS
-                -Dgtest_disable_pthreads=${MINGW}
                 ${GTEST_CMAKE_ARGS}
             BINARY_DIR "${GMOCK_BIN_DIR}"
             BUILD_BYPRODUCTS


gpgme-config --cflags returns just a \n here, which causes an empty -I
in the compiler call.

svn path=/trunk/KDE/kdepim/; revision=529032

--- cmake/modules/FindGpgme.cmake
+++ cmake/modules/FindGpgme.cmake
@@ -20,6 +20,8 @@
       # problem: here I get two identical -I directives, and this ends up as one path with a space in the var...
       # so for now I just keep the first -Ifoo, but this might need to be fixed at some point...
       STRING(REGEX REPLACE "-I([^ ]*).*" "\\1" GPGME_INCLUDES "${GPGME_CFLAGS}")
+      # next problem: I get no -I directive here at all, and this ends up with an empty -I in the compiler call
+      STRING(REGEX REPLACE "\n" " " GPGME_INCLUDES "${GPGME_INCLUDES}")
     ENDIF (GPGME_CFLAGS)

     # ensure that they are cached


Sync GLibTools.cmake with Evolution-Data-Server

Receives latest improvements and fixes some compiler warnings from
the enum-generated code.

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -3,6 +3,11 @@
 # Provides functions to run glib tools.
 #
 # Functions:
+#
+# glib_mkenums_multiple(_output_filename_noext _define_name _enums_header ...)
+#    runs glib-mkenums to generate enumtypes .h and .c files from multiple
+#    _enums_header. It searches for files in the current source directory and
+#    exports to the current binary directory.
 #
 # glib_mkenums(_output_filename_noext _enums_header _define_name)
 #    runs glib-mkenums to generate enumtypes .h and .c files from _enums_header.
@@ -52,18 +57,18 @@
 	message(FATAL_ERROR "Cannot find glib-mkenums, which is required to build ${PROJECT_NAME}")
 endif(NOT GLIB_MKENUMS)

-function(glib_mkenums _output_filename_noext _enums_header _define_name)
+function(glib_mkenums_multiple _output_filename_noext _define_name _enums_header0)
 	set(HEADER_TMPL "
 /*** BEGIN file-header ***/
 #ifndef ${_define_name}
 #define ${_define_name}
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
 /*** END file-header ***/

 /*** BEGIN file-production ***/
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS

 /* Enumerations from \"@basename@\" */

@@ -76,6 +81,7 @@
 /*** END enumeration-production ***/

 /*** BEGIN file-tail ***/
+
 G_END_DECLS

 #endif /* ${_define_name} */
@@ -83,10 +89,14 @@

 	file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.h.tmpl" "${HEADER_TMPL}\n")

+	foreach(_enums_header ${_enums_header0} ${ARGN})
+		list(APPEND _enums_headers "${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}")
+	endforeach(_enums_header)
+
 	add_custom_command(
 		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
-		COMMAND ${GLIB_MKENUMS} --template "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.h.tmpl" "${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
-		DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}
+		COMMAND ${GLIB_MKENUMS} --template "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.h.tmpl" ${_enums_headers} >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
+		DEPENDS ${_enums_headers}
 	)

 set(SOURCE_TMPL "
@@ -104,7 +114,7 @@
 GType
 @enum_name@_get_type (void)
 {
-	static volatile gsize the_type__volatile = 0;
+	static gsize the_type__volatile = 0;

 	if (g_once_init_enter (&the_type__volatile)) {
 		static const G\@Type\@Value values[] = {
@@ -133,9 +143,13 @@

 	add_custom_command(
 		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
-		COMMAND ${GLIB_MKENUMS} --template "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.c.tmpl" "${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
-		DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}
-	)
+		COMMAND ${GLIB_MKENUMS} --template "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.c.tmpl" ${_enums_headers} >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
+		DEPENDS ${_enums_headers}
+	)
+endfunction(glib_mkenums_multiple)
+
+function(glib_mkenums _output_filename_noext _enums_header _define_name)
+	glib_mkenums_multiple (${_output_filename_noext} ${_define_name} ${_enums_header})
 endfunction(glib_mkenums)

 find_program(GLIB_GENMARSHAL glib-genmarshal)


Improved oce library detection

Improved oce library detection

--- contrib/FindOpenCASCADE.cmake
+++ contrib/FindOpenCASCADE.cmake
@@ -44,8 +44,8 @@
       set( _incsearchpath $ENV{CASROOT}\\inc $ENV{CASROOT}\\include\\oce)
       set( _testlibname TKernel.lib )
 	  set( _testdllname TKernel.dll )
-      set( _libsearchpath $ENV{CASROOT}\\win32\\lib $ENV{CASROOT}\\win${BITS}\\vc9\\lib $ENV{CASROOT}\\win${BITS}\\vc10\\lib C:\\OpenCASCADE6.3.0\\ros\\win32\\lib )
-	  set( _dllsearchpath $ENV{CASROOT}\\win32\\bin $ENV{CASROOT}\\win${BITS}\\vc9\\bin $ENV{CASROOT}\\win${BITS}\\vc10\\bin C:\\OpenCASCADE6.3.0\\ros\\win32\\bin )
+      set( _libsearchpath $ENV{CASROOT}\\win32\\lib $ENV{CASROOT}\\win${BITS}\\lib $ENV{CASROOT}\\win${BITS}\\vc9\\lib $ENV{CASROOT}\\win${BITS}\\vc10\\lib C:\\OpenCASCADE6.3.0\\ros\\win32\\lib )
+	  set( _dllsearchpath $ENV{CASROOT}\\win32\\bin $ENV{CASROOT}\\win${BITS}\\bin $ENV{CASROOT}\\win${BITS}\\vc9\\bin $ENV{CASROOT}\\win${BITS}\\vc10\\bin C:\\OpenCASCADE6.3.0\\ros\\win32\\bin )
     ELSE(WIN32)
       message( FATAL_ERROR "Unknown system! Exiting." )
     ENDIF (WIN32)


Fix indent.

Fix indent.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -18,7 +18,7 @@
         _lfs_CFLAGS
       ERROR_QUIET
       OUTPUT_STRIP_TRAILING_WHITESPACE
-  )
+    )
   else (CMAKE_SIZEOF_VOID_P MATCHES "8")
     # with large file support
     execute_process(


PARQUET-853: Pass PARQUET_BOOST_USE_SHARED to Arrow EP

Author: Korn, Uwe <Uwe.Korn@blue-yonder.com>

Closes #318 from xhochy/PARQUET-853 and squashes the following commits:

cb54dbc [Korn, Uwe] PARQUET-853: Pass PARQUET_BOOST_USE_SHARED to Arrow EP

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -552,6 +552,7 @@
     -DCMAKE_INSTALL_LIBDIR=${ARROW_LIB_DIR}
     -DARROW_JEMALLOC=OFF
     -DARROW_IPC=OFF
+    -DARROW_BOOST_USE_SHARED=${PARQUET_BOOST_USE_SHARED}
     -DARROW_BUILD_TESTS=OFF)

   if (MSVC)


Rename dldep_unix to dldep_ldd.

Rename dldep_unix to dldep_ldd.

	* build-aux/cmake/modules/DynLibDep.cmake: Here.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/DynLibDep.cmake
+++ build-aux/cmake/modules/DynLibDep.cmake
@@ -29,7 +29,7 @@

   # Puts respectively the name and the path of the binary _binary_ in
   # _list_names_ and _libthe dependent libraries of _binary_.
-  function(dldep_unix binary lib_names lib_paths)
+  function(dldep_ldd binary lib_names lib_paths)

     set(tools ldd)
     find_program(tool ${tools})
@@ -78,7 +78,7 @@
     set(${lib_names} ${_lib_names} PARENT_SCOPE)
     set(${lib_paths} ${_lib_paths} PARENT_SCOPE)

-  endfunction(dldep_unix)
+  endfunction(dldep_ldd)

   # Filter library names from _lib_names_ that match one of the regexp from
   # _exclusions_. Corresponding library paths from _lib_paths_ are stored in
@@ -119,7 +119,7 @@
   function(dldep binary outlist)

     if(UNIX)
-      dldep_unix(${binary} lib_names lib_paths)
+      dldep_ldd(${binary} lib_names lib_paths)
       dldep_filter(
 	"${lib_names}"
 	"${lib_paths}"


modules: updated FindMagnum.cmake.

modules: updated FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -550,11 +550,17 @@
             set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};")

             # Try to find both debug and release version. Dynamic and static
-            # debug libraries are in different places.
+            # debug libraries are in different places. Static debug plugins are
+            # in magnum/ with a -d suffix while dynamic debug plugins are in
+            # magnum-d/ with no suffix. Problem is that Vcpkg's library linking
+            # automagic needs the static libs to be in the root library
+            # directory along with everything else and so we need to search for
+            # the -d suffixed version *before* the unsuffixed so it doesn't
+            # pick the release library for both debug and release.
+            find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}-d
+                PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
             find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}
                 PATH_SUFFIXES magnum-d/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
-            find_library(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG ${_component}-d
-                PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
             find_library(MAGNUM_${_COMPONENT}_LIBRARY_RELEASE ${_component}
                 PATH_SUFFIXES magnum/${_MAGNUM_${_COMPONENT}_PATH_SUFFIX})
             mark_as_advanced(MAGNUM_${_COMPONENT}_LIBRARY_DEBUG


Run tests in current binary directory, not global source directory (#206)

Switch to CMAKE_CURRENT_BINARY_DIR for consistency with CTest

Signed-off-by: Dan Rose <2591e5f46f28d303f9dc027d475a5c60d8dea17a@digilabs.io>

--- ament_cmake_test/cmake/ament_add_test.cmake
+++ ament_cmake_test/cmake/ament_add_test.cmake
@@ -30,11 +30,11 @@
 # :param TIMEOUT: the test timeout in seconds, default: 60
 # :type TIMEOUT: integer
 # :param WORKING_DIRECTORY: the working directory for invoking the
-#   command in, default: CMAKE_SOURCE_DIR
+#   command in, default: CMAKE_CURRENT_BINARY_DIR
 # :type WORKING_DIRECTORY: string
 # :param GENERATE_RESULT_FOR_RETURN_CODE_ZERO: generate a test result
 #   file when the command invocation returns with code zero
-#   command in, default: CMAKE_SOURCE_DIR
+#   command in, default: FALSE
 # :type GENERATE_RESULT_FOR_RETURN_CODE_ZERO: option
 # :param SKIP_TEST: if set mark the test as being skipped
 # :type SKIP_TEST: option
@@ -77,7 +77,7 @@
       "valid number and greater than zero")
   endif()
   if(NOT ARG_WORKING_DIRECTORY)
-    set(ARG_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
+    set(ARG_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
   endif()

   # wrap command with run_test script to ensure test result generation


- Removed year from copyright header

- Removed year from copyright header

--- modules.cmake
+++ modules.cmake
@@ -1,6 +1,6 @@
 #
 # Clever programming language
-# Copyright (c) 2011-2012 Clever Team
+# Copyright (c) Clever Team
 #
 # modules.cmake - Module options and other stuff
 #


Fix flags

Fix flags

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -86,6 +86,20 @@
 ###########################################
 # Configure headless build
 OPTION(BUILD_HEADLESS "Build SCIRun without GUI." OFF)
+
+###########################################
+# Travis CI build needs to be as slim as possible
+OPTION(TRAVIS_BUILD "Slim build for Travis CI" OFF)
+MARK_AS_ADVANCED(TRAVIS_BUILD)
+
+IF(TRAVIS_BUILD)
+  SET(BUILD_TESTING OFF)
+  SET(DOWNLOAD_TOOLKITS OFF)
+  SET(BUILD_HEADLESS ON)
+  SET(BUILD_WITH_PYTHON OFF)
+  SET(REGENERATE_MODULE_FACTORY_CODE OFF)
+  SET(GENERATE_MODULE_FACTORY_CODE OFF)
+ENDIF()

 ###########################################
 # Configure Qt
@@ -122,11 +136,6 @@
 MARK_AS_ADVANCED(REGENERATE_MODULE_FACTORY_CODE)

 ###########################################
-# Travis CI build needs to be as slim as possible
-OPTION(TRAVIS_BUILD "Slim build for Travis CI" OFF)
-MARK_AS_ADVANCED(TRAVIS_BUILD)
-
-###########################################
 # Configure externals

 SET( SCIRun_DEPENDENCIES )
@@ -171,26 +180,6 @@
   EXTERNAL_TOOLKIT(FwdInvToolkit)
 ENDIF()

-IF(TRAVIS_BUILD)
-SET(SCIRUN_CACHE_ARGS
-    "-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF"
-    "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
-    "-DSCIRUN_BINARY_DIR:PATH=${SCIRUN_BINARY_DIR}"
-    "-DSCIRUN_BITS:STRING=${SCIRUN_BITS}"
-    "-DBUILD_TESTING:BOOL=OFF"
-    "-DBUILD_DOCUMENTATION:BOOL=OFF"
-    "-DDOWNLOAD_TOOLKITS:BOOL=OFF"
-    "-DBUILD_HEADLESS:BOOL=ON"
-    "-DBUILD_WITH_PYTHON:BOOL=OFF"
-    "-DWITH_TETGEN:BOOL=OFF"
-    "-DREGENERATE_MODULE_FACTORY_CODE:BOOL=OFF"
-    "-DGENERATE_MODULE_FACTORY_CODE:BOOL=OFF"
-    "-DZlib_DIR:PATH=${Zlib_DIR}"
-    "-DSQLite_DIR:PATH=${SQLite_DIR}"
-    "-DBoost_DIR:PATH=${Boost_DIR}"
-    "-DTeem_DIR:PATH=${Teem_DIR}"
-)
-ELSE(TRAVIS_BUILD)
 SET(SCIRUN_CACHE_ARGS
     "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
     "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
@@ -212,7 +201,6 @@
     "-DTetgen_DIR:PATH=${Tetgen_DIR}"
     "-DFreetype_DIR:PATH=${Freetype_DIR}"
 )
-ENDIF(TRAVIS_BUILD)

 IF(BUILD_WITH_PYTHON)
   LIST(APPEND SCIRUN_CACHE_ARGS


Add compiler name if front of travis build

--- Testing/travis_script.cmake
+++ Testing/travis_script.cmake
@@ -31,7 +31,7 @@
 set(CTEST_BUILD_FLAGS "-j4")

 # Build name referenced in cdash
-set(CTEST_BUILD_NAME "travis-ci-$ENV{TRAVIS_OS_NAME}-x64-${lower_mercury_build_configuration}-$ENV{TRAVIS_BUILD_NUMBER}")
+set(CTEST_BUILD_NAME "travis-ci-$ENV{TRAVIS_OS_NAME}-x64-$ENV{CC}-${lower_mercury_build_configuration}-$ENV{TRAVIS_BUILD_NUMBER}")

 # Build shared libraries
 set(mercury_build_shared ON)


Fix typo in cmake message

Fix typo in cmake message

--- src/cmake/modules/FindOpenImageIO.cmake
+++ src/cmake/modules/FindOpenImageIO.cmake
@@ -73,7 +73,7 @@
     message ( STATUS "OpenImageIO includes     = ${OPENIMAGEIO_INCLUDE_DIR}" )
     message ( STATUS "OpenImageIO libraries    = ${OPENIMAGEIO_LIBRARIES}" )
     message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
-    message ( STATUS "OpenImageIO oiiiotool    = ${OIIOTOOL_BIN}" )
+    message ( STATUS "OpenImageIO oiiotool     = ${OIIOTOOL_BIN}" )
 endif ()

 include (FindPackageHandleStandardArgs)


Snapshot

Snapshot

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -242,6 +242,7 @@
 add_target(PHP php)
 add_target(PIXMAN pixman)
 add_target(PKG_CONFIG pkg-config)
+add_target(PRETTY_KIT pretty_kit)
 add_target(PROTOBUF protobuf)
 add_target(PROTOC protoc)
 add_target(PROXY_LIBINTL proxy-libintl)
@@ -509,6 +510,7 @@
 set_libraries(opencv_videostab ${OPENCV_LIB_DIR} opencv_videostab)
 set_libraries(openmp ${OPENMP_PREFIX}/lib iomp5)
 set_libraries(openssl ${OPENSSL_PREFIX}/lib crypto ssl)
+set_libraries(pretty_kit ${PRETTY_KIT_PREFIX}/lib pretty_kit)
 set_libraries(protobuf ${PROTOBUF_PREFIX}/lib protobuf)
 set_libraries(readline ${READLINE_PREFIX}/lib readline history)
 set_libraries(shark ${SHARK_PREFIX}/lib shark)
@@ -675,6 +677,9 @@
 set_include_directories(opencv ${OPENCV_PREFIX}/include)
 set_include_directories(openmp ${OPENMP_PREFIX}/include)
 set_include_directories(openssl ${OPENSSL_PREFIX}/include)
+set_include_directories(
+    pretty_kit ${PRETTY_KIT_PREFIX}/include ${PRETTY_KIT_PREFIX}/include/PrettyKit
+    ${PRETTY_KIT_PREFIX}/include/PrettyKit/Cells)
 set_include_directories(protobuf ${PROTOBUF_PREFIX}/include)
 set_include_directories(readline ${READLINE_PREFIX}/include)
 set_include_directories(shark ${SHARK_PREFIX}/include)
@@ -1686,11 +1691,15 @@
       tar --strip-components 1 -xvf
           ${HAPROXY_PREFIX}/download/haproxy-1.5-dev22.tar.gz
   CONFIGURE_COMMAND ${NOP}
-  BUILD_COMMAND make TARGET=osx CPU_CFLAGS=${CMAKE_C_FLAGS}
-      USE_PCRE=1 USE_OPENSSL=1 USE_LIBCRYPT= USE_ZLIB=1
+  BUILD_COMMAND
+      make TARGET=osx CPU_CFLAGS=${CMAKE_C_FLAGS}
+      CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
+      USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_LIBCRYPT= USE_ZLIB=1
+      SSL_INC=${OPENSSL_PREFIX}/include SSL_LIB=${OPENSSL_PREFIX}/lib
+      PCRE_INC=${PCRE_PREFIX}/include PCRE_LIB=${PCRE_PREFIX}/lib
   INSTALL_COMMAND
       echo "This will install haproxy in /usr/local/haproxy." &&
-      sudo make install DESTDIR=${HAPROXY_PREFIX} &&
+      make install DESTDIR=${HAPROXY_PREFIX} &&
       sudo ${CMAKE_COMMAND} -E make_directory /usr/local/haproxy &&
       sudo ditto ${HAPROXY_PREFIX}/usr/local/doc /usr/local/haproxy/doc &&
       sudo ditto ${HAPROXY_PREFIX}/usr/local/sbin /usr/local/haproxy/sbin &&
@@ -1698,6 +1707,8 @@
       sudo rm -rf ${HAPROXY_PREFIX}/usr &&
       sudo ${CMAKE_COMMAND} -E make_directory /usr/local/haproxy/logs
   BUILD_IN_SOURCE 1)
+add_dependencies(${HAPROXY_TARGET} ${OPENSSL_TARGET})
+add_dependencies(${HAPROXY_TARGET} ${PCRE_TARGET})

 ################################################################################
 # httpd.
@@ -2890,7 +2901,7 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${PCRE_PREFIX}/download/pcre-8.33.tar.bz2
-  CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PCRE_PREFIX})
+  CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PCRE_PREFIX} --enable-jit)
 add_install_name_step(PCRE)

 ################################################################################
@@ -3029,6 +3040,46 @@
   CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PKG_CONFIG_PREFIX})

 ################################################################################
+# PrettyKit.
+set(DOWNLOAD_TARGET ${PRETTY_KIT_TARGET}_download)
+add_external_project(
+  ${DOWNLOAD_TARGET}
+  PREFIX ${PRETTY_KIT_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --depth 1 git://github.com/QuentinFiard/PrettyKit.git
+          ${DOWNLOAD_TARGET}
+  CONFIGURE_COMMAND ${NOP}
+  BUILD_COMMAND ${NOP}
+  INSTALL_COMMAND
+    cd <SOURCE_DIR> &&
+    ${CMAKE_COMMAND} -E make_directory ${PRETTY_KIT_PREFIX}/include &&
+    find PrettyKit -name "*.h" |
+    cpio -dp ${PRETTY_KIT_PREFIX}/include)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} INSTALL_DIR)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} SOURCE_DIR)
+set(SOURCE_DIR ${SOURCE_DIR}/PrettyKit)
+set(SRCS
+    ${SOURCE_DIR}/Cells/PrettyCustomViewTableViewCell.m
+    ${SOURCE_DIR}/Cells/PrettyGridTableViewCell.m
+    ${SOURCE_DIR}/Cells/PrettySegmentedControlTableViewCell.m
+    ${SOURCE_DIR}/Cells/PrettyTableViewCell.m
+    ${SOURCE_DIR}/PrettyDrawing.m
+    ${SOURCE_DIR}/PrettyNavigationBar.m
+    ${SOURCE_DIR}/PrettyShadowPlainTableview.m
+    ${SOURCE_DIR}/PrettyTabBar.m
+    ${SOURCE_DIR}/PrettyToolbar.m)
+set_source_files_properties(${SRCS} PROPERTIES GENERATED TRUE)
+objc_library(${PRETTY_KIT_TARGET} ${SRCS})
+set_target_properties(
+    ${PRETTY_KIT_TARGET} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
+    LIBRARY_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
+    COMPILE_FLAGS -fno-objc-arc
+    OUTPUT_NAME pretty_kit)
+target_include_directories(${PRETTY_KIT_TARGET} PUBLIC ${SOURCE_DIR})
+add_dependencies(${PRETTY_KIT_TARGET} ${DOWNLOAD_TARGET})
+
+################################################################################
 # protobuf - Google's Protocol Buffers library.
 add_external_project(
   ${PROTOBUF_TARGET}
@@ -3178,36 +3229,34 @@

 ################################################################################
 # SWRevealViewController.
-if (IS_IOS)
-  set(DOWNLOAD_TARGET ${SW_REVEAL_VIEW_CONTROLLER_TARGET}_download)
-  add_external_project(
-    ${DOWNLOAD_TARGET}
-    PREFIX ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}
-    DOWNLOAD_COMMAND
-        ${GIT} clone --depth 1 git://github.com/John-Lluch/SWRevealViewController.git
-            ${DOWNLOAD_TARGET}
-    CONFIGURE_COMMAND echo ""
-    BUILD_COMMAND echo ""
-    INSTALL_COMMAND
-      cd <SOURCE_DIR> &&
-      ${CMAKE_COMMAND} -E make_directory ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}/include &&
-      find SWRevealViewController -name "*.h" |
-      cpio -dp ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}/include)
-  ExternalProject_Get_Property(${DOWNLOAD_TARGET} INSTALL_DIR)
-  ExternalProject_Get_Property(${DOWNLOAD_TARGET} SOURCE_DIR)
-  set(SOURCE_DIR ${SOURCE_DIR}/SWRevealViewController)
-  set(SRCS ${SOURCE_DIR}/SWRevealViewController.h
-      ${SOURCE_DIR}/SWRevealViewController.m)
-  set_source_files_properties(${SRCS} PROPERTIES GENERATED TRUE)
-  add_custom_command(OUTPUT ${SRCS} COMMAND echo "")
-  objc_library(${SW_REVEAL_VIEW_CONTROLLER_TARGET} ${SRCS})
-  set_target_properties(
-      ${SW_REVEAL_VIEW_CONTROLLER_TARGET} PROPERTIES
-      ARCHIVE_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
-      LIBRARY_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
-      OUTPUT_NAME sw_reveal_view_controller)
-  add_dependencies(${SW_REVEAL_VIEW_CONTROLLER_TARGET} ${DOWNLOAD_TARGET})
-endif ()
+set(DOWNLOAD_TARGET ${SW_REVEAL_VIEW_CONTROLLER_TARGET}_download)
+add_external_project(
+  ${DOWNLOAD_TARGET}
+  PREFIX ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --depth 1 git://github.com/John-Lluch/SWRevealViewController.git
+          ${DOWNLOAD_TARGET}
+  CONFIGURE_COMMAND echo ""
+  BUILD_COMMAND echo ""
+  INSTALL_COMMAND
+    cd <SOURCE_DIR> &&
+    ${CMAKE_COMMAND} -E make_directory ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}/include &&
+    find SWRevealViewController -name "*.h" |
+    cpio -dp ${SW_REVEAL_VIEW_CONTROLLER_PREFIX}/include)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} INSTALL_DIR)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} SOURCE_DIR)
+set(SOURCE_DIR ${SOURCE_DIR}/SWRevealViewController)
+set(SRCS ${SOURCE_DIR}/SWRevealViewController.h
+    ${SOURCE_DIR}/SWRevealViewController.m)
+set_source_files_properties(${SRCS} PROPERTIES GENERATED TRUE)
+add_custom_command(OUTPUT ${SRCS} COMMAND echo "")
+objc_library(${SW_REVEAL_VIEW_CONTROLLER_TARGET} ${SRCS})
+set_target_properties(
+    ${SW_REVEAL_VIEW_CONTROLLER_TARGET} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
+    LIBRARY_OUTPUT_DIRECTORY ${INSTALL_DIR}/lib
+    OUTPUT_NAME sw_reveal_view_controller)
+add_dependencies(${SW_REVEAL_VIEW_CONTROLLER_TARGET} ${DOWNLOAD_TARGET})

 ################################################################################
 # TBB.


Add again file on Windows

Add again file on Windows

File was deleted when the ALL CAPS version was deleted.

--- UDPReader/cmake/modules/FindAllegro.cmake
+++ UDPReader/cmake/modules/FindAllegro.cmake
@@ -1,5 +1,6 @@
 # FindAllegro
 # -----------
+# Copyright (c) 2018 Rodolfo Lam. All Rights Reserved.
 #
 # Finds the Allegro 5 Library... or at least tries.
 #
@@ -35,4 +36,4 @@
 		Allegro_LIBRARY
 		Allegro_INCLUDE_DIR
 	VERSION_VAR Allegro_VERSION
-)+)


Extend windows glob to exclude quantization_utils in CMakeLists. Change: 136507062

--- tensorflow/contrib/cmake/tf_core_kernels.cmake
+++ tensorflow/contrib/cmake/tf_core_kernels.cmake
@@ -90,8 +90,8 @@
       "${tensorflow_source_dir}/tensorflow/core/kernels/immutable_constant_op.h"
       "${tensorflow_source_dir}/tensorflow/core/kernels/sparse_matmul_op.cc"
       "${tensorflow_source_dir}/tensorflow/core/kernels/sparse_matmul_op.h"
-      "${tensorflow_source_dir}/tensorflow/core/kernels/quantize*.h"
-      "${tensorflow_source_dir}/tensorflow/core/kernels/quantize*.cc"
+      "${tensorflow_source_dir}/tensorflow/core/kernels/quantiz*.h"
+      "${tensorflow_source_dir}/tensorflow/core/kernels/quantiz*.cc"
   )
   list(REMOVE_ITEM tf_core_kernels_srcs ${tf_core_kernels_windows_exclude_srcs})
 endif(WIN32)


[CMake] install: adding more stuff to be able to find commits when the git history will change

Former-commit-id: a3185b879208e85a0d72ee7c883f776c7f8346f3

--- SofaFramework/SofaMacros.cmake
+++ SofaFramework/SofaMacros.cmake
@@ -254,6 +254,10 @@
 "
     find_package(Git REQUIRED)

+    # the current commit hash should be enough
+    # except if the git history changes...
+    # so adding more stuff to be sure
+
     # get the current working branch
     execute_process(
       COMMAND \${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
@@ -262,27 +266,19 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE
     )

-    # get the current commit hash
+    # get the current commit info (hash, author, date, comment)
     execute_process(
-      COMMAND \${GIT_EXECUTABLE} rev-parse -q HEAD
+      COMMAND \${GIT_EXECUTABLE} log --format=medium -n 1
       WORKING_DIRECTORY ${sourcedir}
-      OUTPUT_VARIABLE SOFA_GIT_HASH
+      OUTPUT_VARIABLE SOFA_GIT_INFO
       OUTPUT_STRIP_TRAILING_WHITESPACE
     )

-    # get the current commit date
-    execute_process(
-      COMMAND \${GIT_EXECUTABLE} show -s --format=%ci
-      WORKING_DIRECTORY ${sourcedir}
-      OUTPUT_VARIABLE SOFA_GIT_DATE
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-
     string( TOLOWER \"${name}\" name_lower )
     if( name_lower STREQUAL \"sofa\" )
-        file(WRITE \"${CMAKE_INSTALL_PREFIX}/git.version\" \"${name}: \${SOFA_GIT_BRANCH} \${SOFA_GIT_HASH} \${SOFA_GIT_DATE} \n\" )
+        file(WRITE  \"${CMAKE_INSTALL_PREFIX}/git.version\" \"######## ${name} ########\nBranch: \${SOFA_GIT_BRANCH}\n\${SOFA_GIT_INFO}\n############\n\n\" )
     else()
-        file(APPEND \"${CMAKE_INSTALL_PREFIX}/git.version\" \"${name}: \${SOFA_GIT_BRANCH} \${SOFA_GIT_HASH} \${SOFA_GIT_DATE} \n\" )
+        file(APPEND \"${CMAKE_INSTALL_PREFIX}/git.version\" \"######## ${name} ########\nBranch: \${SOFA_GIT_BRANCH}\n\${SOFA_GIT_INFO}\n############\n\n\" )
     endif()
 "
 )


Set HDF5_C_LIBRARIES

Set HDF5_C_LIBRARIES

This is used by ISMRMRD. If we don't set it, it seems that it can find
an unrelated HDF5 version, causing problems.

--- SuperBuild/External_HDF5.cmake
+++ SuperBuild/External_HDF5.cmake
@@ -92,6 +92,7 @@
       set(HDF5_CMAKE_ARGS
          -DHDF5_INCLUDE_DIRS:PATH=${HDF5_INCLUDE_DIRS}
          -DHDF5_LIBRARIES:STRING=${HDF5_LIBRARIES}
+         -DHDF5_C_LIBRARIES:STRING=${HDF5_C_LIBRARY_hdf5}
          -DHDF5_FIND_DEBUG:BOOL=ON
       )
       if (HDF5_ROOT)


minor clean-up for SWIG

minor clean-up for SWIG

--- SuperBuild/External_SWIG.cmake
+++ SuperBuild/External_SWIG.cmake
@@ -1,6 +1,6 @@
 #This needs to be unique globally
 set(proj SWIG)
-set(proj_COMPONENTS "COMPONENTS single")
+
 # Set dependency list
 set(${proj}_DEPENDENCIES "")

@@ -37,9 +37,6 @@
     INSTALL_DIR ${SWIG_Install_Dir}
   )

-#The SWIG test-suite and examples are configured for the following languages:
-#perl5 python
-
   set( SWIG_EXECUTABLE ${SWIG_Install_Dir}/bin/swig )
   set( SWIG_VERSION "3.0.12" )
   #set( SWIG_ROOT ${FFTW_Install_Dir} )


Add additional boost libraries to build.

--- Superbuild/BoostExternal.cmake
+++ Superbuild/BoostExternal.cmake
@@ -48,7 +48,9 @@
   "date_time"
   "exception"
   "filesystem"
+  "program_options"
   "regex"
+  "serialization"
   "system"
   "thread"
   CACHE INTERNAL "Boost library name.")


DISCODE_FIND_DCL macro - first working version

Tries to find dcl with given name in DCL folder (DISCODE_DCL_DIR
must be set as enviroment variable). If search is successful, then
dist/include folder is added to include path.

TODO: Expand to include DCL config file.

--- share/DisCODeMacros.cmake
+++ share/DisCODeMacros.cmake
@@ -37,33 +37,34 @@

     ELSE( DISCODE_${DCL_NAME}_FOUND )

-        IF (not DISCODE_DCL_DIR)
+        IF (NOT DEFINED DISCODE_DCL_DIR)
             MESSAGE(STATUS "Looking for DISCODE_DCL_DIR...")
             SET(DISCODE_DCL_DIR $ENV{DISCODE_DCL_DIR})
-        ENDIF (not DISCODE_DCL_DIR)
+        ENDIF (NOT DEFINED DISCODE_DCL_DIR)

         # if DISCODE_DCL_DIR is not set
-        IF( ${DISCODE_DCL_DIR} == "" )
-            UNSET( DISCODE_DCL_DIR)
+        IF( DISCODE_DCL_DIR STREQUAL "" OR NOT DEFINED DISCODE_DCL_DIR)
+            UNSET( DISCODE_DCL_DIR )
             MESSAGE(FATAL_ERROR "DISCODE_DCL_DIR not set!")
-        ELSE( DISCODE_DCL_DIR == "" )
-            MESSAGE(STATUS "DISCODE_DCL_DIR=${DISCODE_DCL_DIR}")
+        ELSE( DISCODE_DCL_DIR STREQUAL "" OR NOT DEFINED DISCODE_DCL_DIR)
+            MESSAGE(STATUS "DISCODE_DCL_DIR=[${DISCODE_DCL_DIR}]")
             MESSAGE(STATUS "Looking for ${DCL_NAME} DCL...")

             # check, if there is proper directory in DCL folder
             IF(EXISTS ${DISCODE_DCL_DIR}/${DCL_NAME})

-
+                MESSAGE(STATUS "${DCL_NAME} found.")
+                SET( DISCODE_${DCL_NAME}_FOUND 1 CACHE INTERNAL "${DCL_NAME} already found")

             ENDIF(EXISTS ${DISCODE_DCL_DIR}/${DCL_NAME})

-        ENDIF( DISCODE_DCL_DIR == "" )
+        ENDIF( DISCODE_DCL_DIR STREQUAL "" OR NOT DEFINED DISCODE_DCL_DIR)

     ENDIF( DISCODE_${DCL_NAME}_FOUND )

     # second check, if found then add apropriate include dirs
     IF( DISCODE_${DCL_NAME}_FOUND )
-
+        INCLUDE_DIRECTORIES(${DISCODE_DCL_DIR}/${DCL_NAME}/dist/include)
     ELSE( DISCODE_${DCL_NAME}_FOUND )
         MESSAGE(FATAL_ERROR "Couldn't find ${DCL_NAME} DCL!")
     ENDIF( DISCODE_${DCL_NAME}_FOUND )


Remove warnings building LZMA

Remove warnings building LZMA

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -93,12 +93,17 @@
     set(LZMA_LIBRARIES ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/lib/liblzma.lib)
     set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/include)
   else()
+    if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+      set(LZMA_CFLAGS "-Wno-format-nonliteral")
+    elseif( CMAKE_CCC_COMPILER_ID STREQUAL Intel)
+      set(LZMA_CFLAGS "-wd188 -wd181 -wd1292 -wd10006 -wd10156 -wd2259 -wd981 -wd128")
+    endif()
     ExternalProject_Add(
       LZMA
       URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}.tar.gz
       URL_MD5 858405e79590e9b05634c399497f4ba7
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --with-pic --disable-shared
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --with-pic --disable-shared CFLAGS=${LZMA_CFLAGS}
       BUILD_IN_SOURCE 1)
     set(LZMA_LIBRARIES -L${CMAKE_BINARY_DIR}/lib -llzma)
     set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)


Disable builtin_vc as well if its requirements are unsatisfied

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1224,25 +1224,29 @@
   endif()
 endif()

-#---Check for vc and its compatibility-----------------------------------------------
-if(vc)
+#---Check for Vc compatibility-----------------------------------------------------------
+if(vc OR builtin_vc)
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
-      message(STATUS "VC requires GCC version >= 4.5; switching OFF 'vc' option")
+      message(STATUS "Vc requires GCC version >= 4.5; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
+      set(builtin_vc OFF CACHE BOOL "" FORCE)
     endif()
   elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     if ( APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4)
-      message(STATUS "VC requires Apple Clang version >= 4.0; switching OFF 'vc' option")
+      message(STATUS "Vc requires Apple Clang version >= 4.0; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
+      set(builtin_vc OFF CACHE BOOL "" FORCE)
     elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
-      message(STATUS "VC requires Clang version >= 3.1; switching OFF 'vc' option")
+      message(STATUS "Vc requires Clang version >= 3.1; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
+      set(builtin_vc OFF CACHE BOOL "" FORCE)
     endif()
   elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
     if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)  # equivalent to MSVC 2010
-      message(STATUS "VC requires MSVC version >= 2011; switching OFF 'vc' option")
+      message(STATUS "Vc requires MSVC version >= 2011; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
+      set(builtin_vc OFF CACHE BOOL "" FORCE)
     endif()
   endif()
 endif()


Removed unused CMake file

Removed unused CMake file

--- deps/ox/cmake/Modules/FindJansson.cmake
+++ deps/ox/cmake/Modules/FindJansson.cmake
@@ -1,49 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# - Try to find Jansson
-# Once done this will define
-#  JANSSON_FOUND - System has Jansson
-#  JANSSON_INCLUDE_DIRS - The Jansson include directories
-#  JANSSON_LIBRARIES - The libraries needed to use Jansson
-#  JANSSON_DEFINITIONS - Compiler switches required for using Jansson
-
-find_path(JANSSON_INCLUDE_DIR jansson.h
-	PATHS
-		/usr/include
-		/usr/local/include
-)
-
-find_library(JANSSON_LIBRARY
-	NAMES
-		jansson
-	PATHS
-		/usr/lib
-		/usr/local/lib
-)
-
-set(JANSSON_LIBRARIES ${JANSSON_LIBRARY})
-set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(Jansson DEFAULT_MSG
-                                  JANSSON_LIBRARY JANSSON_INCLUDE_DIR)
-
-mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY)


removed code as suggested here: https://github.com/onqtam/doctest/pull/527#issuecomment-930592678

--- scripts/cmake/doctestAddTests.cmake
+++ scripts/cmake/doctestAddTests.cmake
@@ -11,10 +11,6 @@
 set(script)
 set(suite)
 set(tests)
-
-if(NOT DEFINED ${add_labels})
-    set(add_labels 0)
-endif()

 function(add_command NAME)
   set(_args "")


Update cv-utils git tag

Update cv-utils git tag

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -519,8 +519,8 @@

   ExternalProject_Add(cv-utils
-    GIT_REPOSITORY https://github.com/patmarion/cv-utils
-    GIT_TAG 6671b92
+    GIT_REPOSITORY https://github.com/patmarion/cv-utils.git
+    GIT_TAG 9ee0128
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
     DEPENDS


Fix export bug for Win32 in CMake config

--- sequoia-engine/cmake/AddBoost.cmake
+++ sequoia-engine/cmake/AddBoost.cmake
@@ -25,14 +25,29 @@
   set(Boost_USE_STATIC_RUNTIME OFF)
 endif()

-set(SEQUOIA_BOOST_COMPONENTS filesystem system program_options)
-find_package(Boost 1.58 COMPONENTS ${SEQUOIA_BOOST_COMPONENTS} REQUIRED)
+set(boost_components filesystem system program_options)
+find_package(Boost 1.58 COMPONENTS ${boost_components} REQUIRED)
+
+if(WIN32)
+  # We filter the libraries manually as we want to export these libraries in the CMake install
+  # config and ```Boost_LIBRARIES`` contains optimized/debug keywords.
+  foreach(component ${boost_components})
+    string(TOUPPER ${component} component_upper)
+    if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+      list(APPEND boost_libs ${Boost_${component_upper}_LIBRARY_DEBUG})
+    else()
+      list(APPEND boost_libs ${Boost_${component_upper}_LIBRARY_RELEASE})
+    endif()
+  endforeach()
+else()
+  set(boost_libs ${Boost_LIBRARIES})
+endif()

 sequoia_export_package(
   NAME Boost
   FOUND ${Boost_FOUND}
   VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}"
-  LIBRARIES ${Boost_LIBRARIES}
+  LIBRARIES ${boost_libs}
   INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
   DEFINITIONS -DBOOST_ALL_NO_LIB
 )


gettext: Add autogen step

gettext: Add autogen step

--- packages/gettext.cmake
+++ packages/gettext.cmake
@@ -11,3 +11,11 @@
     INSTALL_COMMAND ${MAKE} install
     LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
 )
+
+ExternalProject_Add_Step(gettext autogen
+    DEPENDEES download update
+    DEPENDERS configure
+    COMMAND ${EXEC} ./autogen.sh -V
+    WORKING_DIRECTORY <SOURCE_DIR>
+    LOG 1
+)


MOD: Added cmake project dependencies of SampleFramework to the Sample projects

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -336,11 +336,15 @@
 # Define a CEGUI sample app
 #
 macro (cegui_add_sample _NAME)
+    add_dependencies(${CEGUI_TARGET_NAME} ${CEGUI_SAMPLEFRAMEWORK_EXENAME}
+                            ${CEGUI_TARGET_NAME} ${_NAME}${CEGUI_SLOT_VERSION}
+    )
+
     set (CEGUI_TARGET_NAME ${_NAME}${CEGUI_SLOT_VERSION})

     include_directories(${CMAKE_SOURCE_DIR}/samples/common/include)

-
+

     if (CEGUI_SAMPLES_USE_DIRECT3D9 OR CEGUI_SAMPLES_USE_DIRECT3D10 OR CEGUI_SAMPLES_USE_DIRECT3D11)
         link_directories(${DIRECTXSDK_LIBRARY_DIR})
@@ -352,6 +356,9 @@
 		${CMAKE_SOURCE_DIR}/samples/common/include/Sample.h
 		${CMAKE_SOURCE_DIR}/samples/common/include/SampleBase.h
 	)
+
+
+

     ###########################################################################
     #                   Dynamically Linked Library


CMake: improved parsing of fastjet-config params

Fixes ALPHY-20

--- cmake/FindFASTJET.cmake
+++ cmake/FindFASTJET.cmake
@@ -14,9 +14,11 @@
 # **************************************************************************

 # AliRoot Build System Module to find and configure FASTJET
-# Author: Marco van Leeuwen
+# Authors: Marco van Leeuwen, Dario Berzano
 # FastJet installation is pointed during cmake configuration -DFASTJET
+#
 # Variables set during Find:
+#
 # - FASTJET_CONFIG - fastjet-config location
 # - FASTJET_VERSION
 # - FASTJET_VERSION_MAJOR
@@ -26,11 +28,12 @@
 # - FASTJET_LIBS_DIR - fastjet libraries location
 # - FASTJET_DEFINITIONS - fastjet definition flags
 # - FASTJET_CXXFLAGS - fastjet compilation flags
-# - FASTJET_LIBS - fastjet libraries - array
+# - FASTJET_LIBS - fastjet libraries (list)

 set(FASTJET_FOUND FALSE)

 if(FASTJET)
+
     # Check for fastjet-config script
     find_program(FASTJET_CONFIG NAMES fastjet-config PATHS ${FASTJET}/bin NO_DEFAULT_PATH)
     if(NOT FASTJET_CONFIG)
@@ -42,14 +45,14 @@
     find_path(FASTJETHH include/fastjet/PseudoJet.hh PATHS ${FASTJET})

     if (FASTJETHH-NOTFOUND)
-        message(FATAL_ERROR "Header file fastjet/PseudoJet.hh not found in ${FASTJET}/include. Please check your FASTJET installation")
+        message(FATAL_ERROR "Header file fastjet/PseudoJet.hh not found in ${FASTJET}/include. Please check your FastJet installation")
     endif(FASTJETHH-NOTFOUND)
     mark_as_advanced(FASTJETHH)

     # FastJet version
-    execute_process(COMMAND ${FASTJET_CONFIG} --version OUTPUT_VARIABLE FASTJET_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    execute_process(COMMAND ${FASTJET_CONFIG} --version OUTPUT_VARIABLE FASTJET_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(error)
-        message(FATAL_ERROR "Error retrieving FastJet version : ${error}")
+        message(FATAL_ERROR "Error retrieving FastJet version: ${error}")
     endif(error)

     # Extract major, minor, and patch versions from
@@ -62,11 +65,11 @@
     endif()

     if(FASTJET_VERSION_MINOR GREATER 0)
-        message(FATAL_ERROR "FastJet ${FASTJET_VERSION_MAJOR}.${FASTJET_VERSION_MINOR}.${FASTJET_VERSION_PATCH} version is not suported.  Please install a version >= 3.0.*")
+        message(FATAL_ERROR "FastJet ${FASTJET_VERSION_MAJOR}.${FASTJET_VERSION_MINOR}.${FASTJET_VERSION_PATCH} version is not suported. Please install a version >= 3.0.*")
     endif()

     # Extracting compilation flags
-    execute_process(COMMAND ${FASTJET_CONFIG} --cxxflags OUTPUT_VARIABLE FASTJET_CXXFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    execute_process(COMMAND ${FASTJET_CONFIG} --cxxflags OUTPUT_VARIABLE FASTJET_CXXFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(error)
         message(FATAL_ERROR "Error retrieving FastJet compilation flags : ${error}")
     endif(error)
@@ -74,45 +77,44 @@
     # Extracting the include path from the CXX flags
     set(FASTJET_INCLUDE_DIR)
     if(FASTJET_CXXFLAGS)
-	string(STRIP ${FASTJET_CXXFLAGS} FASTJET_CXXFLAGS)
-	string(REGEX MATCHALL  "[-][I]([^ ])+" incfolders ${FASTJET_CXXFLAGS})
-
-	foreach(incfolder ${incfolders})
-	    string(REPLACE "-I" "" incfolder ${incfolder})
-	    set(FASTJET_INCLUDE_DIR ${incfolder} ${FASTJET_INCLUDE_DIR})
-	endforeach()
+        string(REGEX MATCHALL "(^| )-I[^ ]+" incfolders ${FASTJET_CXXFLAGS})
+        foreach(incfolder ${incfolders})
+            string(STRIP ${incfolder} incfolder)
+            string(SUBSTRING ${incfolder} 2 -1 incfolder)
+            set(FASTJET_INCLUDE_DIR ${incfolder})
+            break()
+        endforeach()
     endif(FASTJET_CXXFLAGS)

     # Extracting libraries and linking options
-    execute_process(COMMAND ${FASTJET_CONFIG} --libs OUTPUT_VARIABLE FASTJET_CONFIGLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    execute_process(COMMAND ${FASTJET_CONFIG} --libs OUTPUT_VARIABLE FASTJET_CONFIGLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(error)
         message(FATAL_ERROR "Error retrieving FastJet libs : ${error}")
     endif(error)

-    # Extracting the list of needed libraries during linking and the linking folders
+    # Extracting the list of needed libraries during linking and the linking directory
     set(FASTJET_LIBS)
     set(FASTJET_LIBS_DIR)
     if(FASTJET_CONFIGLIBS)
-	string(STRIP ${FASTJET_CONFIGLIBS} FASTJET_CONFIGLIBS)
-
-	# Extracting the list of libraries needed during linking
-	# -l strings
-	string(REGEX MATCHALL "[-][l]([^ ])+" fjlibs "${FASTJET_CONFIGLIBS}")
-
-	foreach(flib ${fjlibs})
-    	    string(REPLACE "-l" "" flib "${flib}")
-    	    set(FASTJET_LIBS ${FASTJET_LIBS} ${flib})
-	endforeach()

-	# Extracting the list of libraries folders
-	# -L strings
-	string(REGEX MATCHALL "[-][L]([^ ])+" fjlibdirs "${FASTJET_CONFIGLIBS}")
-
-	foreach(fjlibdir ${fjlibdirs})
-	    string(REPLACE "-L" "" fjlibdir ${fjlibdir})
-	    set(FASTJET_LIBS_DIR ${fjlibdir} ${FASTJET_LIBS_DIR})
-	endforeach()
-    endif()
+        # Extract libraries needed at link time (-l): the output is a LIST
+        string(REGEX MATCHALL "(^| )-l[^ ]+" fjlibs ${FASTJET_CONFIGLIBS})
+        foreach(fjlib ${fjlibs})
+            string(STRIP ${fjlib} fjlib)
+            string(SUBSTRING ${fjlib} 2 -1 fjlib)
+            list(APPEND FASTJET_LIBS ${fjlib})
+        endforeach()
+
+        # Extract library path: only one STRING as output
+        string(REGEX MATCHALL "(^| )-L[^ ]+" fjlibdirs ${FASTJET_CONFIGLIBS})
+        foreach(fjlibdir ${fjlibdirs})
+            string(STRIP ${fjlibdir} fjlibdir)
+            string(SUBSTRING ${fjlibdir} 2 -1 fjlibdir)
+            set(FASTJET_LIBS_DIR ${fjlibdir})
+            break()
+        endforeach()
+
+    endif(FASTJET_CONFIGLIBS)

     set(FASTJET_FOUND TRUE)
     set(FASTJET_DEFINITIONS "-DHAVE_FASTJET")


Fixed CMake detection for lp_solve.

Fixed CMake detection for lp_solve.

--- cmake/FindLPSolve.cmake
+++ cmake/FindLPSolve.cmake
@@ -75,7 +75,7 @@
 	ENDIF()

 	IF (LPSOLVE_LINKS_ALONE OR LPSOLVE_LINKS_WITH_EXTRA_LIBS)
-		SET(LPSOLVE_LINKS)
+		SET(LPSOLVE_LINKS TRUE)
 	ENDIF()

 	INCLUDE(FindPackageHandleStandardArgs)


Fixed FindMbedTLS.cmake on old CMake versions

--- cmake/FindMbedTLS.cmake
+++ cmake/FindMbedTLS.cmake
@@ -148,16 +148,16 @@
     add_library(mbedx509 UNKNOWN IMPORTED)
     set_target_properties(mbedx509 PROPERTIES
                           INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
+                          INTERFACE_LINK_LIBRARIES mbedcrypto
                           IMPORTED_LINK_INTERFACE_LANGUAGES "C"
                           IMPORTED_LOCATION "${MBEDTLS_X509_LIBRARY}")
-    target_link_libraries(mbedx509 INTERFACE mbedcrypto)
 endif()

 if(NOT TARGET mbedtls)
     add_library(mbedtls UNKNOWN IMPORTED)
     set_target_properties(mbedtls PROPERTIES
                           INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
+                          INTERFACE_LINK_LIBRARIES mbedx509
                           IMPORTED_LINK_INTERFACE_LANGUAGES "C"
                           IMPORTED_LOCATION "${MBEDTLS_LIBRARY}")
-    target_link_libraries(mbedtls INTERFACE mbedx509)
 endif()


Updated Findcodecov.cmake file.

Updated Findcodecov.cmake file.

* now supports targets in multiple languages
* huge code refactoring

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -23,44 +23,18 @@
 #

-# Header guard.
-# This module must only be included once (via find_package or include). If it
-# will be included more than once, there may be problems. The user should not be
-# forced to include it in top directory, so this header guard will prevent them
-# that this module is only loaded once, even if they include this module in
-# every CMake file.
-if (DEFINED COVERAGE_HEADER_GUARD)
-	return()
-endif ()
-set(COVERAGE_HEADER_GUARD true)
-
-
-
-#
-# configuration
-#
-set(COVERAGE_CFLAGS "-g -O0 --coverage")
-set(COVERAGE_LINKER_FLAGS "--coverage")
-
-
-
-#
-# options
-#
-
 # Add an option to choose, if coverage should be enabled or not. If enabled
 # marked targets will be build with coverage support and appropriate targets
 # will be added. If disabled coverage will be ignored for *ALL* targets.
 option(ENABLE_COVERAGE "Enable coverage build." OFF)

-# Add an option to choose, if coverage should be enabled for all targets, even
-# those which are not explictly marked as coverage targets. If disabled, only
-# targets added by add_coverage will be marked for coverage build. This option
-# is only available, if coverage was enabled.
-if (ENABLE_COVERAGE)
-	option(ENABLE_COVERAGE_ALL "Enable coverage build for all targets." OFF)
-endif ()
-
+set(COVERAGE_FLAG_CANDIDATES
+	# gcc and clang
+	"-fprofile-arcs -ftest-coverage"
+
+	# gcc and clang fallback
+	"-O0 --coverage"
+)

 # Add coverage support for target ${TNAME} and register target for coverage
@@ -69,9 +43,8 @@
 #
 # Note: This function is only a wrapper to define this function always, even if
 #   coverage is not supported by the compiler or disabled. This function must
-#   stay here, because the module will be exited, if there is no coverage
+#   be defined here, because the module will be exited, if there is no coverage
 #   support by the compiler or it is disabled by the user.
-#
 function (add_coverage TNAME)
 	# only add coverage for target, if coverage is support and enabled.
 	if (ENABLE_COVERAGE)
@@ -80,13 +53,14 @@
 endfunction (add_coverage)

-
 # Add global target to gather coverage information after all targets have been
 # added. Other evaluation functions could be added here, after checks for the
 # specific module have been passed.
 #
-# Note: This function must stay here, because the module will be exited, if
-# there is no coverage support by the compiler or it is disabled by the user.
+# Note: This function is only a wrapper to define this function always, even if
+#   coverage is not supported by the compiler or disabled. This function must
+#   be defined here, because the module will be exited, if there is no coverage
+#   support by the compiler or it is disabled by the user.
 function (coverage_evaluate)
 	# add lcov evaluation
 	if (LCOV_FOUND)
@@ -104,85 +78,129 @@

-# Check for coverage compiler flags in C and CXX, if one of those languages is
-# enabled. At least one language must pass this test to continue processing this
-# module.
-set(_COVERAGE_REQUIRED_VARS)
-get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-foreach (LANG ${LANGUAGES})
-	list(APPEND _COVERAGE_REQUIRED_VARS HAVE_COVERAGE_${LANG})
-
-	set(CMAKE_REQUIRED_FLAGS "${COVERAGE_LINKER_FLAGS}")
-	if (${LANG} STREQUAL C)
-		include(CheckCCompilerFlag)
-		check_c_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_C)
-
-	elseif (${LANG} STREQUAL CXX)
-		include(CheckCXXCompilerFlag)
-		check_cxx_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_CXX)
-
-	elseif (${LANG} STREQUAL Fortran)
-		include(CheckFortranCompilerFlag OPTIONAL RESULT_VARIABLE INCLUDED)
-		if (INCLUDED)
-			check_fortran_compiler_flag("${COVERAGE_CFLAGS}" HAVE_COVERAGE_Fortran)
-		else ()
-			message("-- Performing Test HAVE_COVERAGE_Fortran")
-			message("-- Performing Test HAVE_COVERAGE_Fortran - Failed (Check not supported)")
+
+# Find the reuired flags foreach language.
+set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
+set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
+
+set(_COVERAGE_ENABLED_LANGUAGES)
+
+get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+foreach (LANG ${ENABLED_LANGUAGES})
+	# If flags for this compiler were already found, do not try to find them
+	# again.
+	if (NOT COVERAGE_${LANG}_FLAGS)
+		foreach (FLAG ${COVERAGE_FLAG_CANDIDATES})
+			if(NOT CMAKE_REQUIRED_QUIET)
+				message(STATUS "Try code coverage ${LANG} flag = [${FLAG}]")
+			endif()
+
+			set(CMAKE_REQUIRED_FLAGS "${FLAG}")
+			unset(COVERAGE_FLAG_DETECTED CACHE)
+
+			if (${LANG} STREQUAL "C")
+				include(CheckCCompilerFlag)
+				check_c_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
+
+			elseif (${LANG} STREQUAL "CXX")
+				include(CheckCXXCompilerFlag)
+				check_cxx_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
+
+			elseif (${LANG} STREQUAL "Fortran")
+				# CheckFortranCompilerFlag was introduced in CMake 3.x. To be
+				# compatible with older Cmake versions, we will check if this
+				# module is present before we use it. Otherwise we will define
+				# Fortran coverage support as not available.
+				include(CheckFortranCompilerFlag OPTIONAL
+					RESULT_VARIABLE INCLUDED)
+				if (INCLUDED)
+					check_fortran_compiler_flag("${COVERAGE_CFLAGS}"
+						COVERAGE_FLAG_DETECTED)
+				elseif (NOT CMAKE_REQUIRED_QUIET)
+					message("-- Performing Test HAVE_COVERAGE_Fortran")
+					message("-- Performing Test HAVE_COVERAGE_Fortran - Failed "
+						"(Check not supported)")
+				endif ()
+			endif()
+
+			if (COVERAGE_FLAG_DETECTED)
+				set(COVERAGE_${LANG}_FLAGS "${FLAG}"
+					CACHE STRING "${LANG} compiler flags for code coverage.")
+				mark_as_advanced(COVERAGE_${LANG}_FLAGS)
+				list(APPEND _COVERAGE_ENABLED_LANGUAGES ${LANG})
+				break()
+			endif ()
+		endforeach ()
+	endif ()
+endforeach ()
+
+set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
+
+
+
+
+# Helper function to get the language of a source file.
+function (lang_of_source FILENAME LANGUAGE_FLAG)
+	get_filename_component(FILE_EXT "${FILENAME}" EXT)
+	string(TOLOWER "${FILE_EXT}" FILE_EXT)
+	string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT)
+
+	get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+	foreach (LANG ${ENABLED_LANGUAGES})
+		list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP)
+		if (NOT ${TEMP} EQUAL -1)
+			set(${LANGUAGE_FLAG} "${LANG}" PARENT_SCOPE)
+			return()
 		endif ()
-	endif()
-	unset(CMAKE_REQUIRED_FLAGS)
-endforeach()
-
-
-if (_COVERAGE_REQUIRED_VARS)
-	include(FindPackageHandleStandardArgs)
-	find_package_handle_standard_args(codecov
-		REQUIRED_VARS ${_COVERAGE_REQUIRED_VARS}
-		FOUND_VAR CODECOV_FOUND)
-	mark_as_advanced(${_COVERAGE_REQUIRED_VARS})
-	unset(_COVERAGE_REQUIRED_VARS)
-else()
-	message(SEND_ERROR "Codecoverage requires C, CXX or Fortran language to be enabled")
-	return()
-endif()
-
-
-# Abort, if no coverage support by compiler. Disable coverage for further
-# processing, so add_coverage will ignore it.
-if (NOT CODECOV_FOUND)
-	set(ENABLE_COVERAGE OFF)
-	return()
-endif()
-
-
-# Set CMake Policy CMP0051 to new. SOURCE property will include generator
-# expressions, so we can add coverage for object libraries on-the-fly.
-if (POLICY CMP0051)
-	cmake_policy(SET CMP0051 NEW)
-endif ()
+	endforeach()
+endfunction ()

 # Add coverage support for target ${TNAME} and register target for coverage
 # evaluation.
-#
 function(add_coverage_target TNAME)
-	# If coverage is already enabled for this target, we can skip the execution
-	# of this function.
-	if (TARGET ${TNAME}-coverage)
-		return()
-	endif ()
-
-	# create coverage target for this target
-	add_custom_target(${TNAME}-coverage DEPENDS ${TNAME})
+	# Check if all sources for target use the same compiler. If a target uses
+	# e.g. C and Fortran mixed and uses different compilers (e.g. clang and
+	# gfortran) this can trigger huge problems, because different compilers may
+	# use different implementations for code coverage.
+	get_target_property(TSOURCES ${TNAME} SOURCES)
+	set(TARGET_LANGUAGES "")
+	foreach (FILE ${TSOURCES})
+		# If expression was found, FILE is a generator-expression for an object
+		# library. Object libraries will be ignored.
+		string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE})
+		if ("${_file}" STREQUAL "")
+			lang_of_source(${FILE} LANG)
+			list(APPEND TARGET_LANGUAGES ${LANG})
+		endif ()
+	endforeach ()
+	list(REMOVE_DUPLICATES TARGET_LANGUAGES)
+
+	set(TARGET_LANG "")
+	set(TEMP_COMPILER "")
+	foreach (LANG ${TARGET_LANGUAGES})
+		if (("${TEMP_COMPILER}" STREQUAL "") OR
+			("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "${TEMP_COMPILER}"))
+			set(TEMP_COMPILER "${CMAKE_${LANG}_COMPILER_ID}")
+			set(TARGET_LANG ${LANG})
+		else ()
+			message(AUTHOR_WARNING "Coverage disabled for target ${TNAME} "
+				"because it will be compiled by different compilers. "
+				"Please set compiler- and linker-flags manual for this target."
+			)
+			return()
+		endif ()
+	endforeach ()
+

 	# enable coverage for target
 	set_property(TARGET ${TNAME}
 		APPEND_STRING
-		PROPERTY COMPILE_FLAGS " ${COVERAGE_CFLAGS}"
+		PROPERTY COMPILE_FLAGS " ${COVERAGE_${TARGET_LANG}_FLAGS}"
 	)
 	set_property(TARGET ${TNAME}
 		APPEND_STRING
-		PROPERTY LINK_FLAGS " ${COVERAGE_LINKER_FLAGS}"
+		PROPERTY LINK_FLAGS " ${COVERAGE_${TARGET_LANG}_FLAGS}"
 	)

@@ -198,59 +216,9 @@
 endfunction(add_coverage_target)

-# If ENABLE_COVERAGE_ALL is enabled, overload add_executable and add_library
-# functions, to add coverage support for *ALL* targets. The functions will call
-# the overloaded functions first and then add_coverage.
-if (ENABLE_COVERAGE_ALL)
-	function(add_executable ARGV)
-		# add executable
-		_add_executable(${ARGV})
-
-		# check if target is supported for code coverage
-		get_target_property(TSOURCES ${ARGV0} SOURCES)
-		foreach (FILE ${TSOURCES})
-			get_source_file_property(SLANG ${FILE} LANGUAGE)
-			if ((NOT ${SLANG} STREQUAL "C") AND (NOT ${SLANG} STREQUAL "CXX"))
-				# Target has source files that are not supported for code
-				# coverage. Do not add coverage for this target and print a
-				# warning.
-				message("-- Code coverage not supported for target ${ARGV0}")
-				return()
-			endif()
-		endforeach ()
-
-		# add coverage
-		add_coverage(${ARGV0})
-	endfunction(add_executable)
-
-	function(add_library ARGV)
-		# add library
-		_add_library(${ARGV})
-
-		# check if target is supported for code coverage
-		get_target_property(TSOURCES ${ARGV0} SOURCES)
-		foreach (FILE ${TSOURCES})
-			get_source_file_property(SLANG ${FILE} LANGUAGE)
-			if ((NOT ${SLANG} STREQUAL "C") AND (NOT ${SLANG} STREQUAL "CXX"))
-				# Target has source files that are not supported for code
-				# coverage. Do not add coverage for this target and print a
-				# warning.
-				message("-- Code coverage not supported for target ${ARGV0}")
-				return()
-			endif()
-		endforeach ()
-
-		# add coverage
-		add_coverage(${ARGV0})
-	endfunction(add_library)
-endif ()
-
-
-

 # Include modules for parsing the collected data and output it in a readable
 # format (like gcov and lcov).
-#
 find_package(Gcov)
 find_package(Lcov)