Migration to OCCT 7x

Migration to OCCT 7x

--- salome_adm/cmake_files/FindCAS.cmake
+++ salome_adm/cmake_files/FindCAS.cmake
@@ -77,7 +77,6 @@
 ENDIF()

 FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin )
-FIND_LIBRARY(CAS_PTKernel PTKernel )
 FIND_LIBRARY(CAS_TKBin TKBin )
 FIND_LIBRARY(CAS_TKBinL TKBinL )
 FIND_LIBRARY(CAS_TKBinTObj TKBinTObj )
@@ -105,15 +104,9 @@
 ENDIF()
 FIND_LIBRARY(CAS_TKOffset TKOffset )
 FIND_LIBRARY(CAS_TKOpenGl TKOpenGl )
-FIND_LIBRARY(CAS_TKPCAF TKPCAF )
-FIND_LIBRARY(CAS_TKPLCAF TKPLCAF )
 FIND_LIBRARY(CAS_TKPrim TKPrim )
-FIND_LIBRARY(CAS_TKPShape TKPShape )
 FIND_LIBRARY(CAS_TKService TKService )
-FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema )
 FIND_LIBRARY(CAS_TKShHealing TKShHealing )
-FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema )
-FIND_LIBRARY(CAS_TKStdSchema TKStdSchema )
 FIND_LIBRARY(CAS_TKSTEP TKSTEP )
 FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 )
 FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr )
@@ -124,7 +117,6 @@
 FIND_LIBRARY(CAS_TKV3d TKV3d )
 FIND_LIBRARY(CAS_TKVRML TKVRML )
 FIND_LIBRARY(CAS_TKXCAF TKXCAF )
-FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema )
 FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES )
 FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP )
 FIND_LIBRARY(CAS_TKXMesh TKXMesh )
@@ -134,6 +126,17 @@
 FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF )
 FIND_LIBRARY(CAS_TKXSBase TKXSBase )

+IF(CAS_VERSION_STR VERSION_LESS "7.0")
+  FIND_LIBRARY(CAS_PTKernel PTKernel )
+  FIND_LIBRARY(CAS_TKPCAF TKPCAF )
+  FIND_LIBRARY(CAS_TKPLCAF TKPLCAF )
+  FIND_LIBRARY(CAS_TKPShape TKPShape )
+  FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema )
+  FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema )
+  FIND_LIBRARY(CAS_TKStdSchema TKStdSchema )
+  FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema )
+ENDIF()
+
 SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})
 SET(CAS_OCAF ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKCDF} ${CAS_TKLCAF})
 SET(CAS_VIEWER ${CAS_TKService} ${CAS_TKV3d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKBRep})
@@ -158,7 +161,6 @@

 SET(_libs
   CAS_FWOSPlugin
-  CAS_PTKernel
   CAS_TKBin
   CAS_TKBinL
   CAS_TKBinTObj
@@ -183,15 +185,9 @@
   CAS_TKMeshVS
   CAS_TKOffset
   CAS_TKOpenGl
-  CAS_TKPCAF
-  CAS_TKPLCAF
   CAS_TKPrim
-  CAS_TKPShape
   CAS_TKService
-  CAS_TKShapeSchema
   CAS_TKShHealing
-  CAS_TKStdLSchema
-  CAS_TKStdSchema
   CAS_TKSTEP
   CAS_TKSTEP209
   CAS_TKSTEPAttr
@@ -202,7 +198,6 @@
   CAS_TKV3d
   CAS_TKVRML
   CAS_TKXCAF
-  CAS_TKXCAFSchema
   CAS_TKXDEIGES
   CAS_TKXDESTEP
   CAS_TKXMesh
@@ -217,6 +212,20 @@
   LIST(APPEND _libs CAS_TKNIS)
 ENDIF()

+IF(CAS_VERSION_STR VERSION_LESS "7.0")
+  LIST(APPEND _libs
+    CAS_PTKernel
+    CAS_TKPCAF
+    CAS_TKPLCAF
+    CAS_TKPShape
+    CAS_TKShapeSchema
+    CAS_TKStdLSchema
+    CAS_TKStdSchema
+    CAS_TKXCAFSchema
+    )
+ENDIF()
+
+
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS REQUIRED_VARS CAS_INCLUDE_DIRS ${_libs})


apply warning flags only to OpenSplice generated code

--- rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
+++ rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
@@ -45,7 +45,9 @@

 set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/rosidl_typesupport_opensplice_cpp/${PROJECT_NAME}")
 set(_generated_msg_files "")
+set(_generated_external_msg_files "")
 set(_generated_srv_files "")
+set(_generated_external_srv_files "")
 foreach(_idl_file ${rosidl_generate_interfaces_IDL_FILES})
   get_filename_component(_extension "${_idl_file}" EXT)
   get_filename_component(_msg_name "${_idl_file}" NAME_WE)
@@ -53,7 +55,7 @@
   if("${_extension} " STREQUAL ".msg ")
     get_filename_component(_parent_folder "${_idl_file}" DIRECTORY)
     get_filename_component(_parent_folder "${_parent_folder}" NAME)
-    list(APPEND _generated_msg_files
+    list(APPEND _generated_external_msg_files
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_.h"
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_.cpp"
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_Dcps.h"
@@ -62,14 +64,15 @@
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_Dcps_impl.cpp"
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_SplDcps.h"
       "${_output_path}/${_parent_folder}/dds_opensplice/${_msg_name}_SplDcps.cpp"
-      "${_output_path}/${_parent_folder}/dds_opensplice/ccpp_${_msg_name}_.h"
+      "${_output_path}/${_parent_folder}/dds_opensplice/ccpp_${_msg_name}_.h")
+    list(APPEND _generated_msg_files
       "${_output_path}/${_parent_folder}/dds_opensplice/${_header_name}__type_support.hpp"
       "${_output_path}/${_parent_folder}/dds_opensplice/${_header_name}__type_support.cpp")
   elseif("${_extension} " STREQUAL ".srv ")
     list(APPEND _generated_srv_files "${_output_path}/srv/dds_opensplice/${_header_name}__type_support.cpp")

     foreach(_suffix "_Request" "_Response")
-      list(APPEND _generated_srv_files
+      list(APPEND _generated_external_srv_files
         "${_output_path}/srv/dds_opensplice/Sample_${_msg_name}${_suffix}_.h"
         "${_output_path}/srv/dds_opensplice/Sample_${_msg_name}${_suffix}_.cpp"
         "${_output_path}/srv/dds_opensplice/Sample_${_msg_name}${_suffix}_Dcps.h"
@@ -95,7 +98,7 @@
   endif()
   if(NOT "${_opensplice_compile_flags} " STREQUAL " ")
     string(REPLACE ";" " " _opensplice_compile_flags "${_opensplice_compile_flags}")
-    foreach(_gen_file ${_generated_files})
+    foreach(_gen_file ${_generated_external_msg_files} ${_generated_external_srv_files})
       set_source_files_properties("${_gen_file}"
         PROPERTIES COMPILE_FLAGS ${_opensplice_compile_flags})
     endforeach()
@@ -141,7 +144,11 @@
 file(WRITE "${_dds_idl_files_file}" ${_dds_idl_files_lines})

 add_custom_command(
-  OUTPUT ${_generated_msg_files} ${_generated_srv_files}
+  OUTPUT
+  ${_generated_msg_files}
+  ${_generated_external_msg_files}
+  ${_generated_srv_files}
+  ${_generated_external_srv_files}
   COMMAND ${PYTHON_EXECUTABLE} ${rosidl_typesupport_opensplice_cpp_BIN}
   --pkg-name ${PROJECT_NAME}
   --ros-interface-files ${rosidl_generate_interfaces_IDL_FILES}
@@ -168,15 +175,15 @@
   ${rosidl_generate_interfaces_TARGET}${_target_suffix}
 )

-if(NOT "${_generated_msg_files} " STREQUAL " ")
+if(NOT "${_generated_msg_files}${_generated_external_msg_files} " STREQUAL " ")
   install(
-    FILES ${_generated_msg_files}
+    FILES ${_generated_msg_files} ${_generated_external_msg_files}
     DESTINATION "include/${PROJECT_NAME}/msg/dds_opensplice"
   )
 endif()
-if(NOT "${_generated_srv_files} " STREQUAL " ")
+if(NOT "${_generated_srv_files}${_generated_external_srv_files} " STREQUAL " ")
   install(
-    FILES ${_generated_srv_files}
+    FILES ${_generated_srv_files} ${_generated_external_srv_files}
     DESTINATION "include/${PROJECT_NAME}/srv/dds_opensplice"
   )
 endif()
@@ -188,13 +195,18 @@
     ${rosidl_typesupport_opensplice_cpp_TEMPLATE_DIR}/duration__type_support.cpp
     ${rosidl_typesupport_opensplice_cpp_TEMPLATE_DIR}/time__type_support.cpp
   )
+  set(_generated_external_msg_files)
   set(_generated_srv_files)
+  set(_generated_external_srv_files)

 endif()

 link_directories(${OpenSplice_LIBRARY_DIRS})
 add_library(${rosidl_generate_interfaces_TARGET}${_target_suffix} SHARED
-  ${_generated_msg_files} ${_generated_srv_files})
+  ${_generated_msg_files}
+  ${_generated_external_msg_files}
+  ${_generated_srv_files}
+  ${_generated_external_srv_files})
 if(WIN32)
   target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}
     PRIVATE "ROSIDL_BUILDING_DLL")


add -Wall -Wextra to exported compiler flags

Follow up to: https://github.com/ros2/rosidl/pull/84

--- rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
+++ rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
@@ -236,7 +236,7 @@
   ${_generated_external_srv_files})
 if(NOT WIN32)
   set_target_properties(${rosidl_generate_interfaces_TARGET}${_target_suffix}
-    PROPERTIES COMPILE_FLAGS "-std=c++11")
+    PROPERTIES COMPILE_FLAGS "-std=c++11 -Wall -Wextra")
 endif()
 if(WIN32)
   target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}


added: '/bigobj' msvc compiler option

added: '/bigobj' msvc compiler option

--- share/hugh/cmake/compiler/msvc.cmake
+++ share/hugh/cmake/compiler/msvc.cmake
@@ -44,6 +44,9 @@
 # unreachable code (somewhere in boost)
 list(APPEND DISABLED_WARNINGS /wd4702)

+# C1128: number of sections exceeded object file format limit: compile with /bigobj
+list(APPEND DISABLED_WARNINGS /bigobj)
+
 list(APPEND GLOBAL_COMPILER_FLAGS /W4)  # warn almost everything
 list(APPEND GLOBAL_COMPILER_FLAGS ${DISABLED_WARNINGS})
 list(APPEND GLOBAL_COMPILER_FLAGS /EHa) # exception-handling for asynchronous (structured) and


Don't export the documentation settings from the cache

--- UseVTK.cmake
+++ UseVTK.cmake
@@ -6,9 +6,12 @@
   IF (VTK_INSTALL_PATH)
     LOAD_CACHE(${VTK_INSTALL_PATH}/include/vtk
       EXCLUDE
+        BUILD_DOC
         BUILD_SHARED_LIBS
         BUILD_TESTING
         BUILD_EXAMPLES
+	DOC_HTML_HELP
+	DOC_HTML_TARZ
         LIBRARY_OUTPUT_PATH
         EXECUTABLE_OUTPUT_PATH
         MAKECOMMAND
@@ -26,9 +29,12 @@
   IF (VTK_BINARY_PATH)
     LOAD_CACHE(${VTK_BINARY_PATH}
       EXCLUDE
+        BUILD_DOC
         BUILD_SHARED_LIBS
         BUILD_TESTING
         BUILD_EXAMPLES
+	DOC_HTML_HELP
+	DOC_HTML_TARZ
         LIBRARY_OUTPUT_PATH
         EXECUTABLE_OUTPUT_PATH
         MAKECOMMAND


fixing projectB to compile and test properly as executable with library dependency

--- WkTest.cmake
+++ WkTest.cmake
@@ -170,25 +170,25 @@
 # to the binary_path, at the root
 #
 MACRO (WkTestData test_name )
-
-	foreach ( test_data ${ARGN} )
-
-		# warning : tests are run from the project root...
-		#FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} ${test_data}_NATIVE_SRC_PATH)
-		#FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} ${test_data}_NATIVE_BLD_PATH)
-		#ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${${test_data}_NATIVE_SRC_PATH}" "${${test_data}_NATIVE_BLD_PATH}" COMMENT "Copying ${${test_data}_NATIVE_SRC_PATH} to ${${test_data}_NATIVE_BLD_PATH}" VERBATIM)
-		ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
-			"${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
-			"${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
-			COMMENT
-			"Copying ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} to ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
-			VERBATIM)
-
-		#message ("test data src: ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}")
-		#message ("test data dest: ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DATA_BUILD_DIR}/${test_data}")
+	IF(${PROJECT_NAME}_ENABLE_TESTS)
+		foreach ( test_data ${ARGN} )
+
+			# warning : tests are run from the project root...
+			#FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} ${test_data}_NATIVE_SRC_PATH)
+			#FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} ${test_data}_NATIVE_BLD_PATH)
+			#ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${${test_data}_NATIVE_SRC_PATH}" "${${test_data}_NATIVE_BLD_PATH}" COMMENT "Copying ${${test_data}_NATIVE_SRC_PATH} to ${${test_data}_NATIVE_BLD_PATH}" VERBATIM)
+			ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+				"${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
+				"${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
+				COMMENT
+				"Copying ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data} to ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}"
+				VERBATIM)
+
+			#message ("test data src: ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_TEST_DIR}/${${PROJECT_NAME}_TEST_DATA_DIR}/${test_data}")
+			#message ("test data dest: ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_TEST_DATA_BUILD_DIR}/${test_data}")

