Revision: 42156
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42156&view=rev
Author:   starseeker
Date:     2011-01-12 18:34:55 +0000 (Wed, 12 Jan 2011)

Log Message:
-----------
Start the process of taking things out of -D defines and putting them in config 
headers.

Modified Paths:
--------------
    brlcad/branches/cmake/src/other/tcl/CMakeLists.txt
    brlcad/branches/cmake/src/other/tcl/generic/tclPkgConfig.c
    brlcad/branches/cmake/src/other/tcl/unix/tclUnixInit.c
    brlcad/branches/cmake/src/other/tcl/win/tclWinInit.c

Modified: brlcad/branches/cmake/src/other/tcl/CMakeLists.txt
===================================================================
--- brlcad/branches/cmake/src/other/tcl/CMakeLists.txt  2011-01-12 18:28:14 UTC 
(rev 42155)
+++ brlcad/branches/cmake/src/other/tcl/CMakeLists.txt  2011-01-12 18:34:55 UTC 
(rev 42156)
@@ -118,29 +118,29 @@
 INCLUDE(${TCL_SOURCE_DIR}/CMake/tcl.cmake)
 
 #----------------------------------------------------------------------------
+# CMake + Visual Studio doesn't like -D options with spaces, so anything that
+# needs a space will have to be passed via config header.
+SET(TCL_CFG_H_FILE "${TCL_BINARY_DIR}/include/tcl_cfg.h")
+FILE(WRITE ${TCL_CFG_H_FILE} "/**** Variables for Tcl build - replaces -D 
options ****/\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define PACKAGE_NAME \"tcl\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define PACKAGE_TARNAME \"tcl\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define PACKAGE_VERSION 
\"${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define PACKAGE_STRING \"tcl 
${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define TCL_PACKAGE_PATH 
\"${CMAKE_INSTALL_PREFIX}/lib\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define TCL_LIBRARY 
\"${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_INSTALL_LIBDIR 
\"${CMAKE_INSTALL_PREFIX}/lib\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_INSTALL_BINDIR 
\"${CMAKE_INSTALL_PREFIX}/bin\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_INSTALL_SCRDIR 
\"${CMAKE_INSTALL_PREFIX}/scripts\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_INSTALL_INCDIR 
\"${CMAKE_INSTALL_PREFIX}/include\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_INSTALL_DOCDIR 
\"${CMAKE_INSTALL_PREFIX}/share/man\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_RUNTIME_LIBDIR 
\"${CMAKE_INSTALL_PREFIX}/lib\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_RUNTIME_BINDIR 
\"${CMAKE_INSTALL_PREFIX}/bin\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_RUNTIME_SCRDIR 
\"${CMAKE_INSTALL_PREFIX}/scripts\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_RUNTIME_INCDIR 
\"${CMAKE_INSTALL_PREFIX}/include\"\n")
+FILE(APPEND ${TCL_CFG_H_FILE} "#define CFG_RUNTIME_DOCDIR 
\"${CMAKE_INSTALL_PREFIX}/share/man\"\n")
+
 # First, get some standard options out of the way - things that are constant
 # between various platforms or pertain to specific OS definitions
-SET(TCL_CFLAGS "${TCL_CFLAGS} -DPACKAGE_NAME=\\\"tcl\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} -DPACKAGE_TARNAME=\\\"tcl\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DPACKAGE_VERSION=\\\"${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} -DPACKAGE_BUGREPORT=\\\"\\\"")
-# FIXME - Figure out why Visual Studio isn't liking the space in -D 
definitions.  This isn't
-# urgent, as the Tcl Windows build logic doesn't seem to define most of these 
either
-IF(NOT WIN32)
-       SET(TCL_CFLAGS "${TCL_CFLAGS} -DPACKAGE_STRING=\\\"tcl\\ 
${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}\\\"")
-ENDIF(NOT WIN32)
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_INSTALL_LIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/lib\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_INSTALL_BINDIR=\\\"${CMAKE_INSTALL_PREFIX}/bin\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_INSTALL_SCRDIR=\\\"${CMAKE_INSTALL_PREFIX}/scripts\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_INSTALL_INCDIR=\\\"${CMAKE_INSTALL_PREFIX}/include\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_INSTALL_DOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/share/man\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_RUNTIME_LIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/lib\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_RUNTIME_BINDIR=\\\"${CMAKE_INSTALL_PREFIX}/bin\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_RUNTIME_SCRDIR=\\\"${CMAKE_INSTALL_PREFIX}/scripts\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_RUNTIME_INCDIR=\\\"${CMAKE_INSTALL_PREFIX}/include\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DCFG_RUNTIME_DOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/share/man\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DTCL_LIBRARY=\\\"${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}\\\"")
-SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DTCL_PACKAGE_PATH=\\\"${CMAKE_INSTALL_PREFIX}/lib\\\"")
 SET(TCL_CFLAGS "${TCL_CFLAGS} -DSTDC_HEADERS=1")
 SET(TCL_CFLAGS "${TCL_CFLAGS} 
-DTCL_SHLIB_EXT=\\\"${CMAKE_SHARED_LIBRARY_SUFFIX}\\\"")
 
@@ -711,7 +711,6 @@
        SET(TCLSH_SRCS unix/tclAppInit.c)
 ENDIF(WIN32)
 
-MESSAGE("TCL_CFLAGS: ${TCL_CFLAGS}")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TCL_CFLAGS}")
 
 add_library(tcl ${TCL_SRCS})

Modified: brlcad/branches/cmake/src/other/tcl/generic/tclPkgConfig.c
===================================================================
--- brlcad/branches/cmake/src/other/tcl/generic/tclPkgConfig.c  2011-01-12 
18:28:14 UTC (rev 42155)
+++ brlcad/branches/cmake/src/other/tcl/generic/tclPkgConfig.c  2011-01-12 
18:34:55 UTC (rev 42156)
@@ -36,6 +36,7 @@
  */
 
 #include "tclInt.h"
+#include "tcl_cfg.h"
 
 /*
  * Use C preprocessor statements to define the various values for the embedded

Modified: brlcad/branches/cmake/src/other/tcl/unix/tclUnixInit.c
===================================================================
--- brlcad/branches/cmake/src/other/tcl/unix/tclUnixInit.c      2011-01-12 
18:28:14 UTC (rev 42155)
+++ brlcad/branches/cmake/src/other/tcl/unix/tclUnixInit.c      2011-01-12 
18:34:55 UTC (rev 42156)
@@ -11,6 +11,7 @@
  */
 
 #include "tclInt.h"
+#include "tcl_cfg.h"
 #include <stddef.h>
 #include <locale.h>
 #ifdef HAVE_LANGINFO

Modified: brlcad/branches/cmake/src/other/tcl/win/tclWinInit.c
===================================================================
--- brlcad/branches/cmake/src/other/tcl/win/tclWinInit.c        2011-01-12 
18:28:14 UTC (rev 42155)
+++ brlcad/branches/cmake/src/other/tcl/win/tclWinInit.c        2011-01-12 
18:34:55 UTC (rev 42156)
@@ -14,6 +14,7 @@
  */
 
 #include "tclWinInt.h"
+#include "tcl_cfg.h"
 #include <winnt.h>
 #include <winbase.h>
 #include <lmcons.h>


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

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to