Revision: 75905
http://sourceforge.net/p/brlcad/code/75905
Author: starseeker
Date: 2020-05-24 00:43:15 +0000 (Sun, 24 May 2020)
Log Message:
-----------
cleanup, organize
Modified Paths:
--------------
brlcad/trunk/misc/CMake/FindTCL.cmake
brlcad/trunk/src/other/CMakeLists.txt
Modified: brlcad/trunk/misc/CMake/FindTCL.cmake
===================================================================
--- brlcad/trunk/misc/CMake/FindTCL.cmake 2020-05-23 21:50:45 UTC (rev
75904)
+++ brlcad/trunk/misc/CMake/FindTCL.cmake 2020-05-24 00:43:15 UTC (rev
75905)
@@ -275,9 +275,9 @@
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
-# IFF we have TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that the
+# IFF we have TCL_TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that
the
# windowing system matches the specified type
-if (NOT "${TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET
"${TK_WISH}")
+if (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET
"${TK_WISH}")
set(tkwin_script "
set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM\"
set fileId [open $filename \"w\"]
@@ -297,7 +297,7 @@
# If we have no information about the windowing system or it does not
match
# a specified system, the find_package detection has failed
- if (NOT "${WSYS}" STREQUAL "${TK_SYSTEM_GRAPHICS}")
+ if (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
unset(TCL_LIBRARY CACHE)
unset(TCL_STUB_LIBRARY CACHE)
unset(TK_LIBRARY CACHE)
@@ -315,8 +315,8 @@
unset(TCL_STUB_LIBRARY CACHE)
unset(TK_STUB_LIBRARY CACHE)
unset(TTK_STUB_LIBRARY CACHE)
- endif (NOT "${WSYS}" STREQUAL "${TK_SYSTEM_GRAPHICS}")
-endif (NOT "${TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET
"${TK_WISH}")
+ endif (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
+endif (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET
"${TK_WISH}")
include(FindPackageHandleStandardArgs)
Modified: brlcad/trunk/src/other/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/other/CMakeLists.txt 2020-05-23 21:50:45 UTC (rev
75904)
+++ brlcad/trunk/src/other/CMakeLists.txt 2020-05-24 00:43:15 UTC (rev
75905)
@@ -308,31 +308,40 @@
# Tcl/Tk and related extensions
####################################################################
+function(TCL_RESET_VARS)
+ unset(TCL_LIBRARY CACHE)
+ unset(TCL_STUB_LIBRARY CACHE)
+ unset(TCL_FOUND CACHE)
+ unset(TCLSH_FOUND CACHE)
+ unset(TCL_LIBRARY CACHE)
+ unset(TCL_INCLUDE_PATH CACHE)
+ unset(TCL_TCLSH CACHE)
+ unset(TCL_STUB_LIBRARY CACHE)
+endfunction(TCL_RESET_VARS)
+
+function(TK_RESET_VARS)
+ unset(TK_LIBRARY CACHE)
+ unset(TK_STUB_LIBRARY CACHE)
+ unset(TK_FOUND CACHE)
+ unset(TCLTK_FOUND CACHE)
+ unset(TK_LIBRARY CACHE)
+ unset(TK_INCLUDE_PATH CACHE)
+ unset(TK_WISH CACHE)
+ unset(TK_STUB_LIBRARY CACHE)
+ unset(TTK_STUB_LIBRARY CACHE)
+endfunction(TK_RESET_VARS)
+
+
# Set the expected graphics system (if known) before any find_package
# calls related to Tcl
if(BRLCAD_ENABLE_AQUA)
set(TK_ENABLE_AQUA ON CACHE STRING "BRL-CAD setting to enable AQUA" FORCE)
- set(TK_SYSTEM_GRAPHICS "aqua" CACHE STRING "Tk system graphics type" FORCE)
+ set(TCL_TK_SYSTEM_GRAPHICS "aqua" CACHE STRING "Tk system graphics type"
FORCE)
endif(BRLCAD_ENABLE_AQUA)
# Make sure we actually look for these each time...
-unset(TCL_LIBRARY CACHE)
-unset(TCL_STUB_LIBRARY CACHE)
-unset(TK_LIBRARY CACHE)
-unset(TK_STUB_LIBRARY CACHE)
-unset(TCL_FOUND CACHE)
-unset(TK_FOUND CACHE)
-unset(TCLTK_FOUND CACHE)
-unset(TCLSH_FOUND CACHE)
-unset(TCL_LIBRARY CACHE)
-unset(TCL_INCLUDE_PATH CACHE)
-unset(TCL_TCLSH CACHE)
-unset(TK_LIBRARY CACHE)
-unset(TK_INCLUDE_PATH CACHE)
-unset(TK_WISH CACHE)
-unset(TCL_STUB_LIBRARY CACHE)
-unset(TK_STUB_LIBRARY CACHE)
-unset(TTK_STUB_LIBRARY CACHE)
+TCL_RESET_VARS()
+TK_RESET_VARS()
set(tcl_DESCRIPTION "
Option for enabling and disabling compilation of the Tcl library
@@ -393,7 +402,7 @@
")
set(inittcl_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tcl_inittcl.tcl")
file(WRITE ${inittcl_scriptfile} ${inittcl_script})
- exec_program(${TCL_TCLSH} ARGS ${inittcl_scriptfile} OUTPUT_VARIABLE
EXECOUTPUT)
+ execute_process(COMMAND ${TCL_TCLSH} ${inittcl_scriptfile} OUTPUT_VARIABLE
EXECOUTPUT)
file(READ "${CMAKE_BINARY_DIR}/CMakeTmp/tcl_inittcl" tcl_inittcl_raw)
string(REGEX REPLACE "\n" "" tcl_inittcl_paths_1 ${tcl_inittcl_raw})
string(REGEX REPLACE " " ";" tcl_inittcl_paths ${tcl_inittcl_paths_1})
@@ -471,15 +480,13 @@
set(HAVE_TK_H 1)
# Packages probably still need to know the system graphics package
- if (NOT WIN32)
- if (APPLE AND TK_ENABLE_AQUA)
- set(TK_SYSTEM_GRAPHICS aqua)
- else ()
- set(TK_SYSTEM_GRAPHICS x11)
- endif (APPLE AND TK_ENABLE_AQUA)
- else (NOT WIN32)
+ if (BRLCAD_ENABLE_AQUA)
+ set(TK_SYSTEM_GRAPHICS aqua)
+ elseif (BRLCAD_ENABLE_X11)
+ set(TK_SYSTEM_GRAPHICS x11)
+ elseif (WIN32)
set(TK_SYSTEM_GRAPHICS win32)
- endif (NOT WIN32)
+ endif ()
set(TK_SYSTEM_GRAPHICS "${TK_SYSTEM_GRAPHICS}" CACHE STRING "Tk system
graphics type" FORCE)
else(BRLCAD_TK_BUILD)
@@ -487,11 +494,8 @@
# If we're not using Tk, make sure the variables are empty - CMake won't be
# happy if they're set to NOTFOUND and used, and FindTCL.cmake may have set
# them.
- set(TK_LIBRARY "" CACHE STRING "TK_LIBRARY" FORCE)
- set(TK_STUB_LIBRARY "" CACHE STRING "TK_LIBRARY" FORCE)
- set(TK_WISH "" CACHE STRING "TK_WISH" FORCE)
- set(TK_INCLUDE_PATH "" CACHE STRING "Tk include path" FORCE)
- set(TK_SYSTEM_GRAPHICS "" CACHE STRING "Tk system graphics type" FORCE)
+ TK_RESET_VARS()
+ unset(TK_SYSTEM_GRAPHICS CACHE)
endif(BRLCAD_TK_BUILD)
mark_as_advanced(TK_INCLUDE_PATH)
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