-	endforeach ( test_data ${ARGN} )
-
+		endforeach ( test_data ${ARGN} )
+	ENDIF(${PROJECT_NAME}_ENABLE_TESTS)
 ENDMACRO (WkTestData data_path)

 #


revert accidental checkin.

revert accidental checkin.

--- build_settings.cmake
+++ build_settings.cmake
@@ -20,7 +20,7 @@
 set(WARN_OPTS "-Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Og ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -Wnon-virtual-dtor -fvisibility-inlines-hidden -fdiagnostics-color=auto")


Ignoring non-zero warning.

Ignoring non-zero warning.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@8685 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/cmake/CTestConfig.cmake
+++ seqan/projects/library/cmake/CTestConfig.cmake
@@ -11,8 +11,3 @@
 set(CTEST_DROP_SITE "www.seqan.de")
 set(CTEST_DROP_LOCATION "/cdash/submit.php?project=SeqAn")
 set(CTEST_DROP_SITE_CDASH TRUE)
-
-SET(CTEST_CUSTOM_WARNING_EXCEPTION
-  ${CTEST_CUSTOM_WARNING_EXCEPTION}
-  "WARNING non-zero return value in ctest from"
-)


update

update

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -31,6 +31,18 @@
                 PATHS
                     "${GLFW_DIR}/lib"
                     "${GLFW_DIR}/lib-vc2015"
+            )
+        elseif (MSVC15 OR (${MSVC_VERSION} EQUAL 2000))
+            find_library (GLFW_LIB NAMES glfw3
+                PATHS
+                    "${GLFW_DIR}/lib"
+                    "${GLFW_DIR}/lib-vc2017"
+            )
+        elseif (MSVC16 OR (${MSVC_VERSION} EQUAL 2100))
+            find_library (GLFW_LIB NAMES glfw3
+                PATHS
+                    "${GLFW_DIR}/lib"
+                    "${GLFW_DIR}/lib-vc2019"
             )
         elseif (MINGW)
             if (CMAKE_CL_64)


cmake: Rewok FindGLPK.cmake

cmake: Rewok FindGLPK.cmake

--- cmake/FindGLPK.cmake
+++ cmake/FindGLPK.cmake
@@ -17,12 +17,19 @@

 ::

-GLPK_FOUND          - True if GLPK found.
+``GLPK_FOUND``
+  True if ``GLPK`` found.
+
+``GLPK_INCLUDE_DIRS``
+  Where to find glpk.h, etc.
+
+``GLPK_LIBRARIES``
+  List of libraries for using ``glpk``.

 Hints
 ^^^^^

-A user may set ``GLPK_ROOT`` to a GLPK installation root to tell this
+A user may set ``GLPK_ROOT`` environment to a GLPK installation root to tell this
 module where to look.
 #]=======================================================================]
 # first specifically look for the CMake version of GLPK
@@ -43,43 +50,39 @@
   message(FATAL_ERROR "FindGLPK only works if either C or CXX language is enabled")
 endif()

-if(NOT GLPK_ROOT)
-  if (DEFINED ENV{GLPK_ROOT})
-    set(GLPK_ROOT $ENV{GLPK_ROOT})
-  else()
-    find_path(GLPK_PATH libglpk.a libglpk.lib
-      DOC "Path in which libglpk is found"
-      PATHS
-      "/usr/local/lib"
-      "/usr/lib"
-      "${CMAKE_BINARY_DIR}/dependencies/GLPK/source/w32"
-      "${CMAKE_BINARY_DIR}/dependencies/GLPK/source/w64"
-      "${CMAKE_BINARY_DIR}/dependencies/GLPK/source/src/.lib"
-      )
-    if(GLPK_PATH)
-      set(GLPK_ROOT ${GLPK_PATH})
-    endif()
+if(DEFINED ENV{GLPK_ROOT})
+  message(STATUS "GLPK_ROOT: ${GLPK_ROOT}")
+endif()
+
+if(APPLE)
+  find_path(GLPK_INCLUDE_DIRS glpk.h
+    HINTS
+      ENV GLPK_ROOT
+      /Library/Frameworks/Glpk.framework/Headers
+    )
+  find_library(GLPK_LIBRARIES glpk
+    HINTS
+      ENV GLPK_ROOT
+      /Library/Frameworks/Glpk.framework/Libraries
+    )
+  set(GLPK_LIBRARIES "-framework glpk" CACHE STRING "Glpk library for OSX")
+else()
+  find_path(GLPK_INCLUDE_DIRS glpk.h
+    HINTS
+      ENV GLPK_ROOT
+    )
+  find_library(GLPK_LIBRARIES glpk
+    HINTS
+      ENV GLPK_ROOT
+    )
+endif()
+
+if(GLPK_INCLUDE_DIRS AND GLPK_LIBRARIES)
+  if(NOT TARGET GLPK::GLPK)
+    add_library(GLPK::GLPK UNKNOWN IMPORTED)
+    set_property(TARGET GLPK::GLPK PROPERTY IMPORTED_LOCATION ${GLPK_LIBRARIES})
+    target_include_directories(GLPK::GLPK INTERFACE ${GLPK_INCLUDE_DIRS})
   endif()
 endif()

-message(STATUS "GLPK_ROOT: ${GLPK_ROOT}")
-if(NOT GLPK_ROOT)
-  message(FATAL_ERROR "GLPK_ROOT: not found")
-else()
-  set(GLPK_FOUND TRUE)
-endif()
-
-if(GLPK_FOUND AND NOT TARGET GLPK::GLPK)
-  add_library(GLPK::GLPK UNKNOWN IMPORTED)
-  if (UNIX)
-    set_property(TARGET GLPK::GLPK PROPERTY IMPORTED_LOCATION
-      ${GLPK_ROOT}/libglpk.a
-      )
-  elseif(MSVC)
-    set_property(TARGET GLPK::GLPK PROPERTY IMPORTED_LOCATION
-      ${GLPK_ROOT}/libglpk.lib
-      )
-  else()
-    message(FATAL_ERROR "OR-Tools with GLPK not supported for ${CMAKE_SYSTEM}")
-  endif()
-endif()
+find_package_handle_standard_args(GLPK DEFAULT_MSG GLPK_LIBRARIES GLPK_INCLUDE_DIRS)


Add check for file SoQtBasic.h when looking for GUI_TOOLKIT_VERSION

--- cmake/FindSoQt.cmake
+++ cmake/FindSoQt.cmake
@@ -124,9 +124,11 @@

 mark_as_advanced(SoQt_DEFINITIONS)

-file(STRINGS "${SoQt_INCLUDE_DIRS}/Inventor/Qt/SoQtBasic.h" GUI_TOOLKIT_VERSION_DEFINE REGEX "#define GUI_TOOLKIT_VERSION.*[0-9]+.*")
-string(REGEX REPLACE ".*([0-9])([0-9])([0-9]).*" "\\1" GUI_TOOLKIT_VERSION_MAJOR "${GUI_TOOLKIT_VERSION_DEFINE}")
-set(SoQt${GUI_TOOLKIT_VERSION_MAJOR}_FOUND ON)
+if(EXISTS "${SoQt_INCLUDE_DIRS}/Inventor/Qt/SoQtBasic.h")
+	file(STRINGS "${SoQt_INCLUDE_DIRS}/Inventor/Qt/SoQtBasic.h" GUI_TOOLKIT_VERSION_DEFINE REGEX "#define GUI_TOOLKIT_VERSION.*[0-9]+.*")
+	string(REGEX REPLACE ".*([0-9])([0-9])([0-9]).*" "\\1" GUI_TOOLKIT_VERSION_MAJOR "${GUI_TOOLKIT_VERSION_DEFINE}")
+	set(SoQt${GUI_TOOLKIT_VERSION_MAJOR}_FOUND ON)
+endif()

 find_package_handle_standard_args(
 	SoQt


fix broken build due to gtest upgrade upstream

--- cmake/UnitTest.cmake
+++ cmake/UnitTest.cmake
@@ -11,7 +11,7 @@
 # Download and install GoogleTest
 ExternalProject_Add(
     gtest
-    URL https://github.com/google/googletest/archive/master.zip
+    URL https://github.com/google/googletest/archive/release-1.8.1.zip
     PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/gtest
     # Disable install step
     INSTALL_COMMAND ""


need -fno-predictive-commoning for GCC 4.7.0 to work around miscompilations

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -142,9 +142,15 @@
       AddCompilerFlag("-Wno-variadic-macros")
       AddCompilerFlag("-fno-threadsafe-statics")
       AddCompilerFlag("-frename-registers")
+
       set(CMAKE_CXX_FLAGS_DEBUG          "-g3"          CACHE STRING "Flags used by the compiler during debug builds." FORCE)
       set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG" CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
-      set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files)." FORCE)
+      set(_release_flags "-O3 -DNDEBUG")
+      if(VC_GCC_VERSION STREQUAL "4.7.0")
+         message(WARNING "GCC 4.7.0 miscompiles at -O3, adding -fno-predictive-commoning to the compiler flags as workaround")
+         set(_release_flags "${_release_flags} -fno-predictive-commoning")
+      endif()
+      set(CMAKE_CXX_FLAGS_RELEASE        "${_release_flags}" CACHE STRING "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files)." FORCE)
       set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g" CACHE STRING "Flags used by the compiler during Release with Debug Info builds." FORCE)
       set(CMAKE_C_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG}"          CACHE STRING "Flags used by the compiler during debug builds." FORCE)
       set(CMAKE_C_FLAGS_MINSIZEREL     "${CMAKE_CXX_FLAGS_MINSIZEREL}"     CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)


config update for msvc

config update for msvc

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@4490 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -91,8 +91,9 @@
 endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release")

 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-    set(CMAKE_CXX_FLAGS_DEBUG   "/Od /bigobj /DWIN32 /EHsc /Zi /wd4566")
-    set(CMAKE_CXX_FLAGS_RELEASE "/bigobj /DWIN32 /EHsc /Zi /wd4566")
+    set(CMAKE_CXX_FLAGS_DEBUG      "/Od /bigobj /DWIN32 /EHsc /Zi /wd4566")
+    set(CMAKE_CXX_FLAGS_RELEASE        "/bigobj /DWIN32 /EHsc /Zi /wd4566")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/bigobj /DWIN32 /EHsc /Zi /wd4566")
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18)
        set(CMAKE_CXX_FLAGS_DEBUG    "${CMAKE_CXX_FLAGS_DEBUG}  /FS")
        set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAG_RELEASE} /FS")
@@ -120,6 +121,7 @@
        # Note: On 64bit-platforms, /Wp64 flag is present, causing extra warnings
        set(CMAKE_CXX_FLAGS_DEBUG    "${CMAKE_CXX_FLAGS_DEBUG}  /wd4244 /wd4267")
        set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAG_RELEASE} /wd4244 /wd4267")
+       set(CMAKE_CXX_FLAGS_RELWITHDEBINFO  "${CMAKE_CXX_FLAG_RELWITHDEBINFO} /wd4244 /wd4267")
     #else() #32bit compiler has CMAKE_SIZEOF_VOID_P EQUAL 4
     endif()

@@ -134,9 +136,12 @@
   if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
     string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
     string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+    string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+    string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
   else()
     set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG} /W4")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W4")
   endif()
 elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
   # Update if necessary


Fix freeimage find script

Fix freeimage find script

