Tidy up FindOVR.cmake. Search proper subdir for headers.

--- cmake/FindOVR.cmake
+++ cmake/FindOVR.cmake
@@ -74,7 +74,7 @@
 # Lib/Windows/x64/Release/VS2012/LibOVR.lib
 # Lib/Windows/x64/Release/VS2013/LibOVR.lib
 #
-# Oculus 0.6.x
+# Oculus 0.6.x and above
 #
 # Lib/Windows/Win32/Release/VS2010/LibOVR.lib
 # Lib/Windows/Win32/Release/VS2012/LibOVR.lib
@@ -143,38 +143,48 @@
 endif()

 # Generate list of potential library locations
-list(APPEND _ovr_library_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Release/${_ovr_library_arch})
-list(APPEND _ovr_library_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Release)
-list(APPEND _ovr_library_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Release)
-list(APPEND _ovr_library_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Release/${_ovr_library_compiler})
-list(APPEND _ovr_library_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_library_arch}/Release/${_ovr_library_compiler})
-list(APPEND _ovr_library_debug_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Debug/${_ovr_library_arch})
-list(APPEND _ovr_library_debug_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Debug)
-list(APPEND _ovr_library_debug_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Debug)
-list(APPEND _ovr_library_debug_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Debug/${_ovr_library_compiler})
-list(APPEND _ovr_library_debug_paths ${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_library_arch}/Debug/${_ovr_library_compiler})
+list(APPEND _ovr_library_paths
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Release/${_ovr_library_arch}
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Release
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Release
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Release/${_ovr_library_compiler}
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_library_arch}/Release/${_ovr_library_compiler})
+
+list(APPEND _ovr_library_debug_paths
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Debug/${_ovr_library_arch}
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/Debug
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Debug
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_operating_system}/${_ovr_library_arch}/Debug/${_ovr_library_compiler}
+	${OVR_LIBRARY_PATH_SUFFIX}/${_ovr_library_arch}/Debug/${_ovr_library_compiler})

 # Generate list of potential library names
-list(APPEND _ovr_dynamic_library_names OVRRT${_ovr_libname_bitsuffix})
-list(APPEND _ovr_dynamic_library_names OVRRT${_ovr_libname_bitsuffix}_0)
-list(APPEND _ovr_dynamic_library_names libOVRRT${_ovr_libname_bitsuffix}.so.5)
-list(APPEND _ovr_dynamic_library_names libOVRRT${_ovr_libname_bitsuffix}_0.so.5)
-list(APPEND _ovr_static_library_names libovr.ax${_ovr_libname_bitsuffix})
-list(APPEND _ovr_static_library_names libovr.a)
-list(APPEND _ovr_static_library_names ovr)
-list(APPEND _ovr_static_library_names OVR)
-list(APPEND _ovr_static_library_names LibOVR)
-list(APPEND _ovr_static_library_names ovr${_ovr_libname_bitsuffix})
-list(APPEND _ovr_dynamic_library_debug_names OVRRT${_ovr_libname_bitsuffix})
-list(APPEND _ovr_dynamic_library_debug_names OVRRT${_ovr_libname_bitsuffix}_0)
-list(APPEND _ovr_dynamic_library_debug_names libOVRRT${_ovr_libname_bitsuffix}.so.5)
-list(APPEND _ovr_dynamic_library_debug_names libOVRRT${_ovr_libname_bitsuffix}_0.so.5)
-list(APPEND _ovr_static_library_debug_names libovr.a)
-list(APPEND _ovr_static_library_debug_names ovr)
-list(APPEND _ovr_static_library_debug_names OVR)
-list(APPEND _ovr_static_library_debug_names LibOVR)
-list(APPEND _ovr_static_library_debug_names ovr${_ovr_libname_bitsuffix}d)
-list(APPEND _ovr_static_library_debug_names OVR${_ovr_libname_bitsuffix}d)
+list(APPEND _ovr_dynamic_library_names
+	OVRRT${_ovr_libname_bitsuffix}
+	OVRRT${_ovr_libname_bitsuffix}_0
+	libOVRRT${_ovr_libname_bitsuffix}.so.5
+	libOVRRT${_ovr_libname_bitsuffix}_0.so.5)
+
+list(APPEND _ovr_static_library_names
+	libovr.ax${_ovr_libname_bitsuffix}
+	libovr.a
+	ovr
+	OVR
+	LibOVR
+	ovr${_ovr_libname_bitsuffix})
+
+list(APPEND _ovr_dynamic_library_debug_names
+	OVRRT${_ovr_libname_bitsuffix}
+	OVRRT${_ovr_libname_bitsuffix}_0
+	libOVRRT${_ovr_libname_bitsuffix}.so.5
+	libOVRRT${_ovr_libname_bitsuffix}_0.so.5)
+
+list(APPEND _ovr_static_library_debug_names
+	libovr.a
+	ovr
+	OVR
+	LibOVR
+	ovr${_ovr_libname_bitsuffix}d
+	OVR${_ovr_libname_bitsuffix}d)

 find_library(OVR_DYNAMIC_LIBRARY_RELEASE
 	NAMES
@@ -256,6 +266,7 @@
 	"${_libdir}/../../.."
 	PATHS
 	"${OVR_ROOT_DIR}"
+	"${OVR_ROOT_DIR}/LibOVR"
 	PATH_SUFFIXES
 	include
 	Include
@@ -274,6 +285,7 @@
 	"${_libdir}/../../.."
 	PATHS
 	"${OVR_ROOT_DIR}"
+	"${OVR_ROOT_DIR}/LibOVR"
 	PATH_SUFFIXES
 	Src
 	Include


Fix compiler flags for clang (-mfpmath not needed as it is automatic)

--- cmake/FindSSE.cmake
+++ cmake/FindSSE.cmake
@@ -243,7 +243,7 @@
 endif()

-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
   if(DETECTED_SSE_42)
      set(SSE_FLAGS "${SSE_FLAGS} -msse4.2 -mfpmath=sse")
   elseif(DETECTED_SSE_41)
@@ -258,6 +258,22 @@
      # Setting -ffloat-store to alleviate 32bit vs 64bit discrepancies on non-SSE platforms.
      set(SSE_FLAGS "-ffloat-store")
   endif()
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  # clang does not require "-mfpmath" which is automatic
+  if(DETECTED_SSE_42)
+     set(SSE_FLAGS "${SSE_FLAGS} -msse4.2")
+  elseif(DETECTED_SSE_41)
+     set(SSE_FLAGS "${SSE_FLAGS} -msse4.1")
+  elseif(DETECTED_SSE_30)
+     set(SSE_FLAGS "${SSE_FLAGS} -msse3")
+  elseif(DETECTED_SSE_20)
+     set(SSE_FLAGS "${SSE_FLAGS} -msse2")
+  elseif(DETECTED_SSE_10)
+     set(SSE_FLAGS "${SSE_FLAGS} -msse")
+  else()
+     # Setting -ffloat-store to alleviate 32bit vs 64bit discrepancies on non-SSE platforms.
+     set(SSE_FLAGS "-ffloat-store")
+  endif()
 elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
   set(SSE_FLAGS "-xHost")
 elseif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)


update cmake

update cmake

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -309,7 +309,7 @@
     if(WIN32)
     target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi openblas)
     else(WIN32)
