Revision: 75918
          http://sourceforge.net/p/brlcad/code/75918
Author:   starseeker
Date:     2020-05-25 16:47:10 +0000 (Mon, 25 May 2020)
Log Message:
-----------
re-enable licenses check

Modified Paths:
--------------
    brlcad/branches/bioh/regress/CMakeLists.txt
    brlcad/branches/bioh/regress/licenses/CMakeLists.txt

Added Paths:
-----------
    brlcad/branches/bioh/regress/licenses/regress-licenses.cmake.in

Removed Paths:
-------------
    brlcad/branches/bioh/regress/licenses/regress-licenses.cmake

Modified: brlcad/branches/bioh/regress/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/regress/CMakeLists.txt 2020-05-25 16:28:25 UTC (rev 
75917)
+++ brlcad/branches/bioh/regress/CMakeLists.txt 2020-05-25 16:47:10 UTC (rev 
75918)
@@ -46,7 +46,7 @@
 add_subdirectory(gchecker)
 
 # License check
-#add_subdirectory(licenses)
+add_subdirectory(licenses)
 
 # Repository check
 #add_subdirectory(repository)

Modified: brlcad/branches/bioh/regress/licenses/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/regress/licenses/CMakeLists.txt        2020-05-25 
16:28:25 UTC (rev 75917)
+++ brlcad/branches/bioh/regress/licenses/CMakeLists.txt        2020-05-25 
16:47:10 UTC (rev 75918)
@@ -3,7 +3,8 @@
   ${BRLCAD_SOURCE_DIR}/include
   )
 
-add_executable(lcheck licenses_check.cpp)
+# Build a scanner to read license information and introspect the source tree
+BRLCAD_ADDEXEC(lcheck licenses_check.cpp "" TEST)
 if (O3_COMPILER_FLAG)
   # This check benefits greatly from optimization. If we have the O3 flag, use
   # it - whether or not the standard build settings would add it.
@@ -21,27 +22,16 @@
 endforeach(lfile ${ELEGAL})
 DISTCLEAN("${LICENSE_LIST}")
 
+# Define the actual regression test
 set(ALL_FILES_LIST "${BRLCAD_BINARY_DIR}/cmakefiles.cmake")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/regress-licenses.log")
+BRLCAD_REGRESSION_TEST(regress-licenses "lcheck" EXEC lcheck)
+DISTCLEAN(${LOG_FILE})
 
-add_test(NAME regress-licenses
-  COMMAND "${CMAKE_COMMAND}"
-           -DLCHECK_EXEC=$<TARGET_FILE:lcheck> 
-DBRLCAD_SOURCE_DIR=${BRLCAD_SOURCE_DIR}
-          -DL_LIST=${LICENSE_LIST} -DF_LIST=${ALL_FILES_LIST}
-           -P "${CMAKE_CURRENT_SOURCE_DIR}/regress-licenses.cmake"
-  )
-
-if (CMAKE_CONFIGURATION_TYPES)
-  add_custom_target(regress-licenses COMMAND ${CMAKE_CTEST_COMMAND} -C 
${CMAKE_CFG_INTDIR} -R ^regress-licenses --output-on-failure)
-else (CMAKE_CONFIGURATION_TYPES)
-  add_custom_target(regress-licenses COMMAND ${CMAKE_CTEST_COMMAND} -R 
^regress-licenses --output-on-failure)
-endif (CMAKE_CONFIGURATION_TYPES)
-
-Add_Regression_Test(licenses "lcheck")
-
 CMAKEFILES(
   CMakeLists.txt
   licenses_check.cpp
-  regress-licenses.cmake
+  regress-licenses.cmake.in
   )
 
 # Local Variables:

Deleted: brlcad/branches/bioh/regress/licenses/regress-licenses.cmake
===================================================================
--- brlcad/branches/bioh/regress/licenses/regress-licenses.cmake        
2020-05-25 16:28:25 UTC (rev 75917)
+++ brlcad/branches/bioh/regress/licenses/regress-licenses.cmake        
2020-05-25 16:47:10 UTC (rev 75918)
@@ -1,24 +0,0 @@
-string(REPLACE "\\" "" LICENSE_CHECK_EXEC "${LCHECK_EXEC}")
-string(REPLACE "\\" "" FILES_LIST "${F_LIST}")
-string(REPLACE "\\" "" LICENSE_FILE_SET "${L_LIST}")
-string(REPLACE "\\" "" B_SOURCE_DIR "${BRLCAD_SOURCE_DIR}")
-
-message("Running license check:\n${LICENSE_CHECK_EXEC} ${LICENSE_FILE_SET} 
${FILES_LIST}\n")
-message("Processing...")
-execute_process(
-  COMMAND "${LICENSE_CHECK_EXEC}" "${LICENSE_FILE_SET}" "${FILES_LIST}" 
"${B_SOURCE_DIR}" RESULT_VARIABLE license_result
-  OUTPUT_VARIABLE license_log ERROR_VARIABLE license_log
-  )
-message("Processing... done.")
-
-if(license_result)
-  message("${license_log}\n")
-  message(FATAL_ERROR "[license check] failed.\n")
-endif(license_result)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8

Copied: brlcad/branches/bioh/regress/licenses/regress-licenses.cmake.in (from 
rev 75917, brlcad/branches/bioh/regress/licenses/regress-licenses.cmake)
===================================================================
--- brlcad/branches/bioh/regress/licenses/regress-licenses.cmake.in             
                (rev 0)
+++ brlcad/branches/bioh/regress/licenses/regress-licenses.cmake.in     
2020-05-25 16:47:10 UTC (rev 75918)
@@ -0,0 +1,23 @@
+string(REPLACE "\\" "" LICENSE_CHECK_EXEC "${EXEC}")
+set(FILES_LIST "@ALL_FILES_LIST@")
+set(LICENSE_FILE_SET "@LICENSE_LIST@")
+set(B_SOURCE_DIR "@BRLCAD_SOURCE_DIR@")
+set(LOGFILE "@LOG_FILE@")
+
+file(WRITE ${LOGFILE} "Running license check:\n${LICENSE_CHECK_EXEC} 
${LICENSE_FILE_SET} ${FILES_LIST} ${B_SOURCE_DIR}\n")
+execute_process(
+  COMMAND "${LICENSE_CHECK_EXEC}" "${LICENSE_FILE_SET}" "${FILES_LIST}" 
"${B_SOURCE_DIR}"
+  RESULT_VARIABLE license_result OUTPUT_VARIABLE license_log ERROR_VARIABLE 
license_log
+  )
+
+if(license_result)
+  file(APPEND ${LOGFILE} "${license_log}\n")
+  message(FATAL_ERROR "[license check] Failure: ${license_result}\n")
+endif(license_result)
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to