--- CMakeModules/FindFreeImage.cmake
+++ CMakeModules/FindFreeImage.cmake
@@ -40,23 +40,27 @@
 find_path(FreeImage_INCLUDE_DIR
   NAMES FreeImage.h
   PATHS
-    /usr/include
-    /usr/local/include
-    /sw/include
-    /opt/local/include
-	${FreeImage_ROOT}
+    /usr
+    /usr/local
+    /sw
+    /opt/local
+    ${FreeImage_ROOT}
+  PATH_SUFFIXES
+    include
   DOC "The directory where FreeImage.h resides")

 find_library(FreeImage_LINK_LIBRARY
   NAMES FreeImage freeimage
   PATHS
-    /usr/lib64
-    /usr/lib
-    /usr/local/lib64
-    /usr/local/lib
-    /sw/lib
-    /opt/local/lib
-	${FreeImage_ROOT}
+    /usr
+    /usr/local
+    /sw
+    /opt/local
+    ${FreeImage_ROOT}
+  PATH_SUFFIXES
+    lib
+    lib64
+    x64/lib
   DOC "The FreeImage library")

 find_library(FreeImage_STATIC_LIBRARY
@@ -65,13 +69,15 @@
     ${CMAKE_STATIC_LIBRARY_PREFIX}FreeImage${CMAKE_STATIC_LIBRARY_SUFFIX}
     ${CMAKE_STATIC_LIBRARY_PREFIX}freeimage${CMAKE_STATIC_LIBRARY_SUFFIX}
   PATHS
-    /usr/lib64
-    /usr/lib
-    /usr/local/lib64
-    /usr/local/lib
-    /sw/lib
-    /opt/local/lib
+    /usr
+    /usr/local
+    /sw
+    /opt/local
     ${FreeImage_ROOT}
+  PATH_SUFFIXES
+    lib
+    lib64
+    x64/lib
   DOC "The FreeImage static library")

 if (WIN32)
@@ -81,8 +87,14 @@
       ${CMAKE_SHARED_LIBRARY_PREFIX}freeimage${CMAKE_SHARED_LIBRARY_SUFFIX}
     PATHS
       ${FreeImage_ROOT}
+    PATH_SUFFIXES
+      lib
+      lib64
+      x64/lib
+      bin
+      x64/bin
     DOC "The FreeImage dll")
-	mark_as_advanced(FreeImage_DLL_LIBRARY)
+  mark_as_advanced(FreeImage_DLL_LIBRARY)
 endif ()

 mark_as_advanced(
@@ -98,18 +110,18 @@
   add_library(FreeImage::FreeImage SHARED IMPORTED)
   if(WIN32)
     set_target_properties(FreeImage::FreeImage
-	  PROPERTIES
+      PROPERTIES
         IMPORTED_LINK_INTERFACE_LANGUAGE "C"
         INTERFACE_INCLUDE_DIRECTORIES "${FreeImage_INCLUDE_DIR}"
         IMPORTED_LOCATION "${FreeImage_DLL_LIBRARY}"
-	    IMPORTED_IMPLIB "${FreeImage_LINK_LIBRARY}")
+        IMPORTED_IMPLIB "${FreeImage_LINK_LIBRARY}")
   else(WIN32)
     set_target_properties(FreeImage::FreeImage
-	  PROPERTIES
+      PROPERTIES
         IMPORTED_LINK_INTERFACE_LANGUAGE "C"
         INTERFACE_INCLUDE_DIRECTORIES "${FreeImage_INCLUDE_DIR}"
         IMPORTED_LOCATION "${FreeImage_LINK_LIBRARY}"
-	    IMPORTED_NO_SONAME FALSE)
+        IMPORTED_NO_SONAME FALSE)
   endif(WIN32)
 endif()

@@ -120,4 +132,4 @@
       IMPORTED_LINK_INTERFACE_LANGUAGE "C"
       INTERFACE_INCLUDE_DIRECTORIES "${FreeImage_INCLUDE_DIR}"
       IMPORTED_LOCATION "${FreeImage_STATIC_LIBRARY}")
-endif()+endif()


add path suffixes for windows build

add path suffixes for windows build

--- CMakeModules/FindlibSquish.cmake
+++ CMakeModules/FindlibSquish.cmake
@@ -4,7 +4,7 @@
 #  LIBSQUISH_LIBRARIES

 FIND_PATH(LIBSQUISH_INCLUDE_DIR squish.h PATHS . squish .. ../squish DOC "Directory containing libSquish headers")
-FIND_LIBRARY(LIBSQUISH_LIBRARY NAMES squish libsquish PATHS . squish .. ../squish DOC "Path to libSquish library")
+FIND_LIBRARY(LIBSQUISH_LIBRARY NAMES squish libsquish PATHS . squish .. ../squish PATH_SUFFIXES lib release minsizerel relwithdebinfo DOC "Path to libSquish library")

 SET(LIBSQUISH_LIBRARIES ${LIBSQUISH_LIBRARY})


Remove print from set_policies

Remove print from set_policies

--- CMakeModules/InternalUtils.cmake
+++ CMakeModules/InternalUtils.cmake
@@ -191,7 +191,6 @@
   cmake_parse_arguments(SP "" "TYPE" "POLICIES" ${ARGN})
   foreach(_policy ${SP_POLICIES})
     if(POLICY ${_policy})
-      message(STATUS ${_policy} ${SP_TYPE})
       cmake_policy(SET ${_policy} ${SP_TYPE})
     endif()
   endforeach()


don't dedupe on Solaris if nodev5

don't dedupe on Solaris if nodev5

--- projects/node.cmake
+++ projects/node.cmake
@@ -90,7 +90,7 @@
       )
     xpStringAppend(rmdirs test)
     xpStringAppend(rmdirs example)
-    if(MSVC)
+    if(MSVC) # we only need to flatten these directories on Windows (installer issue)
       if(${ver} STREQUAL v0)
         xpStringAppend(flatten ${npmDst}/${nm}/node-gyp/${nm}/glob/${nm})
         xpStringAppend(flatten ${npmDst}/${nm}/node-gyp/${nm}/path-array/${nm})
@@ -109,13 +109,16 @@
       COMMAND ${CMAKE_COMMAND} -E copy_directory ${npmSrc} ${npmDst}
       DEPENDEES install
       )
-    ExternalProject_Add_Step(${XP_TARGET} postpost_${XP_TARGET}
-      COMMAND ${npmExe} dedupe
-      COMMAND ${CMAKE_COMMAND} -Drmroot:STRING=${npmDst} -Drmdirs:STRING=${rmdirs}
-        -Ddirs:STRING=${flatten} -P ${MODULES_DIR}/cmsflatnode.cmake
-      WORKING_DIRECTORY ${npmDst}
-      DEPENDEES post_${XP_TARGET}
-      )
+    # dedupe: nodev5 Illegal Instruction on Solaris
+    if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" OR NOT ${ver} STREQUAL v5)
+      ExternalProject_Add_Step(${XP_TARGET} postpost_${XP_TARGET}
+        COMMAND ${npmExe} dedupe
+        COMMAND ${CMAKE_COMMAND} -Drmroot:STRING=${npmDst} -Drmdirs:STRING=${rmdirs}
+          -Ddirs:STRING=${flatten} -P ${MODULES_DIR}/cmsflatnode.cmake
+        WORKING_DIRECTORY ${npmDst}
+        DEPENDEES post_${XP_TARGET}
+        )
+    endif()
     set_property(TARGET ${XP_TARGET} PROPERTY FOLDER ${bld_folder})
   endif()
 endfunction()


Fixes #53

Fixes #53

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -731,7 +731,7 @@
 endif()

 if(PLATFORM_INT MATCHES "^MAC_CATALYST")
-  set(C_TARGET_FLAGS "-target ${APPLE_TARGET_TRIPLE_INT} -isystem ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/usr/include")
+  set(C_TARGET_FLAGS "-target ${APPLE_TARGET_TRIPLE_INT} -isystem ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/usr/include -iframework ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/System/Library/Frameworks")
 endif()

 if(ENABLE_BITCODE_INT)


Add tool_build= param to package.cmake to support separate build #'s for
drmem and a containing DR build.

SVN-Revision: 2065

--- package.cmake
+++ package.cmake
@@ -54,6 +54,10 @@
   if (${arg} MATCHES "^build=")
     string(REGEX REPLACE "^build=" "" arg_build "${arg}")
   endif ()
+  # alternate name to distinguish from containing DR build #
+  if (${arg} MATCHES "^tool_build=")
+    string(REGEX REPLACE "^tool_build=" "" arg_build "${arg}")
+  endif ()
   if (${arg} MATCHES "^ubuild=")
     string(REGEX REPLACE "^ubuild=" "" arg_ubuild "${arg}")
   endif ()


[OGRE-275] Fix bin path searching on OS X.

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -127,6 +127,10 @@

     set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
     set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
+
+    if(APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+      set(OGRE_BIN_SEARCH_PATH ${dir}/bin/macosx ${OGRE_BIN_SEARCH_PATH})
+    endif()
   endforeach(dir)

   if (OGRE_PREFIX_DEPENDENCIES_DIR)


Disable all Eigen vectorized code on Linux.

We've been having problems with Eigen's alignment-correction code.
We don't quite know when this happens (seems to be present in Debian
32-bit, but we haven't seen it in Ubuntu or Debian 64-bit), so I'm
paranoidly disabling vectorization code on all Linux for now.

refs #22

--- CMake/SurgSimBuildFlags.cmake
+++ CMake/SurgSimBuildFlags.cmake
@@ -102,3 +102,11 @@
 if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
 	add_definitions( -D_POSIX_C_SOURCE=200809L )  # request POSIX APIs
 endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+
+# TEMPORARILY work around problems with Eigen's alignment code on Linux.
+# We don't quite know when this happens (seems to be present in Debian
+# 32-bit, but we haven't seen it in Ubuntu or Debian 64-bit), so I'm
+# paranoidly disabling vectorization code on all Linux for now.
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+	add_definitions( -DEIGEN_DONT_ALIGN )
+endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")


Add support for xerces-c 3.2.

Add support for xerces-c 3.2.

--- CMakeModules/FindXerces.cmake
+++ CMakeModules/FindXerces.cmake
@@ -29,14 +29,14 @@
 )

 IF (XERCESC_STATIC)