-    target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog openblas)
+    target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
     endif(WIN32)
     add_dependencies(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
     add_test(NAME ${TARGET_NAME}


fix CI skip cc test error (#35264)

fix CI skip cc test error (#35264)

* fix CI skip cc test error, test=develop

* remove test code, test=develop

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -431,6 +431,8 @@
     if (APPLE)
         set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 20)
     endif()
+  elseif(WITH_TESTING AND NOT TEST ${TARGET_NAME})
+    add_test(NAME ${TARGET_NAME} COMMAND ${CMAKE_COMMAND} -E echo CI skip ${TARGET_NAME}.)
   endif()
 endfunction()

@@ -459,6 +461,8 @@
         COMMAND ${TARGET_NAME}
         ARGS ${cc_test_ARGS})
     endif()
+  elseif(WITH_TESTING AND NOT TEST ${TARGET_NAME})
+    add_test(NAME ${TARGET_NAME} COMMAND ${CMAKE_COMMAND} -E echo CI skip ${TARGET_NAME}.)
   endif()
 endfunction(cc_test)


Update lapacke.cmake with routines added in LAPACK 3.7.0.

--- cmake/lapacke.cmake
+++ cmake/lapacke.cmake
@@ -1,5 +1,5 @@

-set(C_SRC
+set(CSRC
   lapacke_cbbcsd.c
   lapacke_cbbcsd_work.c
   lapacke_cbdsqr.c
@@ -1839,6 +1839,12 @@
   lapacke_zhbevd_work.c
   lapacke_zhbevx.c
   lapacke_zhbevx_work.c
+  lapacke_zhbev_2stage.c
+  lapacke_zhbev_2stage_work.c
+  lapacke_zhbevd_2stage.c
+  lapacke_zhbevd_2stage_work.c
+  lapacke_zhbevx_2stage.c
+  lapacke_zhbevx_2stage_work.c
   lapacke_zhbgst.c
   lapacke_zhbgst_work.c
   lapacke_zhbgv.c
@@ -2263,104 +2269,91 @@
 )

 set(SRCX
-  lapacke_cgbrfsx.c       lapacke_cporfsx.c       lapacke_dgerfsx.c       lapacke_sgbrfsx.c       lapacke_ssyrfsx.c       lapacke_zherfsx.c
-  lapacke_cgbrfsx_work.c  lapacke_cporfsx_work.c  lapacke_dgerfsx_work.c  lapacke_sgbrfsx_work.c  lapacke_ssyrfsx_work.c  lapacke_zherfsx_work.c
-  lapacke_cgerfsx.c       lapacke_csyrfsx.c       lapacke_dporfsx.c       lapacke_sgerfsx.c       lapacke_zgbrfsx.c       lapacke_zporfsx.c
-  lapacke_cgerfsx_work.c  lapacke_csyrfsx_work.c  lapacke_dporfsx_work.c  lapacke_sgerfsx_work.c  lapacke_zgbrfsx_work.c  lapacke_zporfsx_work.c
-  lapacke_cherfsx.c       lapacke_dgbrfsx.c       lapacke_dsyrfsx.c       lapacke_sporfsx.c       lapacke_zgerfsx.c       lapacke_zsyrfsx.c
-  lapacke_cherfsx_work.c  lapacke_dgbrfsx_work.c  lapacke_dsyrfsx_work.c  lapacke_sporfsx_work.c  lapacke_zgerfsx_work.c  lapacke_zsyrfsx_work.c
-  lapacke_cgbsvxx.c       lapacke_cposvxx.c       lapacke_dgesvxx.c       lapacke_sgbsvxx.c       lapacke_ssysvxx.c       lapacke_zhesvxx.c
-  lapacke_cgbsvxx_work.c  lapacke_cposvxx_work.c  lapacke_dgesvxx_work.c  lapacke_sgbsvxx_work.c  lapacke_ssysvxx_work.c  lapacke_zhesvxx_work.c
-  lapacke_cgesvxx.c       lapacke_csysvxx.c       lapacke_dposvxx.c       lapacke_sgesvxx.c       lapacke_zgbsvxx.c       lapacke_zposvxx.c
-  lapacke_cgesvxx_work.c  lapacke_csysvxx_work.c  lapacke_dposvxx_work.c  lapacke_sgesvxx_work.c  lapacke_zgbsvxx_work.c  lapacke_zposvxx_work.c
-  lapacke_chesvxx.c       lapacke_dgbsvxx.c       lapacke_dsysvxx.c       lapacke_sposvxx.c       lapacke_zgesvxx.c       lapacke_zsysvxx.c
+  lapacke_cgbrfsx.c       lapacke_cporfsx.c       lapacke_dgerfsx.c       lapacke_sgbrfsx.c       lapacke_ssyrfsx.c       lapacke_zherfsx.c
+  lapacke_cgbrfsx_work.c  lapacke_cporfsx_work.c  lapacke_dgerfsx_work.c  lapacke_sgbrfsx_work.c  lapacke_ssyrfsx_work.c  lapacke_zherfsx_work.c
+  lapacke_cgerfsx.c       lapacke_csyrfsx.c       lapacke_dporfsx.c       lapacke_sgerfsx.c       lapacke_zgbrfsx.c       lapacke_zporfsx.c
+  lapacke_cgerfsx_work.c  lapacke_csyrfsx_work.c  lapacke_dporfsx_work.c  lapacke_sgerfsx_work.c  lapacke_zgbrfsx_work.c  lapacke_zporfsx_work.c
+  lapacke_cherfsx.c       lapacke_dgbrfsx.c       lapacke_dsyrfsx.c       lapacke_sporfsx.c       lapacke_zgerfsx.c       lapacke_zsyrfsx.c
+  lapacke_cherfsx_work.c  lapacke_dgbrfsx_work.c  lapacke_dsyrfsx_work.c  lapacke_sporfsx_work.c  lapacke_zgerfsx_work.c  lapacke_zsyrfsx_work.c
+  lapacke_cgbsvxx.c       lapacke_cposvxx.c       lapacke_dgesvxx.c       lapacke_sgbsvxx.c       lapacke_ssysvxx.c       lapacke_zhesvxx.c
+  lapacke_cgbsvxx_work.c  lapacke_cposvxx_work.c  lapacke_dgesvxx_work.c  lapacke_sgbsvxx_work.c  lapacke_ssysvxx_work.c  lapacke_zhesvxx_work.c
+  lapacke_cgesvxx.c       lapacke_csysvxx.c       lapacke_dposvxx.c       lapacke_sgesvxx.c       lapacke_zgbsvxx.c       lapacke_zposvxx.c
+  lapacke_cgesvxx_work.c  lapacke_csysvxx_work.c  lapacke_dposvxx_work.c  lapacke_sgesvxx_work.c  lapacke_zgbsvxx_work.c  lapacke_zposvxx_work.c
+  lapacke_chesvxx.c       lapacke_dgbsvxx.c       lapacke_dsysvxx.c       lapacke_sposvxx.c       lapacke_zgesvxx.c       lapacke_zsysvxx.c
   lapacke_chesvxx_work.c  lapacke_dgbsvxx_work.c  lapacke_dsysvxx_work.c  lapacke_sposvxx_work.c  lapacke_zgesvxx_work.c  lapacke_zsysvxx_work.c
 )

-# FILE PARTS OF TMGLIB
+# FILE PARTS OF TMGLIB
 set(MATGEN
-  lapacke_clatms.c
-  lapacke_clatms_work.c
-  lapacke_dlatms.c
-  lapacke_dlatms_work.c
-  lapacke_slatms.c
-  lapacke_slatms_work.c
-  lapacke_zlatms.c
-  lapacke_zlatms_work.c
-  lapacke_clagge.c
-  lapacke_clagge_work.c
-  lapacke_dlagge.c
-  lapacke_dlagge_work.c
-  lapacke_slagge.c
-  lapacke_slagge_work.c
-  lapacke_zlagge.c
-  lapacke_zlagge_work.c
-  lapacke_claghe.c
-  lapacke_claghe_work.c
-  lapacke_zlaghe.c
-  lapacke_zlaghe_work.c
-  lapacke_clagsy.c
-  lapacke_clagsy_work.c
-  lapacke_dlagsy.c
-  lapacke_dlagsy_work.c
-  lapacke_slagsy.c
-  lapacke_slagsy_work.c
-  lapacke_zlagsy.c
+  lapacke_clatms.c
+  lapacke_clatms_work.c
+  lapacke_dlatms.c
+  lapacke_dlatms_work.c
+  lapacke_slatms.c
+  lapacke_slatms_work.c
+  lapacke_zlatms.c
+  lapacke_zlatms_work.c
+  lapacke_clagge.c
+  lapacke_clagge_work.c
+  lapacke_dlagge.c
+  lapacke_dlagge_work.c
+  lapacke_slagge.c
+  lapacke_slagge_work.c
+  lapacke_zlagge.c
+  lapacke_zlagge_work.c
+  lapacke_claghe.c
+  lapacke_claghe_work.c
+  lapacke_zlaghe.c
+  lapacke_zlaghe_work.c
+  lapacke_clagsy.c
+  lapacke_clagsy_work.c
+  lapacke_dlagsy.c
+  lapacke_dlagsy_work.c
+  lapacke_slagsy.c
+  lapacke_slagsy_work.c
+  lapacke_zlagsy.c
   lapacke_zlagsy_work.c
 )

 set(Utils_SRC
-lapacke_cgb_nancheck.c  lapacke_dpf_nancheck.c         lapacke_ssy_trans.c
-lapacke_cgb_trans.c     lapacke_dpf_trans.c            lapacke_stb_nancheck.c
-lapacke_cge_nancheck.c  lapacke_dpo_nancheck.c         lapacke_stb_trans.c
-lapacke_cge_trans.c     lapacke_dpo_trans.c            lapacke_stf_nancheck.c
-lapacke_cgg_nancheck.c  lapacke_dpp_nancheck.c         lapacke_stf_trans.c
-lapacke_cgg_trans.c     lapacke_dpp_trans.c            lapacke_stp_nancheck.c
-lapacke_cgt_nancheck.c  lapacke_dpt_nancheck.c         lapacke_stp_trans.c
-lapacke_chb_nancheck.c  lapacke_dsb_nancheck.c         lapacke_str_nancheck.c
-lapacke_chb_trans.c     lapacke_dsb_trans.c            lapacke_str_trans.c
-lapacke_che_nancheck.c  lapacke_dsp_nancheck.c         lapacke_xerbla.c
-lapacke_che_trans.c     lapacke_dsp_trans.c            lapacke_zgb_nancheck.c
-lapacke_chp_nancheck.c  lapacke_dst_nancheck.c         lapacke_zgb_trans.c
-lapacke_chp_trans.c     lapacke_dsy_nancheck.c         lapacke_zge_nancheck.c
-lapacke_chs_nancheck.c  lapacke_dsy_trans.c            lapacke_zge_trans.c
-lapacke_chs_trans.c     lapacke_dtb_nancheck.c         lapacke_zgg_nancheck.c
-lapacke_c_nancheck.c    lapacke_dtb_trans.c            lapacke_zgg_trans.c
-lapacke_cpb_nancheck.c  lapacke_dtf_nancheck.c         lapacke_zgt_nancheck.c
-lapacke_cpb_trans.c     lapacke_dtf_trans.c            lapacke_zhb_nancheck.c
-lapacke_cpf_nancheck.c  lapacke_dtp_nancheck.c         lapacke_zhb_trans.c
-lapacke_cpf_trans.c     lapacke_dtp_trans.c            lapacke_zhe_nancheck.c
-lapacke_cpo_nancheck.c  lapacke_dtr_nancheck.c         lapacke_zhe_trans.c
-lapacke_cpo_trans.c     lapacke_dtr_trans.c            lapacke_zhp_nancheck.c
-lapacke_cpp_nancheck.c  lapacke_lsame.c                lapacke_zhp_trans.c
-lapacke_cpp_trans.c     lapacke_make_complex_double.c  lapacke_zhs_nancheck.c
-lapacke_cpt_nancheck.c  lapacke_make_complex_float.c   lapacke_zhs_trans.c
-lapacke_csp_nancheck.c  lapacke_sgb_nancheck.c         lapacke_z_nancheck.c
-lapacke_csp_trans.c     lapacke_sgb_trans.c            lapacke_zpb_nancheck.c
-lapacke_cst_nancheck.c  lapacke_sge_nancheck.c         lapacke_zpb_trans.c
-lapacke_csy_nancheck.c  lapacke_sge_trans.c            lapacke_zpf_nancheck.c
-lapacke_csy_trans.c     lapacke_sgg_nancheck.c         lapacke_zpf_trans.c
-lapacke_ctb_nancheck.c  lapacke_sgg_trans.c            lapacke_zpo_nancheck.c
-lapacke_ctb_trans.c     lapacke_sgt_nancheck.c         lapacke_zpo_trans.c
-lapacke_ctf_nancheck.c  lapacke_shs_nancheck.c         lapacke_zpp_nancheck.c
-lapacke_ctf_trans.c     lapacke_shs_trans.c            lapacke_zpp_trans.c
-lapacke_ctp_nancheck.c  lapacke_s_nancheck.c           lapacke_zpt_nancheck.c
-lapacke_ctp_trans.c     lapacke_spb_nancheck.c         lapacke_zsp_nancheck.c
-lapacke_ctr_nancheck.c  lapacke_spb_trans.c            lapacke_zsp_trans.c
-lapacke_ctr_trans.c     lapacke_spf_nancheck.c         lapacke_zst_nancheck.c
-lapacke_dgb_nancheck.c  lapacke_spf_trans.c            lapacke_zsy_nancheck.c
-lapacke_dgb_trans.c     lapacke_spo_nancheck.c         lapacke_zsy_trans.c
-lapacke_dge_nancheck.c  lapacke_spo_trans.c            lapacke_ztb_nancheck.c
-lapacke_dge_trans.c     lapacke_spp_nancheck.c         lapacke_ztb_trans.c
-lapacke_dgg_nancheck.c  lapacke_spp_trans.c            lapacke_ztf_nancheck.c
-lapacke_dgg_trans.c     lapacke_spt_nancheck.c         lapacke_ztf_trans.c
-lapacke_dgt_nancheck.c  lapacke_ssb_nancheck.c         lapacke_ztp_nancheck.c
-lapacke_dhs_nancheck.c  lapacke_ssb_trans.c            lapacke_ztp_trans.c
-lapacke_dhs_trans.c     lapacke_ssp_nancheck.c         lapacke_ztr_nancheck.c
-lapacke_d_nancheck.c    lapacke_ssp_trans.c            lapacke_ztr_trans.c
-lapacke_dpb_nancheck.c  lapacke_sst_nancheck.c
-lapacke_dpb_trans.c     lapacke_ssy_nancheck.c
+  lapacke_c_nancheck.c            lapacke_ctr_trans.c             lapacke_make_complex_float.c    lapacke_zgb_nancheck.c
+  lapacke_cgb_nancheck.c          lapacke_d_nancheck.c            lapacke_s_nancheck.c            lapacke_zgb_trans.c
+  lapacke_cgb_trans.c             lapacke_dgb_nancheck.c          lapacke_sgb_nancheck.c          lapacke_zge_nancheck.c
+  lapacke_cge_nancheck.c          lapacke_dgb_trans.c             lapacke_sgb_trans.c             lapacke_zge_trans.c
+  lapacke_cge_trans.c             lapacke_dge_nancheck.c          lapacke_sge_nancheck.c          lapacke_zgg_nancheck.c
+  lapacke_cgg_nancheck.c          lapacke_dge_trans.c             lapacke_sge_trans.c             lapacke_zgg_trans.c
+  lapacke_cgg_trans.c             lapacke_dgg_nancheck.c          lapacke_sgg_nancheck.c          lapacke_zgt_nancheck.c
+  lapacke_cgt_nancheck.c          lapacke_dgg_trans.c             lapacke_sgg_trans.c             lapacke_zhb_nancheck.c
+  lapacke_chb_nancheck.c          lapacke_dgt_nancheck.c          lapacke_sgt_nancheck.c          lapacke_zhb_trans.c
+  lapacke_chb_trans.c             lapacke_dhs_nancheck.c          lapacke_shs_nancheck.c          lapacke_zhe_nancheck.c
+  lapacke_che_nancheck.c          lapacke_dhs_trans.c             lapacke_shs_trans.c             lapacke_zhe_trans.c
+  lapacke_che_trans.c             lapacke_dpb_nancheck.c          lapacke_spb_nancheck.c          lapacke_zhp_nancheck.c
+  lapacke_chp_nancheck.c          lapacke_dpb_trans.c             lapacke_spb_trans.c             lapacke_zhp_trans.c
+  lapacke_chp_trans.c             lapacke_dpf_nancheck.c          lapacke_spf_nancheck.c          lapacke_zhs_nancheck.c
+  lapacke_chs_nancheck.c          lapacke_dpf_trans.c             lapacke_spf_trans.c             lapacke_zhs_trans.c
+  lapacke_chs_trans.c             lapacke_dpo_nancheck.c          lapacke_spo_nancheck.c          lapacke_zpb_nancheck.c
+  lapacke_cpb_nancheck.c          lapacke_dpo_trans.c             lapacke_spo_trans.c             lapacke_zpb_trans.c
+  lapacke_cpb_trans.c             lapacke_dpp_nancheck.c          lapacke_spp_nancheck.c          lapacke_zpf_nancheck.c
+  lapacke_cpf_nancheck.c          lapacke_dpp_trans.c             lapacke_spp_trans.c             lapacke_zpf_trans.c
+  lapacke_cpf_trans.c             lapacke_dpt_nancheck.c          lapacke_spt_nancheck.c          lapacke_zpo_nancheck.c
+  lapacke_cpo_nancheck.c          lapacke_dsb_nancheck.c          lapacke_ssb_nancheck.c          lapacke_zpo_trans.c
+  lapacke_cpo_trans.c             lapacke_dsb_trans.c             lapacke_ssb_trans.c             lapacke_zpp_nancheck.c
+  lapacke_cpp_nancheck.c          lapacke_dsp_nancheck.c          lapacke_ssp_nancheck.c          lapacke_zpp_trans.c
+  lapacke_cpp_trans.c             lapacke_dsp_trans.c             lapacke_ssp_trans.c             lapacke_zpt_nancheck.c
+  lapacke_cpt_nancheck.c          lapacke_dst_nancheck.c          lapacke_sst_nancheck.c          lapacke_zsp_nancheck.c
+  lapacke_csp_nancheck.c          lapacke_dsy_nancheck.c          lapacke_ssy_nancheck.c          lapacke_zsp_trans.c
+  lapacke_csp_trans.c             lapacke_dsy_trans.c             lapacke_ssy_trans.c             lapacke_zst_nancheck.c
+  lapacke_cst_nancheck.c          lapacke_dtb_nancheck.c          lapacke_stb_nancheck.c          lapacke_zsy_nancheck.c
+  lapacke_csy_nancheck.c          lapacke_dtb_trans.c             lapacke_stb_trans.c             lapacke_zsy_trans.c
+  lapacke_csy_trans.c             lapacke_dtf_nancheck.c          lapacke_stf_nancheck.c          lapacke_ztb_nancheck.c
+  lapacke_ctb_nancheck.c          lapacke_dtf_trans.c             lapacke_stf_trans.c             lapacke_ztb_trans.c
+  lapacke_ctb_trans.c             lapacke_dtp_nancheck.c          lapacke_stp_nancheck.c          lapacke_ztf_nancheck.c
+  lapacke_ctf_nancheck.c          lapacke_dtp_trans.c             lapacke_stp_trans.c             lapacke_ztf_trans.c
+  lapacke_ctf_trans.c             lapacke_dtr_nancheck.c          lapacke_str_nancheck.c          lapacke_ztp_nancheck.c
+  lapacke_ctp_nancheck.c          lapacke_dtr_trans.c             lapacke_str_trans.c             lapacke_ztp_trans.c
+  lapacke_ctp_trans.c             lapacke_lsame.c                 lapacke_xerbla.c                lapacke_ztr_nancheck.c
+  lapacke_ctr_nancheck.c          lapacke_make_complex_double.c   lapacke_z_nancheck.c            lapacke_ztr_trans.c
 )

 set(LAPACKE_REL_SRC "")
@@ -2380,6 +2373,10 @@
   list(APPEND LAPACKE_REL_SRC ${ZSRC})
 endif ()

+if (BUILD_MATGEN)
+  list(APPEND LAPACKE_REL_SRC ${MATGEN})
+endif ()
+
 # add lapack-netlib folder to the sources
 set(LAPACKE_SOURCES "")
 foreach (LAE_FILE ${LAPACKE_REL_SRC})


CMake prior v3.7 does not support %a %b for TIMESTAMP

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -184,7 +184,11 @@
     SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")

     SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
-    STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
+    IF (CMAKE_VERSION VERSION_LESS "3.7.0")
+      EXECUTE_PROCESS(COMMAND date "+%a %b %d %Y" OUTPUT_VARIABLE CHANGELOG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+    ELSE()
+      STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
+    ENDIF()
     SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${OSPRAY_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
     FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})


Make versions according to semver.

Make versions according to semver.

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -5,16 +5,15 @@
   MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )

   EXECUTE_PROCESS(
-  	COMMAND cat ${PROJECT_SOURCE_DIR}/${VERSION_FILE}
-  	COMMAND sed -n s/[[:space:]]*\#define[[:space:]]\\+CJET_PATCH[[:space:]]\\+\"\\\([[:digit:]]\\+\\\)\"/\\1/p
+  	COMMAND git describe --exact-match --tags HEAD
   	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-  	OUTPUT_VARIABLE VERSION_PATCH
+	RESULT_VARIABLE IS_TAG
   	OUTPUT_STRIP_TRAILING_WHITESPACE
+  	ERROR_QUIET
   )
-
-  MATH(EXPR OFFICIAL "${VERSION_PATCH} % 2")
-  IF(OFFICIAL EQUAL 0)
-  	SET(${PROJECTNAME}_VERSION_TWEAK 0)
+
+  IF(IS_TAG EQUAL 0)
+  	SET(${PROJECTNAME}_VERSION_TWEAK "")
   ELSE()
   	EXECUTE_PROCESS(
   	  COMMAND git rev-list HEAD --count
@@ -24,9 +23,9 @@
   	  ERROR_QUIET
   	)
   	IF(GIT_REV_COUNT STREQUAL "")
-  		SET(${PROJECTNAME}_VERSION_TWEAK "unknown")
+  		SET(${PROJECTNAME}_VERSION_TWEAK "-unknown")
   	ELSE()
-  		SET(${PROJECTNAME}_VERSION_TWEAK ${GIT_REV_COUNT})
+  		SET(${PROJECTNAME}_VERSION_TWEAK "-${GIT_REV_COUNT}")
   	ENDIF()
   ENDIF()

@@ -42,7 +41,11 @@
   IF(GIT_DIRTY STREQUAL "")
   	SET(${PROJECTNAME}_VERSION_DIRTY "")
   ELSE()
-  	SET(${PROJECTNAME}_VERSION_DIRTY ".dirty")
+  	SET(${PROJECTNAME}_VERSION_DIRTY "+dirty")
+  ENDIF()
+
+  IF((NOT (GIT_DIRTY STREQUAL "")) AND (IS_TAG EQUAL 0))
+    MESSAGE( FATAL_ERROR "Never build a release from dirty tag!" )
   ENDIF()

   SET(CJET_LAST ${${PROJECTNAME}_VERSION_TWEAK}${${PROJECTNAME}_VERSION_DIRTY} PARENT_SCOPE)


[build] don't embed bitcode for target libs built for simulators (#32871)

At the same time rework condition so that it is more amenable to code
searches.

Addresses rdar://65501878

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -1251,7 +1251,9 @@
     endif()
     # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
     if(SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_SINGLE_DONT_EMBED_BITCODE)
-      if(${SWIFTLIB_SINGLE_SDK} MATCHES "(I|TV|WATCH)OS")
+      if(${SWIFTLIB_SINGLE_SDK} STREQUAL "IOS" OR
+         ${SWIFTLIB_SINGLE_SDK} STREQUAL "TVOS" OR
+         ${SWIFTLIB_SINGLE_SDK} STREQUAL "WATCHOS")
         # Please note that using a generator expression to fit
         # this in a single target_link_options does not work
         # (at least in CMake 3.15 and 3.16),


CMake: improved parsing of fastjet-config params

Fixes ALPHY-20

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

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

 set(FASTJET_FOUND FALSE)

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

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

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

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

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

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

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

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

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

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


cmake: fix bug with installation into OPENCV_LIB_INSTALL_PATH directory

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -467,9 +467,10 @@

       set(isArchive 0)
       set(isDst 0)
+      unset(__dst)
       foreach(e ${ARGN})
         if(isDst EQUAL 1)
-          set(DST "${e}")
+          set(__dst "${e}")
           break()
         endif()
         if(isArchive EQUAL 1 AND e STREQUAL "DESTINATION")
@@ -482,18 +483,20 @@
         endif()
       endforeach()

-#      message(STATUS "Process ${__target} dst=${DST}...")
-      if(NOT DEFINED DST)
-        set(DST "OPENCV_LIB_INSTALL_PATH")
-      endif()
-
-      get_target_property(fname ${__target} LOCATION_DEBUG)
-      string(REPLACE ".lib" ".pdb" fname "${fname}")
-      install(FILES ${fname} DESTINATION ${DST} CONFIGURATIONS Debug)
-
-      get_target_property(fname ${__target} LOCATION_RELEASE)
-      string(REPLACE ".lib" ".pdb" fname "${fname}")
-      install(FILES ${fname} DESTINATION ${DST} CONFIGURATIONS Release)
+#      message(STATUS "Process ${__target} dst=${__dst}...")
+      if(DEFINED __dst)
+        get_target_property(fname ${__target} LOCATION_DEBUG)
+        if(fname MATCHES "\\.lib$")
+          string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
+          install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
+        endif()
+
+        get_target_property(fname ${__target} LOCATION_RELEASE)
+        if(fname MATCHES "\\.lib$")
+          string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
+          install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
+        endif()
+      endif()
     endif()
   endif()
 endfunction()


Update cmake preview.

Update cmake preview.

--- cmake/TbagPreview.cmake
+++ cmake/TbagPreview.cmake
@@ -52,11 +52,6 @@
     message (WARNING "Not implement.")
 endfunction ()

-#/// Print your compiler.
-function (tbag_preview__print_compiler_id)
-    tbag_preview__print ("Compiler id: ${CMAKE_CXX_COMPILER_ID}")
-endfunction ()
-
 #/// Preview information.
 function (tbag_preview)
     message ("")
@@ -64,22 +59,86 @@
     tbag_preview__print ("")

     tbag_preview__print_os ()
-    tbag_preview__print_compiler_id ()
+    tbag_preview__print ("")
+
+    tbag_preview__print_variable (CMAKE_HOST_SYSTEM_NAME)
+    tbag_preview__print_variable (CMAKE_HOST_SYSTEM_VERSION)
+    tbag_preview__print_variable (CMAKE_HOST_SYSTEM_PROCESSOR)
+    tbag_preview__print ("")
+
+    if (CMAKE_CROSSCOMPILING)
+        tbag_preview__print_variable (CMAKE_SYSTEM_NAME)
+        tbag_preview__print_variable (CMAKE_SYSTEM_VERSION)
+        tbag_preview__print_variable (CMAKE_SYSTEM_PROCESSOR)
+        tbag_preview__print ("")
+    endif ()
+
+    tbag_preview__print_variable (CMAKE_VERSION)
+    tbag_preview__print_variable (CMAKE_GENERATOR)
+    tbag_preview__print_variable (CMAKE_BUILD_TOOL)
+    tbag_preview__print ("")
+
+    tbag_preview__print_variable (CMAKE_CXX_COMPILER_ID)
+    tbag_preview__print_variable (CMAKE_C_COMPILER)
+    tbag_preview__print_variable (CMAKE_CXX_COMPILER)
     tbag_preview__print ("")

     tbag_preview__print_variable (CMAKE_BUILD_TYPE)
     tbag_preview__print_variable (BUILD_SHARED_LIBS)
     tbag_preview__print ("")

-    tbag_preview__print_variable (CMAKE_CXX_FLAGS)
-    tbag_preview__print_variable (CMAKE_EXE_LINKER_FLAGS)
-    tbag_preview__print_variable (CMAKE_MODULE_LINKER_FLAGS)
-    tbag_preview__print_variable (CMAKE_SHARED_LINKER_FLAGS)
-    tbag_preview__print ("")
-
     tbag_preview__print_variable (PROJECT_SOURCE_DIR)
     tbag_preview__print_variable (PROJECT_BINARY_DIR)
     tbag_preview__print_variable (CMAKE_INSTALL_PREFIX)
-    message ("")
+    tbag_preview__print ("")
+
+    tbag_preview__print_variable (MAIN_NAME)
+    tbag_preview__print_variable (MAIN_AUTHOR)
+    tbag_preview__print_variable (MAIN_EMAIL)
+    tbag_preview__print_variable (MAIN_BRIEF)
+    tbag_preview__print_variable (VERSION)
+    tbag_preview__print_variable (VERSION_TWEAK)
+    tbag_preview__print ("PACKET VERSION: ${VERSION_PACKET_MAJOR}.${VERSION_PACKET_MINOR}")
+    tbag_preview__print ("RELEASE VERSION: ${VERSION_RELEASE}")
+    tbag_preview__print ("")
+
+    #tbag_preview__print_variable (CMAKE_C_FLAGS)
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_DEBUG)
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_RELEASE)
+    tbag_preview__print_variable (CMAKE_CXX_FLAGS)
+    tbag_preview__print_variable (CMAKE_CXX_FLAGS_DEBUG)
+    tbag_preview__print_variable (CMAKE_CXX_FLAGS_RELEASE)
+    tbag_preview__print ("")
+
+    #tbag_preview__print_variable (CMAKE_EXE_LINKER_FLAGS)
+    #tbag_preview__print_variable (CMAKE_EXE_LINKER_FLAGS_DEBUG)
+    #tbag_preview__print_variable (CMAKE_EXE_LINKER_FLAGS_RELEASE)
+
+    #tbag_preview__print_variable (CMAKE_MODULE_LINKER_FLAGS)
+    #tbag_preview__print_variable (CMAKE_MODULE_LINKER_FLAGS_DEBUG)
+    #tbag_preview__print_variable (CMAKE_MODULE_LINKER_FLAGS_RELEASE)
+
+    #tbag_preview__print_variable (CMAKE_SHARED_LINKER_FLAGS)
+    #tbag_preview__print_variable (CMAKE_SHARED_LINKER_FLAGS_DEBUG)
+    #tbag_preview__print_variable (CMAKE_SHARED_LINKER_FLAGS_RELEASE)
+
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_DEBUG_INIT)
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_MINSIZEREL_INIT)
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_RELEASE_INIT)
+    #tbag_preview__print_variable (CMAKE_C_FLAGS_RELWITHDEBINFO_INITT)
+
+    #tbag_preview__print_variable (CMAKE_CXX_FLAGS_DEBUG_INIT)
+    #tbag_preview__print_variable (CMAKE_CXX_FLAGS_MINSIZEREL_INIT)
+    #tbag_preview__print_variable (CMAKE_CXX_FLAGS_RELEASE_INIT)
+    #tbag_preview__print_variable (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INITT)
+
+    if (TBAG_DEBUG_TAG)
+        tbag_preview__print ("ENABLE TBAG_DEBUG_TAG: ${TBAG_DEBUG_TAG}")
+    else ()
+        tbag_preview__print ("DISABLE TBAG_DEBUG_TAG")
+    endif ()
+
+    tbag_preview__print ("")
+    tbag_preview__print ("#################################################")
 endfunction ()


