COFFEE
Check-in [166f578d6c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:166f578d6cf8d3601af0d4184de3524a471e86c8
Date: 2009-03-31 12:28:11
User: trevord
Comment:Set policy CMP0005 to NEW; this is required for the resolution to CMake bug #8779, and is the right way to do things in CMake 2.6.

Use set_property( ... COMPILE_DEFINITIONS ... ) rather than add_definitions. Again related to the above bug, this helps to prevent the bug from being obscured by the legacy behaviour of add_definitions().

Added prototype support for building the Tcl DLL and a dynamic tclsh linked against the DLL.

Tags And Properties
Changes
hide diffs side-by-side diffs patch

Changes to CMakeLists.txt

1 -# Build file for Tcl 8.6b1 (tclsh static on win32) 1 +# Build file for Tcl 8.6b1 (tclsh static & dynamic on win32) 2 2 3 3 cmake_minimum_required (VERSION 2.6) 4 +cmake_policy( SET CMP0005 NEW ) 4 5 5 6 project (tclsh C) 6 7 7 8 set( generic_src 8 9 generic/regcomp.c 9 10 generic/regerror.c 10 11 generic/regexec.c ................................................................................ 184 185 185 186 source_group( "Generic Files" FILES ${generic_src} ) 186 187 source_group( "LibTomMath Files" FILES ${libtom_src} ) 187 188 source_group( "ZLib Files" FILES ${zlib_src} ) 188 189 source_group( "Win32 Files" FILES ${win32_src} ) 189 190 190 191 include_directories ( generic win libtommath compat/zlib ) 191 - 192 -add_definitions( -DSTATIC_BUILD ) 193 -add_definitions( -DBUILD_tcl -DTCL_CFG_OPTIMIZED ) 194 -add_definitions( -DTCL_CFGVAL_ENCODING=\"cp1252\" ) 195 -add_definitions( -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 ) 196 -add_definitions( -DTCL_TOMMATH -DMP_PREC=4 ) 197 -add_definitions( -DHAVE_ZLIB=1 ) 198 -add_definitions( -Dinline=__inline ) 199 -add_definitions( -DTCL_PIPE_DLL=\"tclpip86.dll\" ) 200 - 201 -# For tclPkgConfig 202 -# FIXME replace with set_source_files_properties( generic/tclPkgConfig.c PROPERTIES COMPILE_FLAGS "..." ) 203 -add_definitions( -DCFG_RUNTIME_LIBDIR=\"c:/tcl/tcl8.6b1/library\" ) 204 -add_definitions( -DCFG_RUNTIME_LIBDIR=\"c:/tcl/tcl8.6b1/library\" ) 205 -add_definitions( -DCFG_RUNTIME_BINDIR=\"c:/tcl/tcl8.6b1/build\" ) 206 -add_definitions( -DCFG_RUNTIME_SCRDIR=\"dir\" ) 207 -add_definitions( -DCFG_RUNTIME_INCDIR=\"dir\" ) 208 -add_definitions( -DCFG_RUNTIME_DOCDIR=\"dir\" ) 209 -add_definitions( -DCFG_INSTALL_LIBDIR=\"c:/tcl/tcl8.6b1/library\" ) 210 -add_definitions( -DCFG_INSTALL_BINDIR=\"c:/tcl/tcl8.6b1/build\" ) 211 -add_definitions( -DCFG_INSTALL_SCRDIR=\"dir\" ) 212 -add_definitions( -DCFG_INSTALL_INCDIR=\"dir\" ) 213 -add_definitions( -DCFG_INSTALL_DOCDIR=\"dir\" ) 214 - 215 192 216 193 add_executable( tclsh ${generic_src} ${win32_src} ${libtom_src} ${zlib_src} 217 194 win/tclAppInit.c win/tclsh.rc ) 218 195 196 +add_library( tcl86 SHARED ${generic_src} ${win32_src} ${libtom_src} ${zlib_src} ) 197 +add_executable( tclshdyn win/tclAppInit.c ) 198 +target_link_libraries( tclshdyn tcl86 ) 199 + 200 + 201 +set_property( TARGET tclsh tcl86 PROPERTY COMPILE_DEFINITIONS 202 + BUILD_tcl 203 + TCL_CFG_OPTIMIZED 204 + TCL_CFGVAL_ENCODING="cp1252" 205 + TCL_THREADS=1 206 + USE_THREAD_ALLOC=1 207 + TCL_TOMMATH 208 + MP_PREC=4 209 + HAVE_ZLIB=1 210 + inline=__inline 211 + TCL_PIPE_DLL="tclpip86.dll" 212 + 213 + CFG_RUNTIME_LIBDIR="c:/tcl/tcl8.6b1/library" 214 + CFG_RUNTIME_LIBDIR="c:/tcl/tcl8.6b1/library" 215 + CFG_RUNTIME_BINDIR="c:/tcl/tcl8.6b1/build" 216 + CFG_RUNTIME_SCRDIR="dir" 217 + CFG_RUNTIME_INCDIR="dir" 218 + CFG_RUNTIME_DOCDIR="dir" 219 + CFG_INSTALL_LIBDIR="c:/tcl/tcl8.6b1/library" 220 + CFG_INSTALL_BINDIR="c:/tcl/tcl8.6b1/build" 221 + CFG_INSTALL_SCRDIR="dir" 222 + CFG_INSTALL_INCDIR="dir" 223 + CFG_INSTALL_DOCDIR="dir" 224 +) 225 + 226 +set_property( TARGET tclsh APPEND PROPERTY COMPILE_DEFINITIONS 227 + STATIC_BUILD 228 +) 229 + 230 + 231 +# Notes: 232 +# set_source_files_properties ( generic/tclPkgConfig.c PROPERTIES COMPILE_FLAGS ... ) 233 +# set_property( TARGET bug PROPERTY COMPILE_DEFINITIONS PATH="c:\\\\program files\\\\my app\\\\resources" ) 219 234 220 235 # Build settings used by 'nmake /f makefile.vc OPTS=threads,static' 221 236 # ... imported into this build file 222 237 # -DTCL_PIPE_DLL=\"tclpip86.dll\" 223 238 # -DTCL_CFGVAL_ENCODING=\"cp1252\" 224 239 # -DTCL_CFG_OPTIMIZED 225 240 # -DBUILD_tcl