-FIND_LIBRARY(XERCESC_LIBRARY NAMES xerces-c_static_3 xerces-c-3.1 xerces-c
+FIND_LIBRARY(XERCESC_LIBRARY NAMES xerces-c_static_3 xerces-c-3.2 xerces-c-3.1 xerces-c
  PATHS
  $ENV{XERCESC_LIBRARY_DIR}
  ${XERCESC_LIBRARY_DIR}
  /usr/lib
  /usr/local/lib
 )
-FIND_LIBRARY(XERCESC_LIBRARY_DEBUG NAMES xerces-c_static_3D xerces-c-3.1D
+FIND_LIBRARY(XERCESC_LIBRARY_DEBUG NAMES xerces-c_static_3D xerces-c-3.2D xerces-c-3.1D
  PATHS
  $ENV{XERCESC_LIBRARY_DIR}
  ${XERCESC_LIBRARY_DIR}


Fix cmake output

Fix cmake output

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -102,7 +102,6 @@
 )
 endif()

-message (${MODULE_TESTS})

 # test with image filename as an extra command line parameter
 set(MODULE_IMAGE_TESTS


COMP: deactivated mitkPointSetLocalTest

COMP: deactivated mitkPointSetLocalTest

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -51,7 +51,7 @@
   mitkStepperTest.cpp
   itkTotalVariationDenoisingImageFilterTest.cpp
   mitkDICOMLocaleTest.cpp
-  mitkPointSetLocaleTest.cpp
+  #mitkPointSetLocaleTest.cpp
   mitkRenderingManagerTest.cpp
   vtkMitkThickSlicesFilterTest.cpp
 )


Split off 8.6.46

Split off 8.6.46

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 45 )
+set ( HPCC_POINT 47 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Fix usage with cmake < 3.0.0

Fix usage with cmake < 3.0.0

Qt5UiPlugin requires cmake 3.0.0 [1] so don't try to use it if we're
running with cmake < 3.0.0

[1] http://code.qt.io/cgit/qt/qtbase.git/commit/mkspecs/features/
    data/cmake/Qt5BasicConfig.cmake.in
    ?id=884679a7cc74b85d6c565316520304a9c73b5f04

--- KF5DesignerPluginMacros.cmake
+++ KF5DesignerPluginMacros.cmake
@@ -87,7 +87,7 @@
             PURPOSE "Required to build Qt Designer plugins"
         )
     endif()
-    if(NOT Qt5Designer_VERSION_STRING VERSION_LESS 5.5.0 AND NOT Qt5UiPlugin_FOUND)
+    if(NOT Qt5Designer_VERSION_STRING VERSION_LESS 5.5.0 AND NOT Qt5UiPlugin_FOUND AND NOT CMAKE_VERSION VERSION_LESS 3.0.0)
         find_package(Qt5UiPlugin ${REQUIRED_QT_VERSION} ${_requiredarg} NO_MODULE)
         set_package_properties(Qt5UiPlugin PROPERTIES
             PURPOSE "Required to build Qt Designer plugins"


Make thrift metadata available across fbcode oss builds.

Summary: There are downstream oss builds showing build failure caused by introduction of metadata. We want to make them proceed to build so we won't get errors in CI.

Reviewed By: iahs

Differential Revision: D19900007

fbshipit-source-id: 4201448f7980b53e407fd2bc1c74ed4ffa8e18c1

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -62,12 +62,14 @@
     "${output_dir}/gen-cpp2/${base}_types.h"
     "${output_dir}/gen-cpp2/${base}_types.tcc"
     "${output_dir}/gen-cpp2/${base}_types_custom_protocol.h"
+    "${output_dir}/gen-cpp2/${base}_metadata.h"
   )
   list(APPEND generated_sources
     "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_data.h"
     "${output_dir}/gen-cpp2/${base}_data.cpp"
     "${output_dir}/gen-cpp2/${base}_types.cpp"
+    "${output_dir}/gen-cpp2/${base}_metadata.cpp"
   )
   foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers


* Skip defines that begin 'QT_EDITION..' when doing the config tests for the Qt features
* Reenable the grab_qglobal_symbols() tests

CCMAIL: kde-bindings@kde.org
CCMAIL: germain@ebooksfrance.org

svn path=/trunk/KDE/kdebindings/smoke/; revision=723410

--- qt/qtguess.pl.cmake
+++ qt/qtguess.pl.cmake
@@ -56,7 +56,7 @@
 print "Number of defines to be tested : $used/$total\n\n" unless $opt_q;
 open( QTDEFS, ">>".($opt_o || "qtdefines") ) or die "Can't open output file: $!\n";

-# grab_qglobal_symbols();
+grab_qglobal_symbols();
 preliminary_test();
 perform_all_tests();

@@ -70,13 +70,11 @@
 sub grab_qglobal_symbols
 {
 	my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc -I$qtcoreinc $qtcoreinc/qglobal.h 2>/dev/null";
-print("cmd: '$cmd'\n");
 	my $symbols = `$cmd`;
         for(0..1)
         {
 	    if( check_exit_status($?) )
 	    {
-print("In grab_qglobal_symbols()\n");
 		while( $symbols =~/^#\s*define\s*(QT_\S+)/gm )
 		{
 			$qtdefs{$1} = 1;
@@ -92,7 +90,7 @@
 	    elsif(! $_) # first try
 	    {
 		print  "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n";
-                $cmd = "$cc -E -dM -I$qtinc/QtCore $qtinc/QtCore/qglobal.h 2>/dev/null";
+                $cmd = "$cc -E -dM -I$qtinc -I$qtcoreinc $qtcoreinc/qglobal.h 2>/dev/null";
                 $symbols = `$cmd`;
                 next;
 	    }
@@ -166,7 +164,9 @@
 		open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n";
 		foreach $def(keys %qtdefs)
 		{
-			print OUT "#define $def\n";
+			if ( $def !~ /QT_EDITION/ ) {
+				print OUT "#define $def\n";
+			}
 		}
 		foreach $inc(split /,\s*/, $tests{$_}->[0])
 		{


COMP: missing parenthesis

COMP: missing parenthesis

--- Packaging/install_qgis_bindings.cmake
+++ Packaging/install_qgis_bindings.cmake
@@ -21,6 +21,6 @@
 function(install_qgis_bindings)
   if(HAVE_QGIS)
     install(DIRECTORY ${SUPERBUILD_INSTALL_DIR}/descriptors
-      DESTINATION ${PKG_STAGE_DIR}
+      DESTINATION ${PKG_STAGE_DIR})
   endif()
 endfunction()


Update ArduinoToolchain.cmake

Update ArduinoToolchain.cmake

Fixed typo and added hint for looking for arduino SDK in /opt/arduino

--- cmake/ArduinoToolchain.cmake
+++ cmake/ArduinoToolchain.cmake
@@ -53,7 +53,8 @@
     endforeach()

     file(GLOB SDK_PATH_HINTS /usr/share/arduino*
-                             /opt/local/ardiuno*
+                             /opt/local/arduino*
+                             /opt/arduino*
                              /usr/local/share/arduino*)
     list(SORT SDK_PATH_HINTS)
     list(REVERSE SDK_PATH_HINTS)


Update: simplify using find_package_handle_standard_args

--- cmake/Modules/FindPcap.cmake
+++ cmake/Modules/FindPcap.cmake
@@ -99,14 +99,9 @@
 SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})

 #Is pcap found ?
-IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
-SET( PCAP_FOUND "YES" )
-message(STATUS "PCAP found (include: ${PCAP_INCLUDE_DIRS}, lib: ${PCAP_LIBRARIES})")
-ELSE()
-SET( PCAP_FOUND "NO" )
-message(STATUS "PCAP NOT found")
-ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
-
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PCAP DEFAULT_MSG
+                                  PCAP_LIBRARIES PCAP_INCLUDE_DIRS)

 MARK_AS_ADVANCED(
 PCAP_LIBRARIES


fixing #4136 is rather tricky

fixing #4136 is rather tricky

--- cmake/ShogunFindLAPACK.cmake
+++ cmake/ShogunFindLAPACK.cmake
@@ -19,14 +19,22 @@
         NAMES lapacke
         PATHS /usr/lib /usr/local/lib $ENV{LAPACKE_PATH})
       if (LAPACKE_LIBRARY)
-        MESSAGE(STATUS "Enabling Accelerate.framework as LAPACK backend for Eigen.")
-        SET(EIGEN_USE_LAPACKE_STRICT 1)
-        LIST(APPEND LAPACK_LIBRARIES ${LAPACKE_LIBRARY})
-        find_library(VECLIB vecLib)
-        if (VECLIB)
-          LIST(APPEND LAPACK_LIBRARIES ${VECLIB})
+        # no comes some magic as on osx el capitalismo and sierra leone
+        # versions things are working in some magic way (vecLib that is)
+        # see #4136
+        include(CheckCXXSourceCompiles)
+        CHECK_CXX_SOURCE_COMPILES(
+          "#include <vecLib/cblas.h>
+          int main(void){
+              return 0;
+          }" VECLIB_INCLUDE_WORKS)
+
+        if (VECLIB_INCLUDE_WORKS)
+          MESSAGE(STATUS "Enabling Accelerate.framework as LAPACK backend for Eigen.")
+          SET(EIGEN_USE_LAPACKE_STRICT 1)
+          LIST(APPEND LAPACK_LIBRARIES ${LAPACKE_LIBRARY})
         else()
-          MESSAGE(FATAL_ERROR "Accelerate.framework without vecLib.framework!")
+          MESSAGE(STATUS "Could not include <vecLib/cblas.h> hence not enabling LAPACK as an Eigen backend")
         endif()
       endif()
     endif()


avoid using ARGN for efficiency

avoid using ARGN for efficiency

--- cmake/catkin_libraries.cmake
+++ cmake/catkin_libraries.cmake
@@ -78,7 +78,7 @@
     if("${lib}" MATCHES "^debug|optimized|general$")
       math(EXPR _index "${_index} + 1")
       if(${_index} EQUAL ${_count})
-        message(FATAL_ERROR "catkin_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library")
+        message(FATAL_ERROR "catkin_pack_libraries_with_build_configuration() the list of libraries '${_argn}' ends with '${lib}' which is a build configuration keyword and must be followed by a library")
       endif()
       list(GET _argn ${_index} library)
       list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}")
@@ -87,7 +87,7 @@
     endif()
     math(EXPR _index "${_index} + 1")
   endwhile()
-  debug_message(10 "catkin_pack_libraries_with_build_configuration(${VAR} ${ARGN}) ${${VAR}}")
+  #debug_message(10 "catkin_pack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}")
 endmacro()

 #
@@ -107,7 +107,8 @@
     string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}")
     list(APPEND ${VAR} "${lib}")
   endforeach()
-  debug_message(10 "catkin_unpack_libraries_with_build_configuration(${VAR} ${ARGN}) ${${VAR}}")
+  #set(_argn ${ARGN})
+  #debug_message(10 "catkin_unpack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}")
 endmacro()

 #
@@ -153,5 +154,6 @@
       list(APPEND ${VAR} "${lib}")
     endif()
   endforeach()
-  debug_message(10 "catkin_replace_imported_library_targets(${VAR} ${ARGN}) ${${VAR}}")
+  #set(_argn ${ARGN})
+  #debug_message(10 "catkin_replace_imported_library_targets(${VAR} ${_argn}) ${${VAR}}")
 endmacro()


[R-package] changed FindLibR to take advantage of CMake cache (#5427)

--- cmake/modules/FindLibR.cmake
+++ cmake/modules/FindLibR.cmake
@@ -50,10 +50,10 @@
       \nDo you have Rtools installed with its MinGW's bin/ in PATH?")
   endif()
   # extract symbols from R.dll into R.def and R.lib import library
-  execute_process(COMMAND gendef
+  execute_process(COMMAND ${GENDEF_EXE}
     "-" "${LIBR_LIB_DIR}/R.dll"
     OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/R.def")
-  execute_process(COMMAND dlltool
+  execute_process(COMMAND ${DLLTOOL_EXE}
     "--input-def" "${CMAKE_CURRENT_BINARY_DIR}/R.def"
     "--output-lib" "${CMAKE_CURRENT_BINARY_DIR}/R.lib")
 endfunction(create_rlib_for_msvc)


qibuild/external: remove ugly hack for mac32

32 bits is the past, man!

--- cmake/qibuild/external.cmake
+++ cmake/qibuild/external.cmake
@@ -23,11 +23,6 @@

   set(options)
   list(APPEND options "${ARGS_CONFIGURE_OPTIONS}")
-
-  # Ugly hack for mac: configure the CFGLAGS based on the name of the toolchain...
-  if("${QI_TOOLCHAIN_NAME}" STREQUAL "mac-32")
-    list(APPEND options "CFLAGS=-arch i386")
-  endif()

   set(patchs_cmd)
   foreach(p ${ARGS_PATCH})


WIP: bumped elastix version. GCC build except for static_asserts in InterfaceTraits.h

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -1,7 +1,7 @@
 set( proj Elastix )

 set( ELASTIX_REPOSITORY https://svn.bigr.nl/elastix/trunkpublic/ )
-set( ELASTIX_REVISION 5256 )
+set( ELASTIX_REVISION 5261 )

 ExternalProject_Add( ${proj}
   SVN_REPOSITORY ${ELASTIX_REPOSITORY}


tinyxml2 find

tinyxml2 find

--- tutorial/cmake/FindTINYXML2.cmake
+++ tutorial/cmake/FindTINYXML2.cmake
@@ -10,6 +10,7 @@
    /usr/local/include
    ${PROJECT_SOURCE_DIR}/../libigl/external/tinyxml2/
    ${PROJECT_SOURCE_DIR}/../../external/tinyxml2/
+   ${PROJECT_SOURCE_DIR}/../external/tinyxml2/
    ${PROJECT_SOURCE_DIR}/external/tinyxml2/
 )


[Config] (hopefully) better detection of Boost.Python across platforms

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -504,7 +504,7 @@
 	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
 	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
 	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
+
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")

 	# Set the Python installation directory
@@ -585,15 +585,15 @@
 macro (register_boost_lib _boost_lib_list_name _boost_lib_list)
   # Update the list of library dependencies for the project
   foreach (_lib_cpt ${_boost_lib_list})
-	string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-	if (Boost_${_lib_cpt_up}_LIBRARY)
-	  # Update the list of dependencies for the project
-	  list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
-
-	  # Update the list of libraries to be displayed
-	  list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endif (Boost_${_lib_cpt_up}_LIBRARY)
+    string (TOUPPER ${_lib_cpt} _lib_cpt_up)
+
+    if (Boost_${_lib_cpt_up}_LIBRARY)
+      # Update the list of dependencies for the project
+      list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
+
+      # Update the list of libraries to be displayed
+      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
+    endif (Boost_${_lib_cpt_up}_LIBRARY)
   endforeach (_lib_cpt ${_boost_lib_list})
 endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)

@@ -606,18 +606,26 @@
   else (${ARGC} GREATER 0)
     message (STATUS "Requires Boost without specifying any version")
   endif (${ARGC} GREATER 0)
-
+
   #
-  # Note: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
-  # are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
-  #
-  set (python_component_name "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  # Note 1: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
+  #         are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
+  # Note 2: Boost libraries are not installed in a consistent way across the
+  #         the different platforms and versions of Boost.
+  #         For a while, the Boost.Python library component was just called
+  #         'python'. It is now suffixed with the version of Python, and
+  #         on some Linux distributions, there is even a '-py' suffix.
+  #         On some platform/Boost version combinations, the Python version
+  #         may be just the major version (2 or 3 as of 2019) or the major
+  #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
+  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
+  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale ${python_component_name} regex)
+    locale ${python_cpt_name1} ${python_cpt_name2} regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
@@ -637,23 +645,28 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
+    # Boost.Python library
+    message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
+
     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})

-	# For display purposes
+    # For display purposes
     set (BOOST_REQUIRED_LIBS "")

     # Update the list of library dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of binary dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")

     # Update the list of test dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")

   endif (Boost_FOUND)


[Conf] Only add the dependency on a Boost library when that latter exists.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -536,6 +536,23 @@
 endmacro (get_zeromq)

 # ~~~~~~~~~~ BOOST ~~~~~~~~~~
+#
+macro (register_boost_lib _boost_lib_list_name _boost_lib_list)
+  # Update the list of library dependencies for the project
+  foreach (_lib_cpt ${_boost_lib_list})
+	string (TOUPPER ${_lib_cpt} _lib_cpt_up)
+
+	if (Boost_${_lib_cpt_up}_LIBRARY)
+	  # Update the list of dependencies for the project
+	  list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
+
+	  # Update the list of libraries to be displayed
+	  list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
+	endif (Boost_${_lib_cpt_up}_LIBRARY)
+  endforeach (_lib_cpt ${_boost_lib_list})
+endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)
+
+#
 macro (get_boost)
   unset (_required_version)
   if (${ARGC} GREATER 0)
@@ -580,37 +597,16 @@
     set (BOOST_REQUIRED_LIBS "")

     # Update the list of library dependencies for the project
-	foreach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_LIB})
-	  string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-      # Update the list of dependencies for the project
-      list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Boost_${_lib_cpt_up}_LIBRARY})
-
-      # Update the list of libraries to be displayed
-      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endforeach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_LIB})
+	register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
+	  "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of binary dependencies for the project
-	foreach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_BIN})
-	  string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-      # Update the list of dependencies for the project
-      list (APPEND PROJ_DEP_LIBS_FOR_BIN ${Boost_${_lib_cpt_up}_LIBRARY})
-
-      # Update the list of binaries to be displayed
-      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endforeach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_BIN})
+	register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
+	  "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")

     # Update the list of test dependencies for the project