Remove comments from windeployqt.

Remove comments from windeployqt.

--- cmake/Windeployqt.cmake
+++ cmake/Windeployqt.cmake
@@ -28,6 +28,12 @@
 get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
 find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")

+# Running this with MSVC 2015 requires CMake 3.6+
+if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900)
+        AND CMAKE_VERSION VERSION_LESS "3.6")
+    message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+")
+endif()
+
 # Add commands that copy the Qt runtime to the target's output directory after
 # build and install the Qt runtime to the specified directory
 function(windeployqt target directory)
@@ -41,7 +47,6 @@
                 --no-angle
                 --no-opengl-sw
                 \"$<TARGET_FILE:${target}>\"
-        COMMENT "Deploying Qt..."
     )

     # install(CODE ...) doesn't support generator expressions, but
@@ -83,15 +88,6 @@

     # windeployqt doesn't work correctly with the system runtime libraries,
     # so we fall back to one of CMake's own modules for copying them over
-
-    # Doing this with MSVC 2015 requires CMake 3.6+
-    if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900)
-            AND CMAKE_VERSION VERSION_LESS "3.6")
-        message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+")
-    endif()
-
-    # Install the runtime libraries and copy them to the output directory
-    # after build
     set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
     include(InstallRequiredSystemLibraries)
     foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