-	foreach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_TST})
-	  string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-      # Update the list of dependencies for the project
-      list (APPEND PROJ_DEP_LIBS_FOR_TST ${Boost_${_lib_cpt_up}_LIBRARY})
-
-      # Update the list of tests to be displayed
-      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endforeach (_lib_cpt ${BOOST_REQUIRED_COMPONENTS_FOR_TST})
+	register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
+	  "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")

   endif (Boost_FOUND)


deleted ghost-targets.cmake as it is not needed. preparation of release

--- ghost-targets.cmake
+++ ghost-targets.cmake
@@ -1,6 +0,0 @@
-add_library(GHOST IMPORTED)
-if (${LIBTYPE} STREQUAL "STATIC")
-set_property(TARGET GHOST PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/libghost.a)
-elseif (${LIBTYPE} STREQUAL "SHARED")
-set_property(TARGET GHOST PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/libghost.so)
-endif()


Fix order of modules in cmake find script

--- libzeug-config.cmake
+++ libzeug-config.cmake
@@ -7,13 +7,13 @@

 # List of modules
 set(MODULE_NAMES
+    signalzeug
+    stringzeug
+    reflectionzeug
     iozeug
     loggingzeug
     propertyguizeug
-    reflectionzeug
     scriptzeug
-    signalzeug
-    stringzeug
     threadingzeug
     widgetzeug
 )


machxo2: Fail CMake configuration is BUILD_PYTHON is ON (not supported for now).

--- machxo2/family.cmake
+++ machxo2/family.cmake
@@ -1,5 +1,8 @@
 if (BUILD_GUI)
     message(FATAL_ERROR "GUI support is not implemented for MachXO2. Build with -DBUILD_GUI=OFF.")
+endif()
+if (BUILD_PYTHON)
+    message(FATAL_ERROR "Python support is not implemented for MachXO2. Build with -DBUILD_PYTHON=OFF.")
 endif()
 add_subdirectory(${family})
 message(STATUS "Using MachXO2 chipdb: ${MACHXO2_CHIPDB}")


fixing typo

fixing typo

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -152,7 +152,7 @@

 if(DEFINED IOS_DEPLOYMENT_TARGET)
   set(DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET})
-  message(DEPRECATION "CMAKE_IOS_DEVELOPER_ROOT argument is DEPRECATED. Consider using the new CMAKE_DEVELOPER_ROOT argument instead.")
+  message(DEPRECATION "IOS_DEPLOYMENT_TARGET argument is DEPRECATED. Consider using the new DEPLOYMENT_TARGET argument instead.")
 endif()

 if(DEFINED CMAKE_IOS_DEVELOPER_ROOT)


Ignore CMAKE_INSTALL_PREFIX

Ignore CMAKE_INSTALL_PREFIX

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -19,7 +19,7 @@
             set(CACHE_VAR_TYPE :${CACHE_VAR_TYPE})
         endif()

-        if("${CACHE_VAR}" STREQUAL "BACKEND" OR "${CACHE_VAR}" STREQUAL "CLUSTER" OR "${CACHE_VAR}" STREQUAL "THREAD")
+        if("${CACHE_VAR}" STREQUAL "BACKEND" OR "${CACHE_VAR}" STREQUAL "CLUSTER" OR "${CACHE_VAR}" STREQUAL "THREAD" OR "${CACHE_VAR}" STREQUAL "CMAKE_INSTALL_PREFIX")
         else()
             LIST(FIND CMAKE_ARGS ${CACHE_VAR}${CACHE_VAR_TYPE} index)
             if(${index} GREATER -1)


correctly specify working directory for dtrace_prelink. Also, generate _dtrace.o in the object directory

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -74,7 +74,7 @@
      # link it together with target.
     IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
       SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
-      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace.o)
+      SET(outfile ${objdir}/${target}_dtrace.o)

       ADD_CUSTOM_COMMAND(
         TARGET ${target} PRE_LINK
@@ -84,7 +84,7 @@
           -DDFILE=${CMAKE_BINARY_DIR}/include/probes_mysql.d
           -DDTRACE_FLAGS=${DTRACE_FLAGS}
           -P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake
-        WORKING_DIRECTORY ${OBJDIR}
+        WORKING_DIRECTORY ${objdir}
       )
       SET_TARGET_PROPERTIES(${target} PROPERTIES LINK_FLAGS "${outfile}")
     ENDIF()


Only create wheel package if wheel module found

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -140,11 +140,26 @@
 	COMMAND ${CMAKE_COMMAND} -E echo ")" >> setup.py
 	VERBATIM)

+# Look for python module wheel
+execute_process(
+	COMMAND ${PYTHON_EXECUTABLE} "-c" "import wheel"
+	RESULT_VARIABLE _RESULT
+	ERROR_QUIET
+	OUTPUT_STRIP_TRAILING_WHITESPACE
+	)
+set(BDIST_WHEEL "")
+if(${_RESULT} STREQUAL "0")
+	message(STATUS "Found python module: wheel")
+	set(BDIST_WHEEL "bdist_wheel")
+else()
+	message(WARNING "Can't find python module: wheel")
+endif()
+
 # Main Target
 add_custom_target(bdist ALL
 	DEPENDS setup.py Py${PROJECT_NAME}_proto
-	COMMAND ${PYTHON_EXECUTABLE} setup.py bdist
-	COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_wheel
+	COMMAND ${CMAKE_COMMAND} -E remove_directory dist
+	COMMAND ${PYTHON_EXECUTABLE} setup.py bdist ${BDIST_WHEEL}
 	)

 # Test


FindVOTCA_TOOLS.cmake: fixed a typo

FindVOTCA_TOOLS.cmake: fixed a typo

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -30,6 +30,9 @@
 if (VOTCA_TOOLS_HAS_SQLITE3)
   #due to include <sqlite3.h> in database.h
   find_package(SQLITE3 REQUIRED)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR}" )
+else(VOTCA_TOOLS_HAS_SQLITE3)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )
 endif (VOTCA_TOOLS_HAS_SQLITE3)

@@ -48,7 +51,6 @@
 endif("${VOTCA_TOOLS_LIBRARY}" MATCHES "libvotca_tools[^;]*\\.a")

 set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" )
-set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set VOTCA_TOOLS_FOUND to TRUE


Fixed Vc_IMPL define being incorrectly set

--- cmake/Modules/CxxSwizzleSandbox.cmake
+++ cmake/Modules/CxxSwizzleSandbox.cmake
@@ -165,8 +165,7 @@
     if (${setup} STREQUAL "simd_vc" OR ${setup} STREQUAL "simd_vc_masked")
         cmake_policy(SET CMP0057 NEW)
         target_link_libraries(${target_name} PRIVATE Vc::Vc)
-        # Vc needs an extra hint
-        target_compile_options(${target_name} PRIVATE "-DVc_IMPL=${Vc_IMPL}")
+        target_compile_options(${target_name} PRIVATE "${Vc_DEFINITIONS}")
     endif()

     if (OPENMP_FOUND)


Pass -Wa,-mbig-obj in 64-bit mingw builds

COFF has a 2**16 section limit, and on Win64, every COMDAT function
creates at least 3 sections: .text, .pdata, and .xdata. For MSVC, we
enable bigobj on a file-by-file basis, but GCC appears to hit the limit
on different files.

Fixes PR25953

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -232,6 +232,13 @@
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
 elseif(MINGW) # FIXME: Also cygwin?
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216")
+
+  # Pass -mbig-obj to mingw gas on Win64. COFF has a 2**16 section limit, and
+  # on Win64, every COMDAT function creates at least 3 sections: .text, .pdata,
+  # and .xdata.
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  endif()
 endif()

 if( MSVC )


Applied patch from Ben Morgan (ROOT-6512 - RootConfiguration.cmake hardcodes paths into installed ROOTConfig.cmake)

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -439,17 +439,22 @@
                ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY)

 #---To be used from the install tree--------------------------------------------------------------------------
+# Need to calculate actual relative paths from CMAKEDIR to other locations
+file(RELATIVE_PATH ROOT_CMAKE_TO_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+file(RELATIVE_PATH ROOT_CMAKE_TO_LIB_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}")
+file(RELATIVE_PATH ROOT_CMAKE_TO_BIN_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_BINDIR}")
+
 set(ROOT_INCLUDE_DIR_SETUP "
 # ROOT configured for the install with relative paths, so use these
-get_filename_component(ROOT_INCLUDE_DIRS \"\${_thisdir}/../include\" ABSOLUTE)
+get_filename_component(ROOT_INCLUDE_DIRS \"\${_thisdir}/${ROOT_CMAKE_TO_INCLUDE_DIR}\" ABSOLUTE)
 ")
 set(ROOT_LIBRARY_DIR_SETUP "
 # ROOT configured for the install with relative paths, so use these
-get_filename_component(ROOT_LIBRARY_DIR \"\${_thisdir}/../lib\" ABSOLUTE)
+get_filename_component(ROOT_LIBRARY_DIR \"\${_thisdir}/${ROOT_CMAKE_TO_LIB_DIR}\" ABSOLUTE)
 ")
 set(ROOT_BINARY_DIR_SETUP "
 # ROOT configured for the install with relative paths, so use these
-get_filename_component(ROOT_BINARY_DIR \"\${_thisdir}/../bin\" ABSOLUTE)
+get_filename_component(ROOT_BINARY_DIR \"\${_thisdir}/${ROOT_CMAKE_TO_BIN_DIR}\" ABSOLUTE)
 ")
 set(ROOT_MODULE_PATH_SETUP "
 # ROOT configured for use CMake modules from installation tree


Fixes #5255.  Disable intel warning 1292: {{{svn merge -c 45766 ../tokudb.3571}}}

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@45767 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -84,6 +84,7 @@
   set(intel_warnings
     94     # allow arrays of length 0
     589    # do not complain about goto that skips initialization
+    1292   # icc lies (it says it is "__GNUC__", but it doesn't handle the resulting macroexpansions from glibc 2.15.37 (which is designed for gcc 4.7, and appears in Fedora 17)
     2259   # do not complain about "non-pointer conversion from int to u_int8_t (and other small types) may lose significant bits".  this produces too many false positives
     11000  # do not remark about multi-file optimizations, single-file optimizations, and object temp files
     11001


glave: Add COMPILER_ARG1 to be compatible with ccache

--- tools/glave/src/build_options.cmake
+++ tools/glave/src/build_options.cmake
@@ -202,7 +202,7 @@
 endif()

 if (CMAKE_COMPILER_IS_GNUCC)
-    execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+    execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
     string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
     list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
     list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)


update Packaging.cmake for remove the script clean-query.sh

--- source/Packaging.cmake
+++ source/Packaging.cmake
@@ -154,7 +154,7 @@
     )
   INSTALL( PROGRAMS
     ${CMAKE_SOURCE_DIR}/../bin/sf1r-engine
-    ${CMAKE_SOURCE_DIR}/../bin/clean.query
+	#    ${CMAKE_SOURCE_DIR}/../bin/clean.query
     DESTINATION "bin"
     COMPONENT sf1r_packings
     )


make the cmake boost signals check more dynamic

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -315,7 +315,13 @@
 	# and this on newer CMake (>=2.6?)
 	#SET(LIBS ${LIBS} /usr/lib/libboost_signals.a /usr/lib/libboost_system.a)
 ELSE(BOOST_LINK_STATIC)
-	SET(LIBS ${LIBS} boost_signals-mt)
+	FIND_PACKAGE(Boost)
+	IF(Boost_signals_FOUND)
+		SET(LIBS ${LIBS} ${Boost_signals_LIBRARIES})
+	ELSE()
+		MESSAGE("boost-signals not found, trying just boost_signals-mt")
+		SET(LIBS ${LIBS} boost_signals-mt)
+	ENDIF()
 ENDIF(BOOST_LINK_STATIC)

 IF(APPLE)


- Add important libraries for NaCL

- Add important libraries for NaCL


REFAC: update GDAL version from 3.2.2 to 3.4.0

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -149,8 +149,8 @@

 ExternalProject_Add(GDAL
   PREFIX GDAL
-  URL "https://download.osgeo.org/gdal/3.2.2/gdal-3.2.2.tar.xz"
-  URL_MD5 c656be582f7beb528c66486cd1fca7a2
+  URL "https://download.osgeo.org/gdal/3.4.0/gdal-3.4.0.tar.xz"
+  URL_MD5 aae5f3394dcd3ad6ddbe1137121b624b
   SOURCE_DIR ${GDAL_SB_SRC}
   BINARY_DIR ${GDAL_SB_SRC}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   01)
+SET(KWSYS_DATE_STAMP_DAY   02)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   20)
+SET(KWSYS_DATE_STAMP_DAY   21)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   17)
+SET(KWSYS_DATE_STAMP_DAY   18)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   11)
+SET(KWSYS_DATE_STAMP_DAY   12)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   19)
+SET(KWSYS_DATE_STAMP_DAY   20)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   03)
+SET(KWSYS_DATE_STAMP_DAY   04)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   19)
+SET(KWSYS_DATE_STAMP_DAY   20)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   16)
+SET(KWSYS_DATE_STAMP_DAY   17)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   18)
+SET(KWSYS_DATE_STAMP_DAY   19)


Clean module file before each executable build

Module file can change depending on the transformation applied

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -57,6 +57,12 @@
   COMMAND rm -f ${OUTPUT_FILE_CPU} ${OUTPUT_FILE_GPU}
 )

+# Clean module file between compilation as it change
+add_custom_target(
+  clean-mod-file-${TEST_NAME}
+  COMMAND rm -f *.mod
+)
+
 # Add target to the global build/clean target
 add_dependencies(${BUILD_TEST_TARGET} transform-${TEST_NAME})
 add_dependencies(${CLEAN_TEST_TARGET} clean-${TEST_NAME})
@@ -70,6 +76,10 @@
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_CPU} PRIVATE -D_CLAW)
 add_executable (${EXECUTABLE_TRANSFORMED_GPU} EXCLUDE_FROM_ALL ${OUTPUT_FILE_GPU} main.f90)
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_GPU} PRIVATE -D_CLAW)
+
+add_dependencies(${EXECUTABLE_ORIGINAL} clean-mod-file-${TEST_NAME})
+add_dependencies(${EXECUTABLE_TRANSFORMED_CPU} clean-mod-file-${TEST_NAME})
+add_dependencies(${EXECUTABLE_TRANSFORMED_GPU} clean-mod-file-${TEST_NAME})

 if(NOT IGNORE_TEST)
   # Compare reference transformed code and output of the transformation


COMP: missing mark_as_advanced in FindFFTW, polluting external projects

--- CMake/FindFFTW.cmake
+++ CMake/FindFFTW.cmake
@@ -20,6 +20,7 @@
   )

   FIND_PATH(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH})
+  MARK_AS_ADVANCED(FFTW_INCLUDE_PATH)

   IF(FFTW_INCLUDE_PATH)
     SET(FFTW_INCLUDE ${FFTW_INCLUDE_PATH})
@@ -38,10 +39,12 @@
   )

   IF(USE_FFTWD)
-    MARK_AS_ADVANCED(FFTWD_LIB)
+
 #   OPTION(FFTWD_LIB "The full path to the fftw3 library (including the library)" )
     FIND_LIBRARY(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib
     FIND_LIBRARY(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib only if compiled with threads support
+    MARK_AS_ADVANCED(FFTWD_LIB)
+    MARK_AS_ADVANCED(FFTWD_THREADS_LIB)

     IF(FFTWD_LIB)
       SET(FFTWD_FOUND 1)
@@ -52,10 +55,11 @@
   ENDIF(USE_FFTWD)

   IF(USE_FFTWF)
-    MARK_AS_ADVANCED(FFTWF_LIB)
 #   OPTION(FFTWF_LIB "The full path to the fftw3f library (including the library)" )
     FIND_LIBRARY(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib
     FIND_LIBRARY(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib only if compiled with threads support
+    MARK_AS_ADVANCED(FFTWF_LIB)
+    MARK_AS_ADVANCED(FFTWF_THREADS_LIB)

     IF(FFTWF_LIB)
       SET(FFTWF_FOUND 1)


Change dist.cmake

Change dist.cmake

--- dist.cmake
+++ dist.cmake
@@ -1,86 +1,406 @@
 # LuaDist CMake utility library.
 # Provides variables and utility functions common to LuaDist CMake builds.
 #
-# Copyright (C) 2007-2010 LuaDist.
+# Copyright (C) 2007-2011 LuaDist.
 # by David Manura, Peter Drahos
 # Redistribution and use of this file is allowed according to the terms of the MIT license.
 # For details see the COPYRIGHT file distributed with LuaDist.
 # Please note that the package source code is licensed under its own license.

-# Few convinence settings
-SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
-SET (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
-
-# Where to install module parts:
-set(INSTALL_BIN bin CACHE PATH "Where to install binaries to.")
-set(INSTALL_LIB lib CACHE PATH "Where to install libraries to.")
-set(INSTALL_INC include CACHE PATH "Where to install headers to.")
-set(INSTALL_ETC etc CACHE PATH "Where to store configuration files")
-set(INSTALL_LMOD share/lua/lmod CACHE PATH "Directory to install Lua modules.")
-set(INSTALL_CMOD share/lua/cmod CACHE PATH "Directory to install Lua binary modules.")
-set(INSTALL_DATA share/${PROJECT_NAME} CACHE PATH "Directory the package can store documentation, tests or other data in.")
-set(INSTALL_DOC ${INSTALL_DATA}/doc CACHE PATH "Recommended directory to install documentation into.")
-set(INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH "Recommended directory to install examples into.")
-set(INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH "Recommended directory to install tests into.")
-set(INSTALL_FOO ${INSTALL_DATA}/etc CACHE PATH "Where to install additional files")
-
+## INSTALL DEFAULTS (Relative to CMAKE_INSTALL_PREFIX)
+# Primary paths
+set ( INSTALL_BIN bin CACHE PATH "Where to install binaries to." )
+set ( INSTALL_LIB lib CACHE PATH "Where to install libraries to." )
+set ( INSTALL_INC include CACHE PATH "Where to install headers to." )
+set ( INSTALL_ETC etc CACHE PATH "Where to store configuration files" )
+set ( INSTALL_LMOD ${INSTALL_LIB}/lua CACHE PATH "Directory to install Lua modules." )
+set ( INSTALL_CMOD ${INSTALL_LIB}/lua CACHE PATH "Directory to install Lua binary modules." )
+set ( INSTALL_SHARE share CACHE PATH "Directory for shared data." )
+
+# Secondary paths
+set ( INSTALL_DATA ${INSTALL_SHARE}/${PROJECT_NAME} CACHE PATH "Directory the package can store documentation, tests or other data in.")
+set ( INSTALL_DOC ${INSTALL_DATA}/doc CACHE PATH "Recommended directory to install documentation into.")
+set ( INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH "Recommended directory to install examples into.")
+set ( INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH "Recommended directory to install tests into.")
+set ( INSTALL_FOO ${INSTALL_DATA}/etc CACHE PATH "Where to install additional files")
+
+# Skipable content, headers, binaries and libraries are always required
+option ( SKIP_TESTING "Do not add tests." OFF)
+option ( SKIP_LUA_WRAPPER "Do not build and install Lua executable wrappers." OFF)
+option ( SKIP_INSTALL_DATA "Skip installing all data." OFF )
+if ( NOT SKIP_INSTALL_DATA )
+  option ( SKIP_INSTALL_DOC "Skip installation of documentation." OFF )
+  option ( SKIP_INSTALL_EXAMPLE "Skip installation of documentation." OFF )
+  option ( SKIP_INSTALL_TEST "Skip installation of tests." OFF)
+  option ( SKIP_INSTALL_FOO "Skip installation of optional package content." OFF)
+endif ()
+
+# TWEAKS
+# Setting CMAKE to use loose block and search for find modules in source directory
+set ( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
+set ( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} )

 # In MSVC, prevent warnings that can occur when using standard libraries.
-if(MSVC)
-	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-endif(MSVC)
-
-# Adds Lua shared library module target `_target`.
-# Additional sources to build the module are listed after `_target`.
-macro(add_lua_module _target)
-	find_package(Lua51 REQUIRED)
-	include_directories(${LUA_INCLUDE_DIR})  #2DO: somehow apply only to _target?
-
-	add_library(${_target} MODULE ${ARGN})
-	set_target_properties(${_target} PROPERTIES PREFIX "")
-	target_link_libraries(${_target} ${LUA_LIBRARY})
-
-	IF(WIN32)
-		set_target_properties(${_target} PROPERTIES LINK_FLAGS "-Wl,--enable-auto-import")
-	ENDIF()
-
-endmacro(add_lua_module)
-
+if ( MSVC )
+	add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
+endif ()
+
+## MACROS
+# Parser macro
+macro ( parse_arguments prefix arg_names option_names)
+  set ( DEFAULT_ARGS )
+  foreach ( arg_name ${arg_names} )
+    set ( ${prefix}_${arg_name} )
+  endforeach ()
+  foreach ( option ${option_names} )
+    set ( ${prefix}_${option} FALSE )
+  endforeach ()
+
+  set ( current_arg_name DEFAULT_ARGS )
+  set ( current_arg_list )
+  foreach ( arg ${ARGN} )
+    set ( larg_names ${arg_names} )
+    list ( FIND larg_names "${arg}" is_arg_name )
+    if ( is_arg_name GREATER -1 )
+      set ( ${prefix}_${current_arg_name} ${current_arg_list} )
+      set ( current_arg_name ${arg} )
+      set ( current_arg_list )
+    else ()
+      set ( loption_names ${option_names} )
+      list ( FIND loption_names "${arg}" is_option )
+      if ( is_option GREATER -1 )
+	     set ( ${prefix}_${arg} TRUE )
+      else ()
+	     set ( current_arg_list ${current_arg_list} ${arg} )
+      endif ()
+    endif ()
+  endforeach ()
+  set ( ${prefix}_${current_arg_name} ${current_arg_list} )
+endmacro ()
+
+# INSTALL_LUA_EXECUTABLE ( target source )
+# Automatically generate a binary wrapper for lua application and install it
+# The wrapper and the source of the application will be placed into /bin
+# If the application source did not have .lua suffix then it will be added
+# USE: lua_executable ( sputnik src/sputnik.lua )
+macro ( install_lua_executable _name _source )
+  get_filename_component ( _source_name ${_source} NAME_WE )
+  if ( NOT SKIP_LUA_WRAPPER )
+    enable_language ( C )
+
+    find_package ( Lua51 REQUIRED )
+    include_directories ( ${LUA_INCLUDE_DIR} )
+
+    set ( _wrapper ${CMAKE_CURRENT_BINARY_DIR}/${_name}.c )
+    set ( _code
+"// Not so simple executable wrapper for Lua apps
+#include <stdio.h>
+#include <signal.h>
+#include <lua.h>
+#include <lauxlib.h>
+#include <lualib.h>
+
+lua_State *L\;
+
+static int getargs (lua_State *L, char **argv, int n) {
+int narg\;
+int i\;
+int argc = 0\;
+while (argv[argc]) argc++\;
+narg = argc - (n + 1)\;
+luaL_checkstack(L, narg + 3, \"too many arguments to script\")\;
+for (i=n+1\; i < argc\; i++)
+  lua_pushstring(L, argv[i])\;
+lua_createtable(L, narg, n + 1)\;
+for (i=0\; i < argc\; i++) {
+  lua_pushstring(L, argv[i])\;
+  lua_rawseti(L, -2, i - n)\;
+}
+return narg\;
+}
+
+static void lstop (lua_State *L, lua_Debug *ar) {
+(void)ar\;
+lua_sethook(L, NULL, 0, 0)\;
+luaL_error(L, \"interrupted!\")\;
+}
+
+static void laction (int i) {
+signal(i, SIG_DFL)\;
+lua_sethook(L, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1)\;
+}
+
+static void l_message (const char *pname, const char *msg) {
+if (pname) fprintf(stderr, \"%s: \", pname)\;
+fprintf(stderr, \"%s\\n\", msg)\;
+fflush(stderr)\;
+}
+
+static int report (lua_State *L, int status) {
+if (status && !lua_isnil(L, -1)) {
+  const char *msg = lua_tostring(L, -1)\;
+  if (msg == NULL) msg = \"(error object is not a string)\"\;
+  l_message(\"${_source_name}\", msg)\;
+  lua_pop(L, 1)\;
+}
+return status\;
+}
+
+static int traceback (lua_State *L) {
+if (!lua_isstring(L, 1))
+  return 1\;
+lua_getfield(L, LUA_GLOBALSINDEX, \"debug\")\;
+if (!lua_istable(L, -1)) {
+  lua_pop(L, 1)\;
+  return 1\;
+}
+lua_getfield(L, -1, \"traceback\")\;
+if (!lua_isfunction(L, -1)) {
+  lua_pop(L, 2)\;
+  return 1\;
+}
+lua_pushvalue(L, 1)\;
+lua_pushinteger(L, 2)\;
+lua_call(L, 2, 1)\;
+return 1\;
+}
+
+static int docall (lua_State *L, int narg, int clear) {
+int status\;
+int base = lua_gettop(L) - narg\;
+lua_pushcfunction(L, traceback)\;
+lua_insert(L, base)\;
+signal(SIGINT, laction)\;
+status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base)\;
+signal(SIGINT, SIG_DFL)\;
+lua_remove(L, base)\;
+if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0)\;
+return status\;
+}
+
+int main (int argc, char **argv) {
+L=lua_open()\;
+lua_gc(L, LUA_GCSTOP, 0)\;
+luaL_openlibs(L)\;
+lua_gc(L, LUA_GCRESTART, 0)\;
+int narg = getargs(L, argv, 0)\;
+lua_setglobal(L, \"arg\")\;
+
+// Script
+char script[500] = \"./${_source_name}.lua\"\;
+lua_getglobal(L, \"_PROGDIR\")\;
+if (lua_isstring(L, -1)) {
+  sprintf( script, \"%s/${_source_name}.lua\", lua_tostring(L, -1))\;
+}
+lua_pop(L, 1)\;
+
+// Run
+int status = luaL_loadfile(L, script)\;
+lua_insert(L, -(narg+1))\;
+if (status == 0)
+  status = docall(L, narg, 0)\;
+else
+  lua_pop(L, narg)\;
+
+report(L, status)\;
+lua_close(L)\;
+return status\;
+};
+")
+    file ( WRITE ${_wrapper} ${_code} )
+    add_executable ( ${_name} ${_wrapper} )
+    target_link_libraries ( ${_name} ${LUA_LIBRARY} )
+    install ( TARGETS ${_name} DESTINATION ${INSTALL_BIN} )
+  endif()
+  install ( PROGRAMS ${_source} DESTINATION ${INSTALL_BIN} RENAME ${_source_name}.lua )
+endmacro ()
+
+# INSTALL_LIBRARY
+# Installs any libraries generated using "add_library" into apropriate places.
+# USE: install_library ( libexpat )
+macro ( install_library )
+  foreach ( _file ${ARGN} )
+    install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN} LIBRARY DESTINATION ${INSTALL_LIB} ARCHIVE DESTINATION ${INSTALL_LIB} )
+  endforeach()
+endmacro ()
+
+# INSTALL_EXECUTABLE
+# Installs any executables generated using "add_executable".
+# USE: install_executable ( lua )
+macro ( install_executable )
+  foreach ( _file ${ARGN} )
+    install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN} )
+  endforeach()
+endmacro ()
+
+# INSTALL_HEADER
+# Install a directories or files into header destination.
+# USE: install_header ( lua.h luaconf.h ) or install_header ( GL )
+# NOTE: If headers need to be installed into subdirectories use the INSTALL command directly
+macro ( install_header )
+  parse_arguments ( _ARG "INTO" "" ${ARGN} )
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO} )
+    endif ()
+  endforeach()
+endmacro ()
+
+# INSTALL_DATA ( files/directories )
+# This installs additional data files or directories.
+# USE: install_data ( extra data.dat )
+macro ( install_data )
+  if ( NOT SKIP_INSTALL_DATA )
+    parse_arguments ( _ARG "INTO" "" ${ARGN} )
+    foreach ( _file ${_ARG_DEFAULT_ARGS} )
+      if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+        install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO} )
+      else ()
+        install ( FILES ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO} )
+      endif ()
+    endforeach()
+  endif()
+endmacro ()
+
+# INSTALL_DOC ( files/directories )
+# This installs documentation content
+# USE: install_doc ( doc/ )
+macro ( install_doc )
+  if ( NOT SKIP_INSTALL_DATA AND NOT SKIP_INSTALL_DOC )
+    parse_arguments ( _ARG "INTO" "" ${ARGN} )
+    foreach ( _file ${_ARG_DEFAULT_ARGS} )
+      if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+        install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO} )
+      else ()
+        install ( FILES ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO} )
+      endif ()
+    endforeach()
+  endif()
+endmacro ()
+
+# INSTALL_EXAMPLE ( files/directories )
+# This installs additional data
+# USE: install_example ( examples/ exampleA.lua )
+macro ( install_example )
+  if ( NOT SKIP_INSTALL_DATA AND NOT SKIP_INSTALL_EXAMPLE )
+    parse_arguments ( _ARG "INTO" "" ${ARGN} )
+    foreach ( _file ${_ARG_DEFAULT_ARGS} )
+      if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+        install ( DIRECTORY ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO} )
+      else ()
+        install ( FILES ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO} )
+      endif ()
+    endforeach()
+  endif()
+endmacro ()
+
+# INSTALL_TEST ( files/directories )
+# This installs tests
+# USE: install_example ( examples/ exampleA.lua )
+macro ( install_test )
+  if ( NOT SKIP_INSTALL_DATA AND NOT SKIP_INSTALL_TEST )
+    parse_arguments ( _ARG "INTO" "" ${ARGN} )
+    foreach ( _file ${_ARG_DEFAULT_ARGS} )
+      if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+        install ( DIRECTORY ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO} )
+      else ()
+        install ( FILES ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO} )
+      endif ()
+    endforeach()
+  endif()
+endmacro ()
+
+# INSTALL_FOO ( files/directories )
+# This installs optional content
+# USE: install_foo ( examples/ exampleA.lua )
+macro ( install_foo )
+  if ( NOT SKIP_INSTALL_DATA AND NOT SKIP_INSTALL_FOO )
+    parse_arguments ( _ARG "INTO" "" ${ARGN} )
+    foreach ( _file ${_ARG_DEFAULT_ARGS} )
+      if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+        install ( DIRECTORY ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO} )
+      else ()
+        install ( FILES ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO} )
+      endif ()
+    endforeach()
+  endif()
+endmacro ()
+
+# INSTALL_LUA_MODULE
+# This macro installs a lua source module into destination given by lua require syntax.
+# Binary modules are also supported where this funcion takes sources and libraries to compile separated by LINK keyword
+# USE: install_lua_module ( socket.http src/http.lua )
+# USE2: install_lua_module ( mime.core src/mime.c )
+# USE3: install_lua_module ( socket.core ${SRC_SOCKET} LINK ${LIB_SOCKET} )
+macro (install_lua_module _name )
+  string ( REPLACE "." "/" _module "${_name}" )
+  string ( REPLACE "." "_" _target "${_name}" )
+
+  set ( _lua_module "${_module}.lua" )
+  set ( _bin_module "${_module}${CMAKE_SHARED_MODULE_SUFFIX}" )
+
+  parse_arguments ( _MODULE "LINK" "" ${ARGN} )
+  get_filename_component ( _ext ${ARGV1} EXT )
+  if ( _ext STREQUAL ".lua" )
+      get_filename_component ( _path ${_lua_module} PATH )
+      get_filename_component ( _filename ${_lua_module} NAME )
+      install ( FILES ${ARGV1} DESTINATION ${INSTALL_LMOD}/${_path} RENAME ${_filename} )
+  else ()
+     enable_language ( C )
+     get_filename_component ( _module_name ${_bin_module} NAME_WE )
+     get_filename_component ( _module_path ${_bin_module} PATH )
+
+     find_package ( Lua51 REQUIRED )
+     include_directories ( ${LUA_INCLUDE_DIR} )
+
+     add_library( ${_target} MODULE ${_MODULE_DEFAULT_ARGS})
+     target_link_libraries ( ${_target} ${LUA_LIBRARY} ${_MODULE_LINK} )
+     set_target_properties ( ${_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${_module_path}" PREFIX "" OUTPUT_NAME "${_module_name}" )
+
+     install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_path})
+  endif ()
+endmacro ()
+
+# ADD_LUA_TEST
 # Runs Lua script `_testfile` under CTest tester.