@@ -99,7 +95,6 @@
         add_custom_command(TARGET ${target} POST_BUILD
             COMMAND "${CMAKE_COMMAND}" -E
                 copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\"
-            COMMENT "Copying ${filename}..."
         )
     endforeach()


CMake: add quotes around forced includes

When working in a directory that contains spaces, the CMake build breaks
because of -include (or /FI) flags whose argument was unquoted. This fix
adds the proper quoting.

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -23,12 +23,12 @@

 if (MEMORY_LEAK_DETECTION)
     if (MSVC)
-        set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} /FI ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h")
-        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} /FI ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h")
+        set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} /FI \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
+        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} /FI \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
     else (MSVC)
-        set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} -include ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h")
-        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorNewMacros.h")
-        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h")
+        set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
+        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorNewMacros.h\"")
+        set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
     endif (MSVC)
 else (MEMORY_LEAK_DETECTION)
     set(CPPUTEST_MEM_LEAK_DETECTION_DISABLED 1)


linux: prevent cmake from picking up a libqhy.so installed on the system - fixes #597

--- thirdparty/thirdparty.cmake
+++ thirdparty/thirdparty.cmake
@@ -935,8 +935,10 @@
   endif()
   set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2})

+  # be careful not to pick up any other qhy lib on the system
   find_library( qhylib
                 NAMES qhy
+                NO_DEFAULT_PATH
                 PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccdlibs/linux/${qhyarch})
   if(NOT qhylib)
     message(FATAL_ERROR "Cannot find the qhy SDK libs")


Fixed ordering on dependency for legacy target rospack_genmsg_libexe.  This change avoids spurious failures in packages that do configuration generation using dynamic_reconfigure.

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -300,7 +300,7 @@
   # The rospack_genmsg_libexe target is defined for backward compatibility,
   # and will eventually be removed.
   add_custom_target(rospack_genmsg_libexe)
-  add_dependencies(rospack_genmsg_libexe rosbuild_precompile)
+  add_dependencies(rosbuild_precompile rospack_genmsg_libexe)

   # ${gendeps_exe} is a convenience variable that roslang cmake rules
   # must reference as a dependency of msg/srv generation


Fixed tegra build.

Fixed tegra build.

We were incorrectly detecting TEGRA on or off.

Change-Id: I5609f1db3eeb02daf35783795b85943dc45a9389
Reviewed-on: https://wn-project.dnsalias.net/gerrit/74
Try: Andrew Woloszyn <2926f0436f8103ab8257713335cf26447d8bf68a@google.com>
Reviewed-by: Devon Powell <bef84a74f4a3947934cc58306a6aae518eaf1936@gmail.com>
Tested-by: WNBot <efa0942020584fb66fb8bea377b59e48fa0f85ef@gmail.com>

--- Utilities/helpers.cmake
+++ Utilities/helpers.cmake
@@ -30,7 +30,7 @@
   if (CMAKE_SYSTEM_NAME STREQUAL "Android")
   # This is the case that we are building with Tegra NSight.
   # Let it handle the APK generation.
-    if(MSVC)
+    if(NOT ANDROID)
       set(WN_IS_TEGRA ON)
       include(${CMAKE_CURRENT_LIST_DIR}/tegra_build.cmake REQUIRED)
     endif()
@@ -486,12 +486,14 @@
     ${ARGN})
   if (WN_SYSTEM STREQUAL "Android" AND NOT ${WN_IS_TEGRA})
     add_wn_library(${target} SHARED SOURCES ${PARSED_ARGS_SOURCES})
-    build_apk(ACTIVITY ${target} PROGRAM_NAME ${target} TARGET ${target})
   else()
     add_executable(${target} ${PARSED_ARGS_SOURCES})
   endif()
   if (PARSED_ARGS_LINK_LIBRARIES)
     wn_target_link_libraries(${target} PRIVATE ${PARSED_ARGS_LINK_LIBRARIES})
+  endif()
+  if (WN_SYSTEM STREQUAL "Android")
+    build_apk(ACTIVITY ${target} PROGRAM_NAME ${target} TARGET ${target})
   endif()
 endfunction()


CPM changes.

CPM changes.

--- CPM.cmake
+++ CPM.cmake
@@ -746,6 +746,7 @@
   set(__CPM_NEW_GIT_TAG)

   # Setup the project.
+  message("Adding subdir: ${__CPM_MODULE_SOURCE_DIR} -- ${__CPM_MODULE_BIN_DIR}")
   add_subdirectory("${__CPM_MODULE_SOURCE_DIR}" "${__CPM_MODULE_BIN_DIR}")

   # Parse the arguments once again after adding the subdirectory (since we


update config file path to use CTest intrinsic variables rather than manually building the path

--- ctest/steer.cmake
+++ ctest/steer.cmake
@@ -86,10 +86,10 @@

 # configure CTest just before running the test so all variables exist
 ## -- CTest Config
-configure_file(${CTEST_SOURCE_DIRECTORY}/ctest/CTestConfig.cmake ${CTEST_BINARY_DIRECTORY}/CTestConfig.cmake)
+configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestConfig.cmake ${CTEST_BINARY_DIRECTORY}/CTestConfig.cmake)

 ## -- CTest Testfile
-configure_file(${CTEST_SOURCE_DIRECTORY}/ctest/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake)
+configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake)
 #configure_file(${CTEST_SOURCE_DIRECTORY}/reg_tests/CTestList.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake)

 ## -- Start


Upgraded CodeCoverage.cmake.

Upgraded CodeCoverage.cmake.

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -1,14 +1,41 @@
+#
+# 2012-01-31, Lars Bilke
 # - Enable Code Coverage
 #
-# 2012-01-31, Lars Bilke
+# 2013-09-17, Joakim Söderberg
+# - Added support for Clang.
+# - Some additional usage instructions.
 #
 # USAGE:
-# 1. Copy this file into your cmake modules path
+
+# 0. (Mac only) If you use Xcode 5.1 make sure to patch geninfo as described here:
+#      http://stackoverflow.com/a/22404544/80480
+#
+# 1. Copy this file into your cmake modules path.
+#
 # 2. Add the following line to your CMakeLists.txt:
 #      INCLUDE(CodeCoverage)
-#
+#
+# 3. Set compiler flags to turn off optimization and enable coverage:
+#    SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+#	 SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+#
 # 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
-#    which runs your test executable and produces a lcov code coverage report.
+#    which runs your test executable and produces a lcov code coverage report:
+#    Example:
+#	 SETUP_TARGET_FOR_COVERAGE(
+#				my_coverage_target  # Name for custom target.
+#				test_driver         # Name of the test driver executable that runs the tests.
+#									# NOTE! This should always have a ZERO as exit code
+#									# otherwise the coverage generation will not complete.
+#				coverage            # Name of output directory.
+#				)
+#
+# 4. Build a Debug build:
+#	 cmake -DCMAKE_BUILD_TYPE=Debug ..
+#	 make
+#	 make my_coverage_target
+#
 #

 # Check prereqs
@@ -22,21 +49,45 @@
 ENDIF() # NOT GCOV_PATH

 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-	MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+	# Clang version 3.0.0 and greater now supports gcov as well.
+	MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.")
+
+	IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+		MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+	ENDIF()
 ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX

-IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
-  MESSAGE( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" )
+SET(CMAKE_CXX_FLAGS_COVERAGE
+    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+    CACHE STRING "Flags used by the C++ compiler during coverage builds."
+    FORCE )
+SET(CMAKE_C_FLAGS_COVERAGE
+    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+    CACHE STRING "Flags used by the C compiler during coverage builds."
+    FORCE )
+SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+    ""
+    CACHE STRING "Flags used for linking binaries during coverage builds."
+    FORCE )
+SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+    ""
+    CACHE STRING "Flags used by the shared libraries linker during coverage builds."
+    FORCE )
+MARK_AS_ADVANCED(
+    CMAKE_CXX_FLAGS_COVERAGE
+    CMAKE_C_FLAGS_COVERAGE
+    CMAKE_EXE_LINKER_FLAGS_COVERAGE
+    CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
+
+IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
+  MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
 ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"

-# Setup compiler options
-ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
-LINK_LIBRARIES(gcov)
-
-
 # Param _targetname     The name of new the custom make target
-# Param _testrunner     The name of the target which runs the tests
+# Param _testrunner     The name of the target which runs the tests.
+#						MUST return ZERO always, even on errors.
+#						If not, no coverage report will be created!
 # Param _outputname     lcov output is generated as _outputname.info
 #                       HTML report is generated in _outputname/index.html
 # Optional fourth parameter is passed as arguments to _testrunner
@@ -62,7 +113,7 @@

 		# Capturing lcov counters and generating report
 		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' 'lib/unittestpp/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
 		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned


Fix bug 542: fix detection of compiler version on systems without the head command.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -322,13 +322,21 @@
     endif()
   else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
-    execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
-                    COMMAND head -n 1
-                    OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    # supporting a "--version" flag

-    ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+    # check whether the head command exists
+    find_program(HEAD_EXE head NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
+    if(HEAD_EXE)
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      COMMAND head -n 1
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    else()
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REGEX REPLACE "[\n\r].*"  ""  eigen_cxx_compiler_version_string  ${eigen_cxx_compiler_version_string})
+    endif()

+    ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)
     set(${VAR} "${CNAME}-${CVER}")
   endif()
 endmacro(ei_get_compilerver)


Applied fix to build with gtest on Ubuntu 18.04

This allows a build with system libraries (good for users who
want to build from sources)

--- cmake/FindGTestFix.cmake
+++ cmake/FindGTestFix.cmake
@@ -20,7 +20,7 @@

       if(LSB_CODENAME MATCHES stretch)
         set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
-      elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial)
+      elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial OR LSB_CODENAME MATCHES bionic)
         set(GTEST_SOURCE_DIR /usr/src/gtest)
       endif()


cmake: fix __STDC macros for opencv_world build

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -223,8 +223,10 @@
     if(NOT BUILD_${the_module})
       return() # extra protection from redefinition
     endif()
-    if((NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD AND NOT ${the_module} STREQUAL opencv_world) OR NOT ${BUILD_opencv_world})
-      project(${the_module})
+    if(NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD OR NOT ${BUILD_opencv_world})
+      if (NOT ${the_module} STREQUAL opencv_world)
+        project(${the_module})
+      endif()
       add_definitions(
         -D_USE_MATH_DEFINES  # M_PI constant in MSVS
         -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS  # to use C libraries from C++ code (ffmpeg)


introduced requirement of ROCm 1.9 to build

--- cmake/SetToolchain.cmake
+++ cmake/SetToolchain.cmake
@@ -1,5 +1,5 @@
 # Find HIP package
-find_package(HIP REQUIRED)
+find_package(HIP 1.5.18353 REQUIRED) # ROCm 1.9

 # Select toolchain
 if(HIP_PLATFORM STREQUAL "nvcc" OR HIP_COMPILER STREQUAL "clang")


deps/eigen dependency as system include

deps/eigen dependency as system include

--- cmake/dependencies.cmake
+++ cmake/dependencies.cmake
@@ -12,4 +12,4 @@

 # Eigen
 find_package(Eigen3 3.3 REQUIRED)
-include_directories(${EIGEN3_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR}/../)
+include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR}/../)


CMake link dir fix.

CMake link dir fix.


Update CUTE module

Update CUTE module

--- cmake/modules/CUTE.cmake
+++ cmake/modules/CUTE.cmake
@@ -2,6 +2,12 @@

 set(ENV{CTEST_OUTPUT_ON_FAILURE} "1")
 set(CUTE_TEST_REPORTS_DIRECTORY ${CMAKE_BINARY_DIR}/cute-reports)
+
+if(HAS_PARENT)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}/test")
+else()
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test")
+endif()

 if(NOT WIN32)
   string(ASCII 27 ESC)
@@ -29,36 +35,39 @@
   set(TEST_SOURCE_FILE "${TEST_NAME}_test.cpp")
   set(TEST_TARGET_NAME "${TEST_NAME}_test")

-  file(STRINGS "${TEST_SOURCE_FILE}" LIBRARIES REGEX "//[ \t]*@CMAKE_CUTE_LIBRARY=.*")
-  file(STRINGS "${TEST_SOURCE_FILE}" DEPENDENCIES REGEX "//[ \t]*@CMAKE_CUTE_DEPENDENCY=.*")
+  if(NOT TARGET ${TEST_TARGET_NAME})