-# Optional argument `_testcurrentdir` is current working directory to run test under
+# Optional named argument `WORKING_DIRECTORY` is current working directory to run test under
 # (defaults to ${CMAKE_CURRENT_BINARY_DIR}).
 # Both paths, if relative, are relative to ${CMAKE_CURRENT_SOURCE_DIR}.
 # Under LuaDist, set test=true in config.lua to enable testing.
-macro(add_lua_test _testfile)
-	include(CTest)
-	if(BUILD_TESTING)
-		find_program(LUA NAMES lua lua.bat)
-		get_filename_component(TESTFILEABS ${_testfile} ABSOLUTE)
-		get_filename_component(TESTFILENAME ${_testfile} NAME)
-		get_filename_component(TESTFILEBASE ${_testfile} NAME_WE)
+# USE: add_lua_test ( test/test1.lua [args...] [WORKING_DIRECTORY dir])
+macro ( add_lua_test _testfile )
+	if ( NOT SKIP_TESTING )
+		parse_arguments ( _ARG "WORKING_DIRECTORY" "" ${ARGN} )
+		include ( CTest )
+		find_program ( LUA NAMES lua lua.bat )
+		get_filename_component ( TESTFILEABS ${_testfile} ABSOLUTE )
+		get_filename_component ( TESTFILENAME ${_testfile} NAME )
+		get_filename_component ( TESTFILEBASE ${_testfile} NAME_WE )

 		# Write wrapper script.