-  set(LIBS "")
-  set(DEPS "")
+    file(STRINGS "${TEST_SOURCE_FILE}" LIBRARIES REGEX "//[ \t]*@CMAKE_CUTE_LIBRARY=.*")
+    file(STRINGS "${TEST_SOURCE_FILE}" DEPENDENCIES REGEX "//[ \t]*@CMAKE_CUTE_DEPENDENCY=.*")

-  foreach(LIBRARY IN LISTS LIBRARIES)
-    string(REGEX REPLACE "//[ \t]*@CMAKE_CUTE_LIBRARY=(.*)" "\\1" LIBRARY ${LIBRARY})
-    list(APPEND LIBS ${LIBRARY})
-  endforeach()
+    set(LIBS "")
+    set(DEPS "")

-  foreach(DEPENDENCY IN LISTS DEPENDENCIES)
-    string(REGEX REPLACE "//[ \t]*@CMAKE_CUTE_DEPENDENCY=(.*)" "\\1" DEPENDENCY ${DEPENDENCY})
-    list(APPEND DEPS "${PROJECT_SOURCE_DIR}/${DEPENDENCY}")
-  endforeach()
+    foreach(LIBRARY IN LISTS LIBRARIES)
+      string(REGEX REPLACE "//[ \t]*@CMAKE_CUTE_LIBRARY=(.*)" "\\1" LIBRARY ${LIBRARY})
+      list(APPEND LIBS ${LIBRARY})
+    endforeach()

-  message(STATUS "${BYE}Adding test ${BBL}${TEST_NAME}${RST}")
+    foreach(DEPENDENCY IN LISTS DEPENDENCIES)
+      string(REGEX REPLACE "//[ \t]*@CMAKE_CUTE_DEPENDENCY=(.*)" "\\1" DEPENDENCY ${DEPENDENCY})
+      list(APPEND DEPS "${PROJECT_SOURCE_DIR}/${DEPENDENCY}")
+    endforeach()

-  add_executable(${TEST_TARGET_NAME} ${TEST_SOURCE_FILE} ${DEPS})
+    message(STATUS "${BYE}Adding test ${BBL}${TEST_NAME}${RST}")

-  if(TARGET ${TEST_TARGET_NAME})
-    target_link_libraries(${TEST_TARGET_NAME} ${LIBS})
-    add_test(NAME ${TEST_TARGET_NAME} WORKING_DIRECTORY ${CUTE_TEST_REPORTS_DIRECTORY} COMMAND ${TEST_TARGET_NAME})
-    if(NOT CUTE_SKIP_RUN_UNIT_TESTS)
-      add_custom_target(cute_${TEST_TARGET_NAME} ALL
-                        COMMAND ctest -R ${TEST_TARGET_NAME} -Q --output-on-failure
-                        DEPENDS ${TEST_TARGET_NAME}
-                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-                        COMMENT "Running CUTE test ${TEST_NAME} ..."
-                        VERBATIM)
-    endif(NOT CUTE_SKIP_RUN_UNIT_TESTS)
+    add_executable(${TEST_TARGET_NAME} ${TEST_SOURCE_FILE} ${DEPS})
+
+    if(TARGET ${TEST_TARGET_NAME})
+      target_link_libraries(${TEST_TARGET_NAME} ${LIBS})
+      add_test(NAME ${TEST_TARGET_NAME} WORKING_DIRECTORY ${CUTE_TEST_REPORTS_DIRECTORY} COMMAND ${TEST_TARGET_NAME})
+      if(NOT CUTE_SKIP_RUN_UNIT_TESTS)
+        add_custom_target(cute_${TEST_TARGET_NAME} ALL
+                          COMMAND ctest -R ${TEST_TARGET_NAME} -Q --output-on-failure
+                          DEPENDS ${TEST_TARGET_NAME}
+                          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+                          COMMENT "Running CUTE test ${TEST_NAME} ..."
+                          VERBATIM)
+      endif(NOT CUTE_SKIP_RUN_UNIT_TESTS)
+    endif()
   endif()
 endfunction()


fix glad linking on linux

fix glad linking on linux

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -210,12 +210,13 @@
       set(GLAD_LIB_IMPORT "lib/glad.lib")
     else()
       #set(GLAD_LIB "lib/libglad.a")
-      set(GLAD_LIB "bin/libglad.so")
+      set(GLAD_LIB "lib/libglad.so")
+      set(GLAD_LIB2 "lib/libglad.so.1")
     endif()

     add_external_project(glad SHARED
       SOURCE_DIR glad
-      BUILD_BYPRODUCTS "<INSTALL_DIR>/${GLAD_LIB}" "<INSTALL_DIR>/${GLAD_LIB_IMPORT}")
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${GLAD_LIB}" "<INSTALL_DIR>/${GLAD_LIB2}" "<INSTALL_DIR>/${GLAD_LIB_IMPORT}")

     add_external_library(glad
       PROJECT glad


added missing DEPENDS specs for qt4

added missing DEPENDS specs for qt4

--- qt4.cmake
+++ qt4.cmake
@@ -40,7 +40,7 @@
 # (This builds everything that ilastik needs.)

 ExternalProject_Add(${qt4_NAME}
-    DEPENDS             ${freetype2_NAME}
+    DEPENDS             ${freetype2_NAME} ${zlib_NAME} ${libpng_NAME} ${libjpeg_NAME} ${libtiff_NAME}
     PREFIX              ${BUILDEM_DIR}
     URL                 ${qt4_URL}
     URL_MD5             ${qt4_MD5}


修订一些编译选项

修订一些编译选项

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -67,7 +67,7 @@
     if(NOT WIN32 AND NOT CYGWIN AND NOT MINGW)
         add_definitions(-fPIC)
     endif()
-
+
     add_definitions(-Wall -Werror)
     if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "3.4")
         set(CMAKE_C_STANDARD 11)
@@ -120,6 +120,7 @@
     if(COMPILER_CLANG_HAS_LIBCXX AND COMPILER_CLANG_HAS_LIBCXXABI)
         add_definitions(-stdlib=libc++)
         message(STATUS "AppleClang use stdlib=libc++")
+        list(APPEND COMPILER_OPTION_EXTERN_CXX_LIBS c++ c++abi)
     else()
         message(STATUS "AppleClang use stdlib=default(libstdc++)")
     endif()


try again

try again

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -153,7 +153,7 @@
             message(STATUS "AppleClang use stdlib=default(libstdc++)")
         endif()
     elseif(MSVC)
-        list(APPEND COMPILER_STRICT_CFLAGS /W4 /wd"4100" /wd"4125" /wd"C4566" /WX)
+        list(APPEND COMPILER_STRICT_CFLAGS /W4 /wd4100 /wd4125 /wd4566 /WX)
         add_definitions(/MP /EHsc)
         if (MSVC_VERSION GREATER_EQUAL 1910)
             add_definitions(/std:c++17)


This CMake variable might even exist.

This CMake variable might even exist.

--- interpreter/llvm/src/include/llvm/Config/llvm-config.h.cmake
+++ interpreter/llvm/src/include/llvm/Config/llvm-config.h.cmake
@@ -80,7 +80,7 @@
 #cmakedefine LLVM_ON_WIN32 ${LLVM_ON_WIN32}

 /* C++ compiler used to build llvm */
-#cmakedefine LLVM_CXX "${CXX}"
+#cmakedefine LLVM_CXX "${CMAKE_CXX_COMPILER}"

 /* Define to path to circo program if found or 'echo circo' otherwise */
 #cmakedefine LLVM_PATH_CIRCO "${LLVM_PATH_CIRCO}"


- space to tab

 - space to tab

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12232 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/pch.cmake
+++ rdo/packages/cmake/trunk/pch.cmake
@@ -3,19 +3,19 @@
 #==============================================================================

 MACRO(ADD_PCH SOURCE_FILES NO_PCH_FILES PCH_FILE PCH_PATH)
-    FOREACH(source_file ${SOURCE_FILES})
-        GET_FILENAME_COMPONENT(CPP ${source_file} EXT)
-        IF (${CPP} STREQUAL ".cpp")
-            LIST(FIND NO_PCH_FILES ${source_file} no_pch_index)
-            IF (${no_pch_index} EQUAL -1)
-                SET_SOURCE_FILES_PROPERTIES(${source_file}
-                    PROPERTIES COMPILE_FLAGS "/Yu${PCH_PATH}/${PCH_FILE}.h"
-                )
-            ENDIF (${no_pch_index} EQUAL -1)
-        ENDIF (${CPP} STREQUAL ".cpp")
-    ENDFOREACH(source_file)
+	FOREACH(source_file ${SOURCE_FILES})
+		GET_FILENAME_COMPONENT(CPP ${source_file} EXT)
+		IF (${CPP} STREQUAL ".cpp")
+			LIST(FIND NO_PCH_FILES ${source_file} no_pch_index)
+			IF (${no_pch_index} EQUAL -1)
+				SET_SOURCE_FILES_PROPERTIES(${source_file}
+					PROPERTIES COMPILE_FLAGS "/Yu${PCH_PATH}/${PCH_FILE}.h"
+				)
+			ENDIF (${no_pch_index} EQUAL -1)
+		ENDIF (${CPP} STREQUAL ".cpp")
+	ENDFOREACH(source_file)

-    SET_SOURCE_FILES_PROPERTIES(${PCH_FILE}.cpp
-        PROPERTIES COMPILE_FLAGS "/Yc${PCH_PATH}/${PCH_FILE}.h"
-    )
+	SET_SOURCE_FILES_PROPERTIES(${PCH_FILE}.cpp
+		PROPERTIES COMPILE_FLAGS "/Yc${PCH_PATH}/${PCH_FILE}.h"
+	)
 ENDMACRO(ADD_PCH)


Graph Control 4.2.0-rc1 Release Candidate 1

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

--- version.cmake
+++ version.cmake
@@ -4,8 +4,8 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 1 )
-set ( HPCC_MATURITY "closedown" )
+set ( HPCC_POINT 0 )
+set ( HPCC_MATURITY "rc" )
 set ( HPCC_SEQUENCE 1 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )


Nagios Monitoring 5.2.0-rc1 Release Candidate 1

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

--- version.cmake
+++ version.cmake
@@ -5,6 +5,6 @@
 set ( HPCC_MAJOR 5 )
 set ( HPCC_MINOR 2 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "closedown" )
-set ( HPCC_SEQUENCE 0 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 1 )
 ###


Do not increase Windows stack size.

Do not increase Windows stack size.

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -43,8 +43,7 @@
 	set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
 	# warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
 	# warning LNK4099: pdb was not found with lib
-	# stack size 16MB
-	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:33554432")
+	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075")

 	# windows likes static
 	if (NOT ETH_STATIC)


Fix FindOptionalPackage.cmake when plugins is disabled (OS X)

--- cmake/FindOptionalPackage.cmake
+++ cmake/FindOptionalPackage.cmake
@@ -5,6 +5,7 @@
         file(REMOVE ${_OptionalPackagesFile})
     endif()
 endif()
+file(APPEND "${_OptionalPackagesFile}" "")

 macro (find_optional_package _package)
     string(TOUPPER ${_package} _packageUpper)


Fixed missing symbol when linking python3. Closed #141

--- cmake/PythonNumpyPybind11.cmake
+++ cmake/PythonNumpyPybind11.cmake
@@ -46,6 +46,7 @@
 if (WIN32)
   link_directories(${PYTHON_LIBRARY_DIR}/../../libs)
   set(PYTHON_LIBRARIES ${PYTHON_LIBRARY_DIR}/../../libs/python3.lib)
+  set(PYTHON_LIBRARIES ${PYTHON_LIBRARY_DIR}/../../libs/python36.lib)
 else()
   find_library(PYTHON_LIBRARY NAMES python${PYTHON_VERSION} python${PYTHON_VERSION}m PATHS ${PYTHON_LIBRARY_DIR}
           NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH PATH_SUFFIXES x86_64-linux-gnu)


Add logic to build the shared libs and srcaars for the non-App libraries.

Adds a helper function to build the "empty" shared libraries used by the non-App libraries. Changes how the C++ proguard file is defined to use a target. Changes the aar generation code to rely more on the targets, and using generator expressions.

PiperOrigin-RevId: 280502793

--- cmake/firebase_cpp_gradle.cmake
+++ cmake/firebase_cpp_gradle.cmake
@@ -44,9 +44,14 @@
   string(TOUPPER "${LIBRARY_NAME}" upper_name)
   set(proguard_var "FIREBASE_CPP_${upper_name}_PROGUARD")
   set(${proguard_var}
-      "${FIREBASE_SOURCE_DIR}/${LIBRARY_NAME}/build/${LIBRARY_NAME}.pro")
-  set("${proguard_var}" "${${proguard_var}}" PARENT_SCOPE)
+      "${FIREBASE_SOURCE_DIR}/${LIBRARY_NAME}/build/${LIBRARY_NAME}.pro"
+      CACHE FILEPATH "Proguard file for ${LIBRARY_NAME}" FORCE)

   firebase_cpp_gradle(":${LIBRARY_NAME}:externalNativeBuildRelease"
                       "${${proguard_var}}")