-		set(TESTWRAPPER ${CMAKE_CURRENT_BINARY_DIR}/${TESTFILENAME})
-		set(TESTWRAPPERSOURCE
-"package.path = '${CMAKE_CURRENT_BINARY_DIR}/?.lua\;${CMAKE_CURRENT_SOURCE_DIR}/?.lua\;' .. package.path
-package.cpath = '${CMAKE_CURRENT_BINARY_DIR}/?.so\;${CMAKE_CURRENT_BINARY_DIR}/?.dll\;' .. package.cpath
-return dofile '${TESTFILEABS}'
+		set ( TESTWRAPPER ${CMAKE_CURRENT_BINARY_DIR}/${TESTFILENAME} )
+		set ( TESTWRAPPERSOURCE
+"local configuration = ...
+local sodir = '${CMAKE_CURRENT_BINARY_DIR}' .. (configuration == '' and '' or '/' .. configuration)
+package.path  = sodir .. '/?.lua\;' .. sodir .. '/?.lua\;' .. package.path
+package.cpath = sodir .. '/?.so\;'  .. sodir .. '/?.dll\;' .. package.cpath
+arg[0] = '${TESTFILEABS}'
+table.remove(arg, 1)
+return assert(loadfile '${TESTFILEABS}')(unpack(arg))
 "		)
-		if(${ARGC} GREATER 1)
-			set(_testcurrentdir ${ARGV1})
-			get_filename_component(TESTCURRENTDIRABS ${_testcurrentdir} ABSOLUTE)
-			set(TESTWRAPPERSOURCE
-"require 'lfs'
-lfs.chdir('${TESTCURRENTDIRABS}')
-${TESTWRAPPERSOURCE}")
-		endif()
-		FILE(WRITE ${TESTWRAPPER} ${TESTWRAPPERSOURCE})
-
-		add_test(${TESTFILEBASE} ${LUA} ${TESTWRAPPER})
-	endif(BUILD_TESTING)
-
+		if ( _ARG_WORKING_DIRECTORY )
+			get_filename_component ( TESTCURRENTDIRABS ${_ARG_WORKING_DIRECTORY} ABSOLUTE )
+			# note: CMake 2.6 (unlike 2.8) lacks WORKING_DIRECTORY parameter.
+#old:		set ( TESTWRAPPERSOURCE "require 'lfs'; lfs.chdir('${TESTCURRENTDIRABS}' ) ${TESTWRAPPERSOURCE}" )
+			set ( _pre ${CMAKE_COMMAND} -E chdir "${TESTCURRENTDIRABS}" )
+		endif ()
+		file ( WRITE ${TESTWRAPPER} ${TESTWRAPPERSOURCE})
+		add_test ( NAME ${TESTFILEBASE} COMMAND ${_pre} ${LUA} ${TESTWRAPPER} $<CONFIGURATION> ${_ARG_DEFAULT_ARGS} )
+	endif ()
 	# see also http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/CMakeModules/UsePythonTest.cmake
-endmacro(add_lua_test)
+endmacro ()

 # Converts Lua source file `_source` to binary string embedded in C source
 # file `_target`.  Optionally compiles Lua source to byte code (not available
@@ -90,41 +410,41 @@
 #
 # [1] http://lua-users.org/wiki/BinToCee
 # [2] http://lua-users.org/wiki/LuaCompilerInLua
-function(add_lua_bin2c _target _source)
-	find_program(LUA NAMES lua lua.bat)
-	execute_process(COMMAND ${LUA} -e "string.dump(function()end)" RESULT_VARIABLE _LUA_DUMP_RESULT ERROR_QUIET)
-	if (NOT ${_LUA_DUMP_RESULT})
-		SET(HAVE_LUA_DUMP true)
-	endif()
-	message("-- string.dump=${HAVE_LUA_DUMP}")
-
-	if (ARGV2)
-		get_filename_component(BIN2C ${ARGV2} ABSOLUTE)
-		set(BIN2C ${LUA} ${BIN2C})
-	else()
-		find_program(BIN2C NAMES bin2c bin2c.bat)
-	endif()
-	if (HAVE_LUA_DUMP)
-		if (ARGV3)
-			get_filename_component(LUAC ${ARGV3} ABSOLUTE)
-			set(LUAC ${LUA} ${LUAC})
-		else()
-			find_program(LUAC NAMES luac luac.bat)
-		endif()
-	endif (HAVE_LUA_DUMP)
-	message("-- bin2c=${BIN2C}")
-	message("-- luac=${LUAC}")
-
-	get_filename_component(SOURCEABS ${_source} ABSOLUTE)
-	if (HAVE_LUA_DUMP)
-		get_filename_component(SOURCEBASE ${_source} NAME_WE)
-		add_custom_command(
+function ( add_lua_bin2c _target _source )
+	find_program ( LUA NAMES lua lua.bat )
+	execute_process ( COMMAND ${LUA} -e "string.dump(function()end)" RESULT_VARIABLE _LUA_DUMP_RESULT ERROR_QUIET )
+	if ( NOT ${_LUA_DUMP_RESULT} )
+		SET ( HAVE_LUA_DUMP true )
+	endif ()
+	message ( "-- string.dump=${HAVE_LUA_DUMP}" )
+
+	if ( ARGV2 )
+		get_filename_component ( BIN2C ${ARGV2} ABSOLUTE )
+		set ( BIN2C ${LUA} ${BIN2C} )
+	else ()
+		find_program ( BIN2C NAMES bin2c bin2c.bat )
+	endif ()
+	if ( HAVE_LUA_DUMP )
+		if ( ARGV3 )
+			get_filename_component ( LUAC ${ARGV3} ABSOLUTE )
+			set ( LUAC ${LUA} ${LUAC} )
+		else ()
+			find_program ( LUAC NAMES luac luac.bat )
+		endif ()
+	endif ( HAVE_LUA_DUMP )
+	message ( "-- bin2c=${BIN2C}" )
+	message ( "-- luac=${LUAC}" )
+
+	get_filename_component ( SOURCEABS ${_source} ABSOLUTE )
+	if ( HAVE_LUA_DUMP )
+		get_filename_component ( SOURCEBASE ${_source} NAME_WE )
+		add_custom_command (
 			OUTPUT  ${_target} DEPENDS ${_source}
 			COMMAND ${LUAC} -o ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo ${SOURCEABS}
 			COMMAND ${BIN2C} ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo ">${_target}" )
-	else()
-		add_custom_command(
+	else ()
+		add_custom_command (
 			OUTPUT  ${_target} DEPENDS ${SOURCEABS}
 			COMMAND ${BIN2C} ${_source} ">${_target}" )
-	endif()
-endfunction(add_lua_bin2c)
+	endif ()
+endfunction()


Always pass stack-protector flag to linker

Fixes issue with GCC 7.5 and OS X 10.4.

See: https://trac.macports.org/ticket/63469

Reviewed-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- CompilerChecks.cmake
+++ CompilerChecks.cmake
@@ -69,18 +69,14 @@
     check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG)
     if (WITH_STACK_PROTECTOR_STRONG)
         list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
-        # This is needed as Solaris has a seperate libssp
-        if (SOLARIS)
-            list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector-strong")
-        endif()
+        # This is needed as Solaris and others have a seperate libssp
+        list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector-strong")
     else (WITH_STACK_PROTECTOR_STRONG)
         check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
         if (WITH_STACK_PROTECTOR)
             list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
-            # This is needed as Solaris has a seperate libssp
-            if (SOLARIS)
-                list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector")
-            endif()
+            # This is needed as Solaris and others have a seperate libssp
+            list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector")
         endif()
     endif (WITH_STACK_PROTECTOR_STRONG)


Set Paraview rendering backend to OpenGL2

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -48,6 +48,7 @@
     -DPARAVIEW_CLIENT_RENDER_SERVER_TESTS:BOOL=FALSE
     -DPARAVIEW_COLLABORATION_TESTING:BOOL=FALSE
     -DVTK_BUILD_QT_DESIGNER_PLUGIN:BOOL=FALSE
+    -DVTK_RENDERING_BACKEND:STRING=OpenGL2

     -DPARAVIEW_BUILD_PLUGIN_PythonQtPlugin:BOOL=TRUE
     -DPYTHONQT_DIR:PATH=<INSTALL_DIR>


Show Stack setup.

Show Stack setup.

--- lib/FindStack.cmake
+++ lib/FindStack.cmake
@@ -4,7 +4,6 @@
 IF (STACK_EXECUTABLE)
     EXECUTE_PROCESS(
         COMMAND stack setup
-        OUTPUT_QUIET
     )
     SET(STACK_FOUND TRUE)
 ELSE (STACK_EXECUTABLE)


odb-sqlite: removed PACKAGE_DEPENDS_ON

odb-sqlite: removed PACKAGE_DEPENDS_ON

--- cmake/projects/odb-sqlite/hunter.cmake
+++ cmake/projects/odb-sqlite/hunter.cmake
@@ -26,5 +26,4 @@
 hunter_pick_scheme(DEFAULT url_sha1_odb-sqlite_autotools)
 hunter_download(
     PACKAGE_NAME odb-sqlite
-    PACKAGE_DEPENDS_ON odb SQLite3
 )


Bump version to 0.1.2

Bump version to 0.1.2

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(LeapIPC_VERSION 0.1.1)
+set(LeapIPC_VERSION 0.1.2)


Split off 7.8.84

Split off 7.8.84

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 83 )
+set ( HPCC_POINT 85 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Remove accidentally commited debug output

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31404 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/scripts/run_test.cmake
+++ deal.II/cmake/scripts/run_test.cmake
@@ -97,8 +97,7 @@
 MESSAGE("===============================   OUTPUT BEGIN  ===============================")

 IF("${_stage}" STREQUAL "PASSED")
-  #MESSAGE("${TEST}: PASSED.")
-  MESSAGE(${_output})
+  MESSAGE("${TEST}: PASSED.")

 ELSE()


Testsuite: Bugfix: Invert search order for failing stages in run_test.cmake

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31353 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/scripts/run_test.cmake
+++ deal.II/cmake/scripts/run_test.cmake
@@ -52,14 +52,14 @@
 STRING(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex ${_output})
 STRING(REGEX MATCH "${TEST}: PASSED\\." _passed_regex ${_output})

-IF(NOT "${_configure_regex}" STREQUAL "")
-  SET(_stage CONFIGURE)
+IF(NOT "${_passed_regex}" STREQUAL "")
+  SET(_stage PASSED)
 ELSEIF(NOT "${_run_regex}" STREQUAL "")
   SET(_stage RUN)
 ELSEIF(NOT "${_diff_regex}" STREQUAL "")
   SET(_stage DIFF)
-ELSEIF(NOT "${_passed_regex}" STREQUAL "")
-  SET(_stage PASSED)
+ELSEIF(NOT "${_configure_regex}" STREQUAL "")
+  SET(_stage CONFIGURE)
 ELSE() # unconditionally, because "BUILD failed." doesn't have to be printed...
   SET(_stage BUILD)
 ENDIF()


[Config][CMake] Migrated to new FindPython3 (from deprecated FindPythonLibs)

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -479,48 +479,36 @@
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
-    message (STATUS "Requires PythonLibs-${_required_version}")
+    message (STATUS "Requires Python with version ${_required_version}; however just Python3 is considered here")
   else (${ARGC} GREATER 0)
-    message (STATUS "Requires PythonLibs without specifying any version")
+    message (STATUS "Requires Python3; any version will do")
   endif (${ARGC} GREATER 0)

   # The first check searches for the libraries and include paths.
   # However, on some older versions (e.g., on RedHat/CentOS 5.x),
   # only the static library is searched.
-  find_package (PythonLibs ${_required_version} REQUIRED)
+  find_package (Python3 COMPONENTS Interpreter Development REQUIRED)

   # The second check is to get the dynamic library for sure.
-  find_package (PythonLibsWrapper ${_required_version} REQUIRED)
-
-  if (PYTHONLIBS_FOUND)
-	# Derive the version of Python (for whatever reason, FindPythonLibs
-	# does not seem to provide that version variable.
-	get_filename_component (PYTHONLIBS_LIB_FILENAME ${PYTHON_LIBRARIES} NAME)
-	string (REGEX REPLACE "^libpython([0-9]+.[0-9]+).*$" "\\1"
-	  PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
-
-	if (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-	  set (PY_MAJOR_VERSION "${CMAKE_MATCH_1}")
-	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
-	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
-	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
-	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")
-
-	# Set the Python installation directory
-	set (INSTALL_PY_LIB_DIR
-	  ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/py${PROJECT_NAME}
-	  CACHE PATH "Installation directory for Python libraries")
-
-	# Update the list of include directories for the project
-    include_directories (${PYTHON_INCLUDE_DIRS})
+  #find_package (PythonLibsWrapper ${_required_version} REQUIRED)
+
+  if (Python3_FOUND)
+    message (STATUS "Found Python3 ${Python3_VERSION} (${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH})")
+
+    # Set the Python installation directory
+    set (INSTALL_PY_LIB_DIR
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      CACHE PATH "Installation directory for Python libraries")
+
+    # Update the list of include directories for the project
+    include_directories (${Python3_INCLUDE_DIRS})

     # Update the list of dependencies for the project
-    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${PYTHON_LIBRARIES})
-
-  else (PYTHONLIBS_FOUND)
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Python3_LIBRARIES})
+
+  else (Python3_FOUND)
 	message (FATAL_ERROR "Python libraries are missing. Please install them (e.g., 'python-devel' for the Fedora/RedHat package)")
-  endif (PYTHONLIBS_FOUND)
+  endif (Python3_FOUND)

 endmacro (get_python)

@@ -618,8 +606,8 @@
   #         On some platform/Boost version combinations, the Python version
   #         may be just the major version (2 or 3 as of 2019) or the major
   #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
-  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
-  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
@@ -1473,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)
@@ -2555,27 +2543,26 @@

 # Python
 macro (display_python)
-  if (PYTHONLIBS_FOUND)
+  if (Python3_FOUND)
     message (STATUS)
-	message (STATUS "* Python:")
-	message (STATUS "  - PYTHONLIBS_VERSION ............ : ${PYTHONLIBS_VERSION}")
-	message (STATUS "  - PY_{MAJOR,MINOR,PATCH}_VERSION  : ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION}")
-	message (STATUS "  - PYTHON_LIBRARIES .............. : ${PYTHON_LIBRARIES}")
-	message (STATUS "  - PYTHON_INCLUDE_PATH ........... : ${PYTHON_INCLUDE_PATH}")
-	message (STATUS "  - PYTHON_INCLUDE_DIRS ........... : ${PYTHON_INCLUDE_DIRS}")
-	message (STATUS "  - PYTHON_DEBUG_LIBRARIES ........ : ${PYTHON_DEBUG_LIBRARIES}")
-	message (STATUS "  - Python_ADDITIONAL_VERSIONS .... : ${Python_ADDITIONAL_VERSIONS}")
-  endif (PYTHONLIBS_FOUND)
+    message (STATUS "* Python:")
+    message (STATUS "  - Python3_VERSION ............... : ${Python3_VERSION}")
+    message (STATUS "  - Python3_VERSION_{MJR,MNR,PTCH}  : ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH}")
+    message (STATUS "  - Python3_INCLUDE_DIRS .......... : ${Python3_INCLUDE_DIRS}")
+    message (STATUS "  - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
+    message (STATUS "  - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
+    message (STATUS "  - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
+  endif (Python3_FOUND)
 endmacro (display_python)

 # ICU
 macro (display_icu)
   if (ICU_FOUND)
     message (STATUS)
-	message (STATUS "* ICU:")
-	message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
-	message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
-	message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
+    message (STATUS "* ICU:")
+    message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
+    message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
+    message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
   endif (ICU_FOUND)
 endmacro (display_icu)


Added ZORBA_VERIFY_PEER_SSL_CERTIFICATE cmakedefine.

--- include/zorba/config.h.cmake
+++ include/zorba/config.h.cmake
@@ -66,6 +66,7 @@
 /* rest support */
 #cmakedefine ZORBA_WITH_REST
 #cmakedefine ZORBA_WITH_SSL
+#cmakedefine ZORBA_VERIFY_PEER_SSL_CERTIFICATE

 /* tidy support*/
 #cmakedefine ZORBA_WITH_TIDY