+
+  add_custom_target(
+    "${LIBRARY_NAME}_cpp_proguard"
+    DEPENDS ${${proguard_var}}
+  )
 endfunction()


Revert "[SkipFunctionBodies] Build everything but the stdlib with function body skipping"

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -331,11 +331,6 @@
       set(interface_file "${module_base}.swiftinterface")
       list(APPEND swift_module_flags
            "-emit-module-interface-path" "${interface_file}")
-    endif()
-
-    if (NOT SWIFTFILE_IS_STDLIB_CORE)
-      list(APPEND swift_module_flags
-           "-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
     endif()

     # If we have extra regexp flags, check if we match any of the regexps. If so


Install protobuf generated header file for OTLP (#515)

--- cmake/opentelemetry-proto.cmake
+++ cmake/opentelemetry-proto.cmake
@@ -141,6 +141,12 @@
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
   ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

+install(
+  DIRECTORY ${GENERATED_PROTOBUF_PATH}/opentelemetry
+  DESTINATION include
+  FILES_MATCHING
+  PATTERN "*.h")
+
 if(TARGET protobuf::libprotobuf)
   target_link_libraries(opentelemetry_proto PUBLIC protobuf::libprotobuf)
 else() # cmake 3.8 or lower


Nagios Monitoring 7.4.0-rc2 Release Candidate 2

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

--- version.cmake
+++ version.cmake
@@ -5,6 +5,6 @@
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 4 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "closedown" )
-set ( HPCC_SEQUENCE 0 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 2 )
 ###


removing annoying debug messages

removing annoying debug messages

--- dist/WkCompilerSetup.cmake
+++ dist/WkCompilerSetup.cmake
@@ -173,7 +173,7 @@
 	#Default : Multiple-Configuration Generator ( MSVC )
 	#Forcing configuration at build time
 	SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;" CACHE INTERNAL "Semicolon separated list of supported configuration types in your Build Environment. Do not edit." )
-	message ( "CMAKE_CONFIGURATION_TYPES : ${CMAKE_CONFIGURATION_TYPES} ")
+	#message ( "CMAKE_CONFIGURATION_TYPES : ${CMAKE_CONFIGURATION_TYPES} ")
 	WkDisableFlags( RelWithDebInfo )
 	WkDisableFlags( MinSizeRel )

@@ -196,7 +196,7 @@

 		#Forcing configuration at generation time
 		SET(CMAKE_BUILD_TYPE "${${PROJECT_NAME}_BUILD_TYPE}" CACHE INTERNAL "Internal CMake Build Type. Do not edit." )
-		message ( "CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE} ")
+		#message ( "CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE} ")

 	endif( NOT MSVC )


Fixed Clang?

Fixed Clang?

--- CMake/ConfigureLibraries.cmake
+++ CMake/ConfigureLibraries.cmake
@@ -21,12 +21,12 @@
     -DGLFW_BUILD_TESTS:BOOL=OFF)

 # All-target libraries go here.
-add_linker_files(${STDLIB})
 add_linker_files(glfw3)
 required_package(OpenGL OPENGL_LIBRARIES)

 # Target-specific libraries go here.
 if ("${PLATFORM}" STREQUAL "Win")
+    add_linker_files(${STDLIB})
     required_library(gdi32)
     required_library(kernel32)
     required_library(user32)
@@ -37,6 +37,7 @@
     required_library(CoreVideo)

 elseif ("${PLATFORM}" STREQUAL "Linux")
+    add_linker_files(${STDLIB})
     required_library(dl)
     required_library(pthread)
     required_library(X11)


find GenICam 2.1 and 1.1

find GenICam 2.1 and 1.1

--- CMakeModules/FindGenICam.cmake
+++ CMakeModules/FindGenICam.cmake
@@ -1,12 +1,25 @@
 INCLUDE(FindPackageHandleStandardArgs)

-FIND_LIBRARY(GENICAM_LIBRARY GenApi_gcc40_v2_1
+FIND_LIBRARY(GENICAM_LIBRARY_2_1 GenApi_gcc40_v2_1
   /opt/pylon/genicam/bin/Linux64_x64
 )
+
+FIND_LIBRARY(GENICAM_LIBRARY_1_1 genicam_api
+  /opt/pylon/lib64
+)
+
+IF (GENICAM_LIBRARY_1_1 OR GENICAM_LIBRARY_2_1)
+  IF(GENICAM_LIBRARY_2_1)
+    SET(GENICAM_LIBRARY ${GENICAM_LIBRARY_2_1})
+  ELSE(GENICAM_LIBRARY_2_1)
+    SET(GENICAM_LIBRARY ${GENICAM_LIBRARY_1_1})
+  ENDIF(GENICAM_LIBRARY_2_1)
+ENDIF (GENICAM_LIBRARY_1_1 OR GENICAM_LIBRARY_2_1)

 FIND_PATH(GENICAM_INCLUDE_PATH GenICamVersion.h
   "$ENV{GENICAM_INCLUDE_PATH}"
   /opt/pylon/genicam/library/CPP/include
+  /opt/pylon/include
 )

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GENICAM DEFAULT_MSG


Stop the presses if triangle is not found

--HG--
branch : syclop-triangulate

--- CMakeModules/UseTriangle.cmake
+++ CMakeModules/UseTriangle.cmake
@@ -19,4 +19,5 @@
     include(FindPackageHandleStandardArgs)
     find_package_handle_standard_args(triangle DEFAULT_MSG TRIANGLE_LIBRARY TRIANGLE_INCLUDE_DIR)
 else(TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
+    message(FATAL_ERROR "Triangle is not found")
 endif(TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)


Install .cfg files when OGRE_INSTALL_SAMPLES_SOURCE is specified even if OGRE_INSTALL_SAMPLES (binaries) is false
Needed for SDK

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401731

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -88,7 +88,7 @@
 configure_file(${OGRE_TEMPLATES_DIR}/samples.cfg.in ${OGRE_BINARY_DIR}/inst/bin/release/samples.cfg)

 # install resource files
-if (OGRE_INSTALL_SAMPLES OR OGRE_INSTALL_TOOLS)
+if (OGRE_INSTALL_SAMPLES OR OGRE_INSTALL_SAMPLES_SOURCE OR OGRE_INSTALL_TOOLS)
   install(FILES
     ${OGRE_BINARY_DIR}/inst/bin/debug/resources.cfg
     ${OGRE_BINARY_DIR}/inst/bin/debug/plugins.cfg
@@ -111,7 +111,7 @@
 	DESTINATION "bin${OGRE_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
   )
 endif ()
-if (OGRE_INSTALL_SAMPLES)
+if (OGRE_INSTALL_SAMPLES OR OGRE_INSTALL_SAMPLES_SOURCE)
   install(FILES
 	${OGRE_BINARY_DIR}/inst/bin/debug/samples.cfg
     ${OGRE_BINARY_DIR}/inst/bin/debug/media.cfg


Renamed resovled_item and resolved parameters on gp_resolve_item_override macro

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -90,7 +90,7 @@
       endif()
     endmacro(gp_resolved_file_type_override)

-    macro(gp_resolve_item_override context item exepath dirs resolved_item resolved)
+    macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)

       get_filename_component(_item_name \"\${item}\" NAME)
       get_filename_component(_item_path \"\${item}\" PATH)
@@ -115,8 +115,8 @@
       set(ri \"ri-NOTFOUND\")
       find_file(ri \"\${item}\" \${_item_path})
       if(ri)
-        set(resolved 1)
-        set(resolved_item \"\${ri}\")
+        set(resolved_var 1)
+        set(resolved_item_var \"\${ri}\")
         set(ri \"ri-NOTFOUND\")
       endif(ri)


prevent adding the gmock subdirectory twice (#91)

--- ament_cmake_gmock/ament_cmake_gmock-extras.cmake
+++ ament_cmake_gmock/ament_cmake_gmock-extras.cmake
@@ -78,12 +78,16 @@
       message(STATUS "Found gmock sources under '${GMOCK_FROM_SOURCE_BASE_DIR}': "
         "C++ tests using 'Google Mock' will be built")

-      # add CMakeLists.txt from gmock dir
-      add_subdirectory("${GMOCK_FROM_SOURCE_BASE_DIR}" "${CMAKE_BINARY_DIR}/gmock")
+      # if gmock is already a target, do not add again
+      # this can happen when ament_add_gmock() is called from a subdirectory
+      if(NOT TARGET gmock)
+        # add CMakeLists.txt from gmock dir
+        add_subdirectory("${GMOCK_FROM_SOURCE_BASE_DIR}" "${CMAKE_BINARY_DIR}/gmock")

-      # mark gmock targets with EXCLUDE_FROM_ALL to only build
-      # when tests are built which depend on them
-      set_target_properties(gmock gmock_main PROPERTIES EXCLUDE_FROM_ALL 1)
+        # mark gmock targets with EXCLUDE_FROM_ALL to only build
+        # when tests are built which depend on them
+        set_target_properties(gmock gmock_main PROPERTIES EXCLUDE_FROM_ALL 1)
+      endif()

       # set the same variables as find_package() would set
       # but do NOT set GMOCK_FOUND in the cache when using gmock from source


Removes policy issue

Removes policy issue

--- scripts/ConfigureFiles.cmake
+++ scripts/ConfigureFiles.cmake
@@ -48,7 +48,7 @@
         list(APPEND _cf_configured_files "${output}")
     endforeach()

-    if(NOT "${_cf_OUTPUT_FILES}" STREQUAL "")
+    if(NOT _cf_OUTPUT_FILES STREQUAL "")
         set(${_cf_OUTPUT_FILES} ${_cf_configured_files})
     endif()
 endmacro()


improve compiler and architecture detection

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -298,23 +298,31 @@

     if( my_service_pack )
       set(${VAR} ${my_service_pack})
-	else()
-	  set(${VAR} "na")
-    endif()
-  else()
-    # on all other system we rely on ${CMAKE_CXX_COMPILER}
-	# supporting a "--version" flag
-	exec_program(${CMAKE_CXX_COMPILER}
-	  ARGS --version
-	  OUTPUT_VARIABLE eigen_cxx_compiler_version
-	)
-	# here I try to extract the version string
-	# - TODO: this can most likely be improved and fixed
-    string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
-      eigen_cxx_compiler_version ${eigen_cxx_compiler_version})
-	# again, here is room for improvement
-	# what if the compiler is not "g++" !?
-    set(${VAR} "g++${eigen_cxx_compiler_version}")
+    else()
+      set(${VAR} "na")
+    endif()
+  else()
+    # on all other system we rely on ${CMAKE_CXX_COMPILER}
+    # supporting a "--version" flag
+    exec_program( ${CMAKE_CXX_COMPILER}
+                  ARGS --version
+                  OUTPUT_VARIABLE eigen_cxx_compiler_version_raw
+                )
+    # first extract the compiler name which is the first word
+    string( REGEX REPLACE ".*(llvm\\-g\\+\\+|g\\+\\+|icpc|clang).*" "\\1"
+            eigen_cxx_compiler_name ${eigen_cxx_compiler_version_raw})
+
+    if(eigen_cxx_compiler_name MATCHES ".*g\\+\\+.*")
+      string( REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
+              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
+    elseif(eigen_cxx_compiler_name MATCHES "icpc|clang")
+      string( REGEX REPLACE ".* ([0-9]*)\\.([0-9]*) .*" "\\1.\\2"
+              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
+    else()
+      set(eigen_cxx_compiler_version "_")
+    endif()
+
+    set(${VAR} "${eigen_cxx_compiler_name}-${eigen_cxx_compiler_version}")
   endif()
 endmacro(ei_get_compilerver)

@@ -378,7 +386,17 @@
 endmacro(ei_set_build_string)

 macro(ei_is_64bit_env VAR)
-  if(CMAKE_CL_64)
+
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+      "int main() { return (sizeof(int*) == 8 ? 1 : 0); }
+      ")
+  try_run(run_res compile_res
+         ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+          RUN_OUTPUT_VARIABLE run_output)
+
+  if(compile_res AND run_res)
+    set(${VAR} ${run_res})
+  elseif(CMAKE_CL_64)
     set(${VAR} 1)
   elseif("$ENV{Platform}" STREQUAL "X64") # nmake 64 bit
     set(${VAR} 1)


add optional compile flags to enable coverage testing

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -153,11 +153,17 @@
 endmacro(ei_init_testing)

 if(CMAKE_COMPILER_IS_GNUCXX)
+  option(EIGEN_COVERAGE_TESTING "Enable/disable gcov" OFF)
+  if(EIGEN_COVERAGE_TESTING)
+    set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")
+  else(EIGEN_COVERAGE_TESTING)
+    set(COVERAGE_FLAGS "")
+  endif(EIGEN_ENABLE_COVERAGE_TESTING)
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g2")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g2")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-inline-functions")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g2")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COVERAGE_FLAGS} -fno-inline-functions")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g2")
   endif(CMAKE_SYSTEM_NAME MATCHES Linux)
   set(EI_OFLAG "-O2")
 elseif(MSVC)


Oops!  It's GLES not GL :)

Oops!  It's GLES not GL :)

--- cmake/FindOpenGLES.cmake
+++ cmake/FindOpenGLES.cmake
@@ -17,7 +17,7 @@
     set (OPENGLES_INCLUDE_DIR ${OPENGLES_H_PATH})
     set (OPENGLES_LIBRARIES ${OPENGLES_LIB})
     if (OPENGLES_LIB_DBG)
-        set (OPENGL_LIBRARIES_DBG ${OPENGLES_LIB_DBG})
+        set (OPENGLES_LIBRARIES_DBG ${OPENGLES_LIB_DBG})
     endif()
 else()
     set (OPENGLES_INCLUDE_DIR)


CMAKE: removed for loop from ivw_add_dependency_list since remove_library_list function works on list, not single items. (inviwo/inviwo-dev#982)

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -1002,22 +1002,13 @@
 #--------------------------------------------------------------------
 # Adds dependancy and includes package variables to the project
 macro(ivw_add_dependency_libraries)
-    foreach (package ${ARGN})
-      #--------------------------------------------------------------------
-      # Add dependcy package variables to this package if shared build
-      #if(NOT BUILD_SHARED_LIBS)
-          #--------------------------------------------------------------------
-          # Append includes to project list
-          set(uniqueNewLibs ${package})
-          remove_library_list(uniqueNewLibs "${package}" ${_allLibs})
-          set(${package} ${uniqueNewLibs})
-          list (APPEND _allLibs ${package})
-      #endif()
-
-      #--------------------------------------------------------------------
-      # Link library
-      target_link_libraries(${_projectName} ${package})
-    endforeach()
+    if(${ARGC} GREATER 0)
+        set(uniqueNewLibs ${ARGN})
+        remove_library_list(uniqueNewLibs "${ARGN}" ${_allLibs})
+        set(${ARGN} ${uniqueNewLibs})
+        target_link_libraries(${_projectName} ${ARGN})
+  endif()
+
 endmacro()

 #--------------------------------------------------------------------


ENH: Remove unused warning file.

ENH: Remove unused warning file.

--- CMake/InstallDisabled.cmake
+++ CMake/InstallDisabled.cmake
@@ -1,3 +0,0 @@
-MESSAGE(FATAL_ERROR
-  "ERROR: VTK installation is disabled because VTK_USE_RPATH is ON and you are using a CMake version earlier than 2.4.  It is not safe to install binaries that have a runtime path pointing to the build tree.  In order to install safely you need to delete the libraries from your build tree, set VTK_USE_RPATH to OFF, and rebuild.  See comments in VTK/CMake/vtkSelectSharedLibraries.cmake for more information."
-)


Platform specific include libs

Platform specific include libs

--- config/IRTKInclude.cmake
+++ config/IRTKInclude.cmake
@@ -194,9 +194,11 @@

 LINK_LIBRARIES(segmentation++ registration2++ registration++ transformation++ contrib++
-image++ geometry++ common++ recipes)
-LINK_LIBRARIES(${CMAKE_DL_LIBS} pthread)
-
+image++ geometry++ common++ recipes)
+
+IF (UNIX)
+   LINK_LIBRARIES(${CMAKE_DL_LIBS} pthread)
+ENDIF ()

 # Options to build with nifti, znz and possibly fslio
 OPTION(BUILD_WITH_NIFTI "Build using NIFTI support" ON)


Remove cmake warning about policy change

--- scripts/CheckCXX11Features.cmake
+++ scripts/CheckCXX11Features.cmake
@@ -118,7 +118,8 @@
     set(UNKNOWN_FEATURES)
     set(result_type OPTIONAL_FEATURES)
     foreach(feature ${ARGN})
-      if(${feature} STREQUAL "REQUIRED")
+      string(COMPARE EQUAL "${feature}" "REQUIRED" avoid_cmake_warning)
+      if(avoid_cmake_warning)
         set(result_type REQUIRED_FEATURES)
       else()
         list(FIND ALLFEATURES ${feature} feature_was_found)
@@ -128,8 +129,7 @@
         else()
           list(APPEND ${result_type} ${feature})
         endif()
-
-      endif(${feature} STREQUAL "REQUIRED")
+      endif()
     endforeach()

     set(${OPTIONALS} ${OPTIONAL_FEATURES} PARENT_SCOPE)


Removed comments

Removed comments

--- etc/service.cmake
+++ etc/service.cmake
@@ -244,28 +244,12 @@
   else(true)
     add_custom_command(
       OUTPUT tarfile.o
-      #if(CREATE_TAR)
-      #  COMMAND tar cf ${CREATE_TAR}.tar ${CREATE_TAR}
-      #else(CREATE_TAR_GZ)
-      #  COMMAND tar czf ${CREATE_TAR_GZ}.tar.gz ${CREATE_TAR_GZ}
-      #endif(CREATE_TAR)
       COMMAND cp ${TAR_RELPATH} input.bin
       COMMAND ${CMAKE_OBJCOPY} -I binary -O elf32-i386 -B i386 input.bin tarfile.o
       COMMAND rm input.bin
     )
   endif(CREATE_TAR)

-  #add_custom_command(
-  #  OUTPUT tarfile.o
-  #  if(CREATE_TAR)
-  #    COMMAND tar cf ${CREATE_TAR}.tar ${CREATE_TAR}
-    #else(CREATE_TAR_GZ)
-    #  COMMAND tar czf ${CREATE_TAR_GZ}.tar.gz ${CREATE_TAR_GZ}
-    #endif(CREATE_TAR)
-  #  COMMAND cp ${TAR_RELPATH} input.bin
-  #  COMMAND ${CMAKE_OBJCOPY} -I binary -O elf32-i386 -B i386 input.bin tarfile.o
-  #  COMMAND rm input.bin
-  #)
   add_library(tarfile STATIC tarfile.o)
   set_target_properties(tarfile PROPERTIES LINKER_LANGUAGE CXX)
   target_link_libraries(service --whole-archive tarfile --no-whole-archive)


Foolin around with cmake & guile

Foolin around with cmake & guile

--- lib/FindGuile.cmake
+++ lib/FindGuile.cmake
@@ -12,15 +12,19 @@

 # Look for the header file
+# Look for guile-2.0 first, then 1.8
 # Macports for OSX puts things in /opt/local
 FIND_PATH(GUILE_INCLUDE_DIR libguile.h
+	/usr/include/guile/2.0
+	/usr/local/include/guile/2.0
+	/opt/local/include/guile/2.0
+
+	/usr/include/libguile
+	/usr/local/include/libguile
+	/opt/local/include/guile
+
 	/usr/include
 	/usr/local/include
-	/usr/include/libguile
-	/usr/local/include/libguile
-	/usr/include/guile/2.0
-	/usr/local/include/guile/2.0
-	/opt/local/include/guile
 )

 # Look for the library
@@ -47,6 +51,10 @@
 	SET(GUILE_VERSION_MAJOR 0)
 	SET(GUILE_VERSION_MINOR 0)
 	SET(GUILE_VERSION_PATCH 0)
+
+	IF(NOT EXISTS "${GUILE_INCLUDE_DIR}/libguile/version.h")
+		MESSAGE(FATAL_ERROR "Found libguile.h but not version.h; check your guile installation!")
+	ENDIF(NOT EXISTS "${GUILE_INCLUDE_DIR}/libguile/version.h")

 	# Extract the libguile version from the 'version.h' file
 	SET(GUILE_MAJOR_VERSION 0)


fix config.cmake

fix config.cmake

--- glow-config.cmake
+++ glow-config.cmake
@@ -54,18 +54,19 @@
 		PATHS ${HINT_PATHS}
 		DOC "The ${LIB_NAME} debug library")

-	if(${LIB_NAME_UPPER}_LIBRARY_DEBUG)
-		set(${LIB_NAME_UPPER}_LIBRARIES optimized ${${LIB_NAME_UPPER}_LIBRARY} debug ${${LIB_NAME_UPPER}_LIBRARY_DEBUG})
-	else()
-		set(${LIB_NAME_UPPER}_LIBRARIES ${${LIB_NAME_UPPER}_LIBRARY})
+	if(${LIB_NAME_UPPER}_LIBRARY AND ${LIB_NAME_UPPER}_LIBRARY_DEBUG)
+		set(debug "debug")
+		set(optimized "optimized")
 	endif()
+
+	set(${LIB_NAME_UPPER}_LIBRARIES ${optimized} ${${LIB_NAME_UPPER}_LIBRARY} ${debug} ${${LIB_NAME_UPPER}_LIBRARY_DEBUG})

 endmacro()

 find(glow ${LIB_PATHS})
 find(utils ${LIB_PATHS})

-if(GLOW_INCLUDE_DIR AND GLOW_LIBRARY)
+if(GLOW_INCLUDE_DIR AND (GLOW_LIBRARY OR GLOW_LIBRARY_DEBUG))
     set(GLOW_FOUND 1 CACHE STRING "Set to 1 if glow is found, 0 otherwise")
 else()
     set(GLOW_FOUND 0 CACHE STRING "Set to 1 if glow is found, 0 otherwise")


Add build_headless flag

Add build_headless flag

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -117,6 +117,8 @@
   ELSE()
     MESSAGE(FATAL_ERROR "QT ${QT_MIN_VERSION} or later is required for building the SCIRun GUI")
   ENDIF()
+ELSE()
+  ADD_DEFINITIONS(-DBUILD_HEADLESS)
 ENDIF()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   28)
+SET(KWSYS_DATE_STAMP_DAY   29)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


added TEMPLATE folder + some small fixes in cache

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -241,7 +241,8 @@
 		"This folder (below prefix) will be used to install cmake files."
     )

-set (TARGET_PLUGIN_FOLDER "elektra"
+set (TARGET_PLUGIN_FOLDER
+		"elektra"
 		CACHE STRING
 		"This folder (below prefix/lib) will be used to install elektra plugins. LIB_SUFFIX is honored."
     )
@@ -258,10 +259,16 @@
 		"The folder (below prefix) where to install api documentation files."
     )

-set (TARGET_TOOLS_EXEC_FOLDER
+set (TARGET_TOOL_EXEC_FOLDER
 		"lib/kdb-tool"
 		CACHE STRING
 		"This folder (below prefix) will be used to install additional kdb-tools"
+    )
+
+set (TARGET_TEMPLATE_FOLDER
+		"share/elektra/templates"
+		CACHE STRING
+		"This folder (below prefix) will be used to install templates for kdb-gen"
     )

 #


build: Clean up the find-module for cryptopp

--- cmake/Findcryptopp.cmake
+++ cmake/Findcryptopp.cmake
@@ -20,36 +20,32 @@
 # Copyright (C) 2018 Scylladb, Ltd.
 #

-find_path (cryptopp_INCLUDE_DIR
-  NAMES cryptopp/aes.h)
-
 find_library (cryptopp_LIBRARY
   NAMES cryptopp)

-if (cryptopp_INCLUDE_DIR AND cryptopp_LIBRARY)
-  set (cryptopp_FOUND ON)
-  set (cryptopp_LIBRARIES ${cryptopp_LIBRARY})
-  set (cryptopp_INCLUDE_DIRS ${cryptopp_INCLUDE_DIR})
-endif ()
+find_path (cryptopp_INCLUDE_DIR
+  NAMES cryptopp/aes.h
+  PATH_SUFFIXES cryptopp)
+
+mark_as_advanced (
+  cryptopp_LIBRARY
+  cryptopp_INCLUDE_DIR)

 include (FindPackageHandleStandardArgs)

 find_package_handle_standard_args (cryptopp
-  FOUND_VAR cryptopp_FOUND
   REQUIRED_VARS
-    cryptopp_INCLUDE_DIR
     cryptopp_LIBRARY
-  VERSION_VAR cryptopp_VERSION)
+    cryptopp_INCLUDE_DIR)
+
+set (cryptopp_LIBRARIES ${cryptopp_LIBRARY})
+set (cryptopp_INCLUDE_DIRS ${cryptopp_INCLUDE_DIR})

 if (cryptopp_FOUND AND NOT (TARGET cryptopp::cryptopp))
   add_library (cryptopp::cryptopp UNKNOWN IMPORTED)

   set_target_properties (cryptopp::cryptopp
     PROPERTIES
-      IMPORTED_LOCATION ${cryptopp_LIBRARY}
+      IMPORTED_LOCATION ${cryptopp_LIBRARIES}
       INTERFACE_INCLUDE_DIRECTORIES ${cryptopp_INCLUDE_DIRS})
 endif ()
-
-mark_as_advanced (
-  cryptopp_INCLUDE_DIR
-  cryptopp_LIBRARY)


Remove stuff from cmake includes.

Remove stuff from cmake includes.

--- cmake/FortranFlags.cmake
+++ cmake/FortranFlags.cmake
@@ -2,7 +2,6 @@

 if(CMAKE_Fortran_COMPILER_ID MATCHES GNU) # this is gfortran
     set(CMAKE_Fortran_FLAGS         "")
-#    set(CMAKE_Fortran_FLAGS         "-pedantic -std=f95 -std=f2003 -std=f2008 -fbacktrace")
     set(CMAKE_Fortran_FLAGS_DEBUG   "-g -O0 -Wall -Wcharacter-truncation")
     set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ffast-math -funroll-loops -ftree-vectorize")
     if(ENABLE_STATIC_LINKING)
@@ -31,11 +30,6 @@
             )
     endif()

-#   radovan: for magnus, this is how you can set compiler flags for one source file only
-#   set_source_files_properties(openrsp/cgto_diff_eri.f90
-#       PROPERTIES COMPILE_FLAGS
-#       "-raboof"
-#       )
 endif()

 if(CMAKE_Fortran_COMPILER_ID MATCHES G95)


r10087/sofa : FIX: boost_chrono dll is now needed by one of the boost library we use (graph, thread or system) in the last version of boost so we copy the dll in the bin dir on Windows

Former-commit-id: 78b047ce012073092c8d5bc1c2eedb7ceb83dbef

--- cmake/dependencies.cmake
+++ cmake/dependencies.cmake
@@ -148,6 +148,11 @@
 			file(COPY ${sharedObject} DESTINATION "${SOFA_BIN_DIR}")
 		endforeach()

+		file(GLOB sharedObjects "${BOOST_LIBDIR}/boost_chrono*.dll")
+		foreach(sharedObject ${sharedObjects})
+			file(COPY ${sharedObject} DESTINATION "${SOFA_BIN_DIR}")
+		endforeach()
+
 		file(GLOB sharedObjects "${BOOST_LIBDIR}/boost_system*.dll")
 		foreach(sharedObject ${sharedObjects})
 			file(COPY ${sharedObject} DESTINATION "${SOFA_BIN_DIR}")


CMake: Added warning about updating VS2013 and CMake pre 3.2 inviwo/inviwo-dev#1123

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -39,14 +39,26 @@
         message(FATAL_ERROR "Inviwo requires C++11 features. "
                 "You need at least Visual Studio 12 (Microsoft Visual Studio 2013)")
     endif()
+
+    if(MSVC_VERSION LESS 1900)
+        message(WARNING "Notice! The next release (0.9.7) will be the last one that will support Visual Studio 2013. "
+            "After 0.9.7 we will require Visual Studio 2015. The switch will happen in the beginning of May. "
+            "The latest Visual Studio version is available at https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx")
+    endif()
+
 else()
     include(CheckCXXCompilerFlag)
     CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
     if(COMPILER_SUPPORTS_CXX11)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
     else()
-        ivw_message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
-    endif()
+        message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+    endif()
+endif()
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "3.2.0")
+    message(WARNING "After release 0.9.7 Inviwo will require a CMake version of at least 3.2.0 "
+        "You have version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
 endif()

 set_property(GLOBAL PROPERTY USE_FOLDERS On)


need RLINK path set to true

need RLINK path set to true

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@215 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_ros.cmake
+++ cmake/pcl_find_ros.cmake
@@ -48,7 +48,7 @@
         SET(CMAKE_INSTALL_RPATH "${CMAKE_SOURCE_DIR}/../../lib64")
         # don't add the automatically determined parts of the RPATH
         # which point to directories outside the build tree to the install RPATH
-        SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+        SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

     endif(USE_ROS)
 endif(ROS_ROOT)


Setting PROJECT_VENDOR on a Gostai bug fix branch is a fatal error.

	* build-aux/cmake/modules/ProjectInfo.cmake: Do that.


MOD: CMAKE - Added .inl files to the projects, formerly they werent added

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -12,7 +12,7 @@
     set (_CURR_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/${_REL_INC_DIR}")

     file (GLOB CORE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.cpp)
-    file (GLOB CORE_HEADER_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${_CURR_INCLUDE_DIR}/*.h")
+    file (GLOB CORE_HEADER_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${_CURR_INCLUDE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}" *.inl)
 endmacro()

 #


FIX IDAS-20500: with a mongo driver installed by default, iotagent doe not compile

--- cmake/FindMongoDB.cmake
+++ cmake/FindMongoDB.cmake
@@ -10,8 +10,9 @@

 find_path(MongoDB_INCLUDE_DIR mongo/client/dbclient.h
                ${IOTAGENT_DEPENDENCIES_PATHS}
-               $ENV{MongoDB_ROOT}/lib
-               ${MongoDB_ROOT}/lib)
+               $ENV{MongoDB_ROOT}/include
+               ${MongoDB_ROOT}/include
+               NO_DEFAULT_PATH)
 if (MONGODB_USE_STATIC_LIBS STREQUAL "ON")
 set(_mongodb_LIB_NAME "libmongoclient.a")
 else()


FIX (#6517): quoting of CXX_FLAGS in superbuild

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -25,12 +25,6 @@
 SET(ep_build_shared_libs ON)
 SET(ep_build_testing OFF)

-SET(ep_common_args
-  -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
-  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-  -DBUILD_TESTING:BOOL=${ep_build_testing}
-  )
-
 # Compute -G arg for configuring external projects with the same CMake generator:
 IF(CMAKE_EXTRA_GENERATOR)
   SET(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
@@ -43,9 +37,20 @@

 ##

+IF(MSVC90 OR MSVC10)
+  SET(ep_common_C_FLAGS "${CMAKE_C_FLAGS} /bigobj /MP")
+  SET(ep_common_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /MP")
+ELSE()
+  SET(ep_common_C_FLAGS "${CMAKE_C_FLAGS} -DLINUX_EXTRA")
+  SET(ep_common_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX_EXTRA")
+ENDIF()
+
 SET(ep_common_args
+  -DBUILD_TESTING:BOOL=${ep_build_testing}
+  -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
   -DBUILD_SHARED_LIBS:BOOL=ON
   -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+  "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS}"
 )

@@ -104,8 +109,8 @@
       CMAKE_ARGS
          ${ep_common_args}
          -DBUILD_SHARED_LIBS:BOOL=OFF
-         -DCMAKE_CXX_FLAGS:STRING=${DCMTK_CXX_FLAGS}
-         -DCMAKE_C_FLAGS:STRING=${DCMTK_CXX_FLAGS}
+         "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} ${DCMTK_CXX_FLAGS}"
+         "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS} ${DCMTK_C_FLAGS}"
          -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/DCMTK-prefix/install
   )

@@ -145,7 +150,6 @@
      CMAKE_GENERATOR ${gen}
      CMAKE_ARGS
        ${ep_common_args}
-       -DBUILD_SHARED_LIBS:BOOL=ON
        -DBUILD_TESTING:BOOL=OFF
        -DBUILD_EXAMPLES:BOOL=OFF
      )


Fixed profiling flags for MSVC.

Fixed profiling flags for MSVC.

The profiler output contained no useful symbols before, because there were no symbols in the PDBs.

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -118,8 +118,8 @@
 macro(enable_profile)
 	# Declare the flags used for profiling builds:
 	if (MSVC)
-		set (CXX_PROFILING "")
-		set (LNK_PROFILING "/PROFILE")
+		set (CXX_PROFILING "/Zi")
+		set (LNK_PROFILING "/PROFILE /DEBUG")
 	else()
 		set (CXX_PROFILING "-pg")
 		set (LNK_PROFILING "-pg")


Enable multi-processor compilation on Windows and DEBUG in RelWithDebInfo

--- common/cmake/msvc.cmake
+++ common/cmake/msvc.cmake
@@ -29,7 +29,10 @@
 ENDIF()
 SET(FLAGS_AVX512 "")

-SET(ADDITIONAL_CXX_FLAGS "/Ox /fp:fast /Qpar /Oi /Gy /GR-")
+SET(ADDITIONAL_CXX_FLAGS "/Ox /fp:fast /Qpar /Oi /Gy /GR- /MP")

+SET(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} /MP")
 SET(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE} ${ADDITIONAL_CXX_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG ${ADDITIONAL_CXX_FLAGS}")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ADDITIONAL_CXX_FLAGS}")
+# remove define NDEBUG and instead set define DEBUG for config RelWithDebInfo
+string (REPLACE "NDEBUG" "DEBUG" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})


only treating definity lost as error in valgrind

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -126,7 +126,7 @@

 IF (EMBREE_TESTING_MEMCHECK)
   find_program( EMBREE_MEMORYCHECK_COMMAND valgrind )
-  set( EMBREE_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-possibly-lost=no --error-exitcode=1" )
+  set( EMBREE_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite --error-exitcode=1" )

   FUNCTION(ADD_MEMCHECK_TEST name binary)
     set(memcheck_command "${EMBREE_MEMORYCHECK_COMMAND} ${EMBREE_MEMORYCHECK_COMMAND_OPTIONS}")


npm: remove imraa option from Node module

Signed-off-by: Thomas Ingleby <bb80a585db4bdbe09547a7483d1a31841fd0e0e8@intel.com>

--- src/javascript/binding.gyp.cmake
+++ src/javascript/binding.gyp.cmake
@@ -28,7 +28,6 @@
       ],
       'defines' : [ 'SWIG',
                     'SWIGJAVASCRIPT',
-                    'IMRAA=ON',
                     'FIRMATA=ON',
                     'BUILDING_NODE_EXTENSION=1',
                     'SWIG_V8_VERSION=0x0<(v8_version)',


updated Gadgetron and ISMRMRD tags

updated Gadgetron and ISMRMRD tags


Force nsync to be compiled with g++-5 in shared version

The compilation fails with g++-8.1.0 currently in Arch.


Get ClangdXPC.framework building (barely) with CMake's Xcode generator

The output directories for CMake's Xcode project generator are
specific to the configuration, and so looking in
CMAKE_LIBRARY_OUTPUT_DIRECTORY isn't going to work. Fortunately, CMake
already provides generator expressions to find the output of a given
target.

I call this "barely" building because the built framework isn't going
to respect the configuration; that is, I can't have both Debug and
RelWithDebInfo variants of ClangdXPC.framework at the same time like I
can with normal library or executable targets. To do that we'd have to
put the framework in a configuration-specific output directory or use
CMake's native support for frameworks instead.

https://reviews.llvm.org/D68846

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@374494 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
+++ clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
@@ -28,7 +28,7 @@

     # Copy the framework binary.
     COMMAND ${CMAKE_COMMAND} -E copy
-       "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${target}.dylib"
+       "$<TARGET_FILE:${target}>"
        "${CLANGD_FRAMEWORK_OUT_LOCATION}/${name}"

     # Copy the XPC Service PLIST.
@@ -38,7 +38,7 @@

     # Copy the Clangd binary.
     COMMAND ${CMAKE_COMMAND} -E copy
-      "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/clangd"
+      "$<TARGET_FILE:clangd>"
       "${CLANGD_XPC_SERVICE_OUT_LOCATION}/MacOS/clangd"

      COMMAND ${CMAKE_COMMAND} -E create_symlink "A"


STYLE: Install Trafic py libs to directory Trafic

--- AutoTract.cmake
+++ AutoTract.cmake
@@ -78,7 +78,7 @@

   if(Trafic_PY_DIR)
     install(DIRECTORY ${Trafic_PY_DIR}
-      DESTINATION ${INSTALL_RUNTIME_DESTINATION}
+      DESTINATION ${INSTALL_RUNTIME_DESTINATION}/Trafic
       COMPONENT RUNTIME)
   endif()


Only attempt to find SDLmain on windows. It shouldnt be required on any other platforms.

--- cmake-scripts/FindSDL2.cmake
+++ cmake-scripts/FindSDL2.cmake
@@ -19,12 +19,16 @@
     PATHS ${SDL2_SEARCH_PATHS}
 )

-FIND_LIBRARY(SDL2MAIN_LIBRARY
-    NAMES SDL2main
-    HINTS
-    PATH_SUFFIXES lib64 lib
-    PATHS ${SDL2_SEARCH_PATHS}
-)
+IF(MINGW)
+    FIND_LIBRARY(SDL2MAIN_LIBRARY
+        NAMES SDL2main
+        HINTS
+        PATH_SUFFIXES lib64 lib
+        PATHS ${SDL2_SEARCH_PATHS}
+    )
+ELSE()
+    SET(SDL2MAIN_LIBRARY "")
+ENDIF()

 IF(SDL2_INCLUDE_DIR AND SDL2_LIBRARY)
    SET(SDL2_FOUND TRUE)


added dummy flag file for gettext, to keep the .po files from cleaning

--- cmake/GettextTranslate.cmake
+++ cmake/GettextTranslate.cmake
@@ -192,11 +192,12 @@

     else()

-      add_custom_command(OUTPUT ${PO_FILE_NAME}
+      add_custom_command(OUTPUT ${PO_FILE_NAME}.flag
         COMMAND ${MSGMERGE_BINARY} --lang=${lang}
           ${PO_FILE_NAME} ${TEMPLATE_FILE_ABS}
           -o ${PO_FILE_NAME}.new
         COMMAND mv ${PO_FILE_NAME}.new ${PO_FILE_NAME}
+        COMMAND touch ${PO_FILE_NAME}.flag
         DEPENDS ${TEMPLATE_FILE_ABS}
       )


Link Swift images on ELF using -Bsymbolic.

We don't want references to local symbols within an image to be relocatable, since this increases startup time and causes problems with relative references.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -173,9 +173,9 @@
       result)

   if("${sdk}" STREQUAL "LINUX")
-    list(APPEND result "-lpthread" "-ldl")
+    list(APPEND result "-lpthread" "-ldl" "-Wl,-Bsymbolic")
   elseif("${sdk}" STREQUAL "FREEBSD")
-    list(APPEND result "-lpthread")
+    list(APPEND result "-lpthread" "-Wl,-Bsymbolic")
   else()
     list(APPEND result "-lobjc")
   endif()