{tcl,tcloo,tk,tdbc}Config.sh; README
- Now upon install the usual config shell scripts are provided to the system; however the {TCL,TK,TDBC}_SRC variables are not filled properly since we don't actually have source directories like that anymore - Added a README.md to provide information about what this project is trying to achieve
This commit is contained in:
parent
76f4f56917
commit
758ab689ea
|
@ -25,11 +25,12 @@ cmake_minimum_required(VERSION 3.16)
|
|||
enable_language(C)
|
||||
|
||||
## Policies ##
|
||||
cmake_policy(SET CMP0009 NEW) # Do not follow symlinks in GLOB_RECURSE
|
||||
cmake_policy(SET CMP0048 NEW) # project sets VERSION vars
|
||||
cmake_policy(SET CMP0070 NEW) # file(GENERATE) handles relative paths correctly
|
||||
cmake_policy(SET CMP0083 NEW) # PIE
|
||||
cmake_policy(SET CMP0091 NEW) # MSVC does not set the runtime library in CMAKE_<LANG>_FLAGS
|
||||
cmake_policy(SET CMP0092 NEW) # MSVC does not set the default /W3 in CMAKE_<LANG>_FLAGS
|
||||
cmake_policy(SET CMP0009 NEW) # Do not follow symlinks in GLOB_RECURSE
|
||||
|
||||
## Modules #####################################################################
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
@ -58,6 +59,19 @@ cmake_pop_check_state()
|
|||
if (HAVE_M)
|
||||
# if libm exist we want to link it to everything
|
||||
link_libraries(m)
|
||||
set(TCL_LIBS m CACHE INTERNAL "")
|
||||
endif ()
|
||||
|
||||
# These are for the {tcl,tk,tdbc}Config.sh files
|
||||
if (MSVC)
|
||||
set(TCL_LD "link -dll -nologo $<$<CONFIG:Release>:-release> $<$<CONFIG:Release>:-ltcg>" CACHE INTERNAL "")
|
||||
set(TCL_AR "lib -nologo" CACHE INTERNAL "")
|
||||
else ()
|
||||
# If not MSVC we assume UNIX compatible ar cr and cc -shared
|
||||
get_filename_component(CC_NAME "${CMAKE_C_COMPILER}" NAME CACHE)
|
||||
get_filename_component(AR_NAME "${CMAKE_AR}" NAME CACHE)
|
||||
set(TCL_LD "${CC_NAME} -shared")
|
||||
set(TCL_AR "${AR_NAME} cr")
|
||||
endif ()
|
||||
|
||||
## Options #####################################################################
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
# TclTk
|
||||
|
||||
### Disclaimer
|
||||
|
||||
This Tcl distribution, if you can call it that, does not provide all the build functionality that the original Tcl
|
||||
source distributions do: I see no chance of building Tcl on Ultrix, IRIX, AIX, OSF/1, VMS*, and other archaic/exotic
|
||||
systems by using this project. (Even if the required system checks would be done correctly, whether CMake itself builds
|
||||
on said platforms is most probably the tightest bottleneck.)
|
||||
|
||||
*: I do not know if Tcl by default builds on VMS or not. I know Perl5 does, so I guess Tcl does too?
|
||||
|
||||
## TclTk
|
||||
|
||||
This repository provides a CMake project for building Tcl (including core packages) and Tk.
|
||||
|
||||
Tcl/Tk is used by the optional GUI [DieShell/dsh](https://github.com/DieShell/dsh) provides and this project was born to
|
||||
ease creating the installer for DieShell, by providing a homogenous CMake build environment for all DieShell and Tcl.
|
||||
|
||||
C and corresponding header sources are only minimally modified where include paths do not work properly with the
|
||||
original relative include paths.
|
||||
|
||||
All AutoTools related build files are removed, with a few literally useless files which contain nothing;
|
||||
Tcl's `threadUnix.c` file for example. (If I learn how to, I will send a patch about this latter change back to the Tcl
|
||||
people.)
|
||||
|
||||
## CMake Targets
|
||||
|
||||
For use in other CMake projects, the following targets are defined for `target_link_libraries`.
|
||||
|
||||
- `tcl` The Tcl shared library
|
||||
- `tclstub` The Tcl stub library
|
||||
- `tk` The Tk shared library
|
||||
- `tkstub` The Tk stub library
|
||||
|
||||
The `tclsh`, and `wish` executable targets may be used for custom commands that wish to rely on a fresh-baked Tcl
|
||||
interpreter.
|
||||
|
||||
## License and copyright
|
||||
|
||||
Copyright (c) 2021, András Bodor <bodand@pm.me>
|
||||
|
||||
CMake files and other related new sources are licensed under the zlib license.
|
||||
|
||||
Copyright (c) Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation and other parties
|
||||
|
||||
Tcl sources and binaries are licensed under the Tcl license available in whichever `license.terms` file in the
|
||||
repository.
|
|
@ -146,11 +146,35 @@ set_source_files_properties(lib/unix_backend/src/tclUnixInit.c
|
|||
add_subdirectory(tests)
|
||||
|
||||
## Install #####################################################################
|
||||
set(IS_IMP_LIB "$<NOT:$<STREQUAL:$<TARGET_LINKER_FILE_NAME:tcl>,${CMAKE_STATIC_LIBRARY_PREFIX}$<TARGET_FILE_NAME:tcl>${CMAKE_STATIC_LIBRARY_SUFFIX}>>")
|
||||
set(IMPORT_LINK "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tcl>")
|
||||
set(DIRECT_LINK "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tcl>")
|
||||
set(TCL_LINK_FLAG "$<IF:${IS_IMP_LIB},${IMPORT_LINK},${DIRECT_LINK}>")
|
||||
|
||||
set(IS_IMP_LIB_S "$<NOT:$<BOOL:${CMAKE_LINK_LIBRARY_FLAG}>>")
|
||||
set(IMPORT_LINK_S "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tclstub>")
|
||||
set(DIRECT_LINK_S "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tclstub>")
|
||||
set(TCLSTUB_LINK_FLAG "$<IF:${IS_IMP_LIB_S},${IMPORT_LINK_S},${DIRECT_LINK_S}>")
|
||||
|
||||
configure_file(tclConfig.sh.in
|
||||
tclConfig.sh.cmakein
|
||||
@ONLY
|
||||
)
|
||||
file(GENERATE
|
||||
OUTPUT tclConfig.sh
|
||||
INPUT "${CMAKE_CURRENT_BINARY_DIR}/tclConfig.sh.cmakein"
|
||||
)
|
||||
|
||||
if (TCL_ENABLE_INSTALL)
|
||||
install(TARGETS tcl tclsh tclstub
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/tclConfig.sh"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tclooConfig.sh"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
if (TARGET tcl_reg)
|
||||
install(TARGETS tcl_reg
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/reg${TCL_REG_VERSION}"
|
||||
|
|
|
@ -153,6 +153,9 @@ target_sources(tcl_config INTERFACE
|
|||
$<$<NOT:$<BOOL:${HAVE_STRTOL}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/strtol.c>
|
||||
$<$<NOT:$<BOOL:${HAVE_STRTOUL}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/strtoul.c>
|
||||
)
|
||||
set(TCL_COMPAT_FILES
|
||||
"${TCL_COMPAT_FILES};$<$<NOT:$<BOOL:${HAVE_MEMCMP}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/ansic/memcmp.c>;$<$<NOT:$<BOOL:${HAVE_STRSTR}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/ansic/strstr.c>;$<$<NOT:$<BOOL:${HAVE_STRTOL}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/strtol.c>;$<$<NOT:$<BOOL:${HAVE_STRTOUL}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/strtoul.c>"
|
||||
CACHE INTERNAL "" FORCE)
|
||||
|
||||
if (TCL_ENABLE_INSTALL_DEVELOPMENT)
|
||||
install(FILES
|
||||
|
|
|
@ -116,6 +116,10 @@ if (NOT HAVE_POSIX_DIR_IO)
|
|||
target_sources(tcl PRIVATE
|
||||
src/dirent_severe/opendir.c
|
||||
)
|
||||
|
||||
set(TCL_COMPAT_FILES
|
||||
"${TCL_COMPAT_FILES};src/dirent_severe/opendir.c"
|
||||
CACHE INTERNAL "" FORCE)
|
||||
target_compile_definitions(tcl_config INTERFACE USE_DIRENT2_H=1)
|
||||
|
||||
# handle extra header install
|
||||
|
|
|
@ -29,11 +29,8 @@ cmake_push_check_state(RESET)
|
|||
|
||||
check_include_file("dlfcn.h" HAVE_DLFCN_H)
|
||||
if (HAVE_DLFCN_H)
|
||||
# we also probably need -ldl if we have dlopen
|
||||
check_library_exists("dl" "dlopen" "" HAVE_DL)
|
||||
if (HAVE_DL)
|
||||
target_link_libraries(tcl PRIVATE dl)
|
||||
endif ()
|
||||
target_link_libraries(tcl PRIVATE ${CMAKE_DL_LIBS})
|
||||
set(TCL_LIBS "${TCL_LIBS};${CMAKE_DL_LIBS}" CACHE INTERNAL "")
|
||||
endif ()
|
||||
|
||||
if (HAVE_DLFCN_H AND NOT APPLE) # apple is special
|
||||
|
|
|
@ -109,6 +109,9 @@ target_sources(tcl_config INTERFACE
|
|||
$<$<NOT:$<BOOL:${HAVE_MKSTEMP}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/mkstemp.c>
|
||||
$<$<NOT:$<BOOL:${HAVE_GETTOD}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/gettod.c>
|
||||
)
|
||||
set(TCL_COMPAT_FILES
|
||||
"${TCL_COMPAT_FILES};$<$<NOT:$<BOOL:${HAVE_WAITPID}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/waitpid.c>;$<$<NOT:$<BOOL:${HAVE_STRNCASECMP}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/strncasecmp.c>;$<$<NOT:$<BOOL:${HAVE_MKSTEMP}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/mkstemp.c>;$<$<NOT:$<BOOL:${HAVE_GETTOD}>>:${CMAKE_CURRENT_SOURCE_DIR}/src/gettod.c>"
|
||||
CACHE INTERNAL "" FORCE)
|
||||
|
||||
if (TCL_ENABLE_INSTALL_DEVELOPMENT)
|
||||
install(FILES
|
||||
|
|
|
@ -91,6 +91,9 @@ target_compile_definitions(tcl_config INTERFACE
|
|||
)
|
||||
|
||||
target_sources(tcl PRIVATE src/rfc2553/fake-rfc2553.c)
|
||||
set(TCL_COMPAT_FILES
|
||||
"${TCL_COMPAT_FILES};${CMAKE_CURRENT_SOURCE_DIR}/src/rfc2553/fake-rfc2553.c"
|
||||
CACHE INTERNAL "" FORCE)
|
||||
|
||||
if (TCL_ENABLE_INSTALL_DEVELOPMENT)
|
||||
install(FILES
|
||||
|
|
|
@ -31,6 +31,7 @@ if (Threads_FOUND)
|
|||
$<$<NOT:$<PLATFORM_ID:Windows>>:_THREAD_SAFE=1>
|
||||
)
|
||||
target_link_libraries(tcl_config INTERFACE Threads::Threads)
|
||||
set(TCL_LIBS "${TCL_LIBS};${CMAKE_THREAD_LIBS_INIT}" CACHE INTERNAL "")
|
||||
else ()
|
||||
message(WARNING [[Threading support was requested (TCL_ENABLE_THREADS defaults to on),
|
||||
but the system doesn't seem to have a compatible threading API. Thenceforth, no threading
|
||||
|
|
|
@ -201,6 +201,7 @@ cmake_pop_check_state()
|
|||
## Xt ##########################################################################
|
||||
find_package(X11 REQUIRED Xt)
|
||||
target_link_libraries(tcl_config INTERFACE X11::Xt)
|
||||
set(TCL_LIBS "${TCL_LIBS};${X11_X11_LIB};${X11_Xt_LIB}" CACHE INTERNAL "")
|
||||
|
||||
## Configuration ###############################################################
|
||||
target_compile_definitions(tcl_config INTERFACE
|
||||
|
@ -236,7 +237,7 @@ target_include_directories(tcl_config INTERFACE
|
|||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/tcl${TCL_DOUBLE_VERSION}/unix>
|
||||
)
|
||||
|
||||
|
||||
if (TCL_ENABLE_INSTALL_DEVELOPMENT)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/tclUnixPort.h"
|
||||
|
|
|
@ -247,7 +247,12 @@ if (TARGET tcltest)
|
|||
)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(tcl_config INTERFACE kernel32 ws2_32 netapi32 userenv user32 advapi32)
|
||||
set(WIN_LIBS
|
||||
kernel32 user32 gdi32 winspool shell32 ole32 oleaut32
|
||||
uuid comdlg32 advapi32 ws2_32 netapi32 userenv
|
||||
)
|
||||
target_link_libraries(tcl_config INTERFACE ${WIN_LIBS})
|
||||
set(TCL_LIBS "${TCL_LIBS};${WIN_LIBS}" CACHE INTERNAL "")
|
||||
|
||||
if (TCL_ENABLE_INSTALL_DEVELOPMENT)
|
||||
install(FILES
|
||||
|
|
|
@ -111,12 +111,32 @@ configure_file(src/itcl.rc.in
|
|||
add_subdirectory(tests)
|
||||
|
||||
## Install #####################################################################
|
||||
set(IS_IMP_LIB "$<NOT:$<STREQUAL:$<TARGET_LINKER_FILE_NAME:tea_itcl>,${CMAKE_STATIC_LIBRARY_PREFIX}$<TARGET_FILE_NAME:tea_itcl>${CMAKE_STATIC_LIBRARY_SUFFIX}>>")
|
||||
set(IMPORT_LINK "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tea_itcl>")
|
||||
set(DIRECT_LINK "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tea_itcl>")
|
||||
set(ITCL_LINK_FLAG "$<IF:${IS_IMP_LIB},${IMPORT_LINK},${DIRECT_LINK}>")
|
||||
|
||||
set(IS_IMP_LIB_S "$<NOT:$<BOOL:${CMAKE_LINK_LIBRARY_FLAG}>>")
|
||||
set(IMPORT_LINK_S "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tea_itclstub>")
|
||||
set(DIRECT_LINK_S "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tea_itclstub>")
|
||||
set(ITCLSTUB_LINK_FLAG "$<IF:${IS_IMP_LIB_S},${IMPORT_LINK_S},${DIRECT_LINK_S}>")
|
||||
|
||||
configure_file(itclConfig.sh.in
|
||||
itclConfig.sh.cmakein
|
||||
@ONLY
|
||||
)
|
||||
file(GENERATE
|
||||
OUTPUT itclConfig.sh
|
||||
INPUT "${CMAKE_CURRENT_BINARY_DIR}/itclConfig.sh.cmakein"
|
||||
)
|
||||
|
||||
if (TCL_ENABLE_INSTALL)
|
||||
install(TARGETS tea_itcl tea_itclstub
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/itcl${ITCL_VERSION}"
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/itclConfig.sh"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tcl/itcl.tcl"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tcl/itclHullCmds.tcl"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tcl/itclWidget.tcl"
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
# itclConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by Itcl's
|
||||
# configure script. It will create shell variables for most of
|
||||
# the configuration options discovered by the configure script.
|
||||
# This script is intended to be included by the configure scripts
|
||||
# for Itcl extensions so that they don't have to figure this all
|
||||
# out for themselves. This file does not duplicate information
|
||||
# already provided by tclConfig.sh, so you may need to use that
|
||||
# file in addition to this one.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
|
||||
# Itcl's version number.
|
||||
itcl_VERSION='@ITCL_VERSION@'
|
||||
ITCL_VERSION='@ITCL_VERSION@'
|
||||
|
||||
# The name of the Itcl library (may be either a .a file or a shared library):
|
||||
itcl_LIB_FILE=$<TARGET_FILE_NAME:tea_itcl>
|
||||
ITCL_LIB_FILE=$<TARGET_FILE_NAME:tea_itcl>
|
||||
|
||||
# String to pass to linker to pick up the Itcl library from its
|
||||
# build directory.
|
||||
itcl_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_itcl>" @ITCL_LINK_FLAG@'
|
||||
ITCL_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_itcl>" @ITCL_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Itcl library from its
|
||||
# installed directory.
|
||||
itcl_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@" @ITCL_LINK_FLAG@'
|
||||
ITCL_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@" @ITCL_LINK_FLAG@'
|
||||
|
||||
# The name of the Itcl stub library (a .a file):
|
||||
itcl_STUB_LIB_FILE="$<TARGET_FILE_NAME:tea_itclstub>"
|
||||
ITCL_STUB_LIB_FILE="$<TARGET_FILE_NAME:tea_itclstub>"
|
||||
|
||||
# String to pass to linker to pick up the Itcl stub library from its
|
||||
# build directory.
|
||||
itcl_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_itclstub>" @ITCLSTUB_LINK_FLAG@'
|
||||
ITCL_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_itclstub>" @ITCLSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Itcl stub library from its
|
||||
# installed directory.
|
||||
itcl_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@" @ITCLSTUB_LINK_FLAG@'
|
||||
ITCL_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@" @ITCLSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Itcl stub library from its
|
||||
# build directory.
|
||||
itcl_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tea_itclstub>'
|
||||
ITCL_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tea_itclstub>'
|
||||
|
||||
# String to pass to linker to pick up the Itcl stub library from its
|
||||
# installed directory.
|
||||
itcl_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@/$<TARGET_FILE_NAME:tea_itclstub>'
|
||||
ITCL_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/itcl@ITCL_VERSION@/$<TARGET_FILE_NAME:tea_itclstub>'
|
||||
|
||||
# Location of the top-level source directories from which [incr Tcl]
|
||||
# was built. This is the directory that contains generic, unix, etc.
|
||||
# If [incr Tcl] was compiled in a different place than the directory
|
||||
# containing the source files, this points to the location of the sources,
|
||||
# not the location where [incr Tcl] was compiled.
|
||||
# This is not defined correctly because we *REALLY* changed project layout
|
||||
# and would lead to confusion
|
||||
# Fancy ASCII art as we hope to force a failure upon use
|
||||
itcl_SRC_DIR='\\&)*(-/SEE PROVIDED itclConfig.sh FOR REASONING WHY YOU SEE THIS/-)*(&\\'
|
||||
ITCL_SRC_DIR='\\&)*(-/SEE PROVIDED itclConfig.sh FOR REASONING WHY YOU SEE THIS/-)*(&\\'
|
||||
|
||||
# String to pass to the compiler so that an extension can
|
||||
# find installed Itcl headers.
|
||||
itcl_INCLUDE_SPEC='@CMAKE_CURRENT_SOURCE_DIR@/src'
|
||||
ITCL_INCLUDE_SPEC='@CMAKE_CURRENT_SOURCE_DIR@/src'
|
|
@ -75,12 +75,12 @@ target_link_libraries(tea_tdbc PRIVATE tea_tdbc_config)
|
|||
target_link_libraries(tea_tdbcstub PRIVATE tea_tdbc_config)
|
||||
|
||||
target_compile_definitions(tea_tdbc PRIVATE
|
||||
PACKAGE_NAME="tdbc"
|
||||
PACKAGE_VERSION="${TDBC_VERSION}"
|
||||
"PACKAGE_NAME=\"tdbc\""
|
||||
"PACKAGE_VERSION=\"${TDBC_VERSION}\""
|
||||
)
|
||||
target_compile_definitions(tea_tdbcstub PRIVATE
|
||||
PACKAGE_NAME="tdbc"
|
||||
PACKAGE_VERSION="${TDBC_VERSION}"
|
||||
"PACKAGE_NAME=\"tdbc\""
|
||||
"PACKAGE_VERSION=\"${TDBC_VERSION}\""
|
||||
)
|
||||
target_compile_definitions(tea_tdbc_config INTERFACE
|
||||
BUILD_tdbc=1
|
||||
|
@ -133,12 +133,31 @@ configure_file(src/tdbc.rc.in
|
|||
add_subdirectory(tests)
|
||||
|
||||
## Install #####################################################################
|
||||
set(IS_IMP_LIB "$<NOT:$<STREQUAL:$<TARGET_LINKER_FILE_NAME:tea_tdbc>,${CMAKE_STATIC_LIBRARY_PREFIX}$<TARGET_FILE_NAME:tea_tdbc>${CMAKE_STATIC_LIBRARY_SUFFIX}>>")
|
||||
set(IMPORT_LINK "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tea_tdbc>")
|
||||
set(DIRECT_LINK "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tea_tdbc>")
|
||||
set(TDBC_LINK_FLAG "$<IF:${IS_IMP_LIB},${IMPORT_LINK},${DIRECT_LINK}>")
|
||||
|
||||
set(IS_IMP_LIB_S "$<NOT:$<BOOL:${CMAKE_LINK_LIBRARY_FLAG}>>")
|
||||
set(IMPORT_LINK_S "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tea_tdbcstub>")
|
||||
set(DIRECT_LINK_S "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tea_tdbcstub>")
|
||||
set(TDBCSTUB_LINK_FLAG "$<IF:${IS_IMP_LIB_S},${IMPORT_LINK_S},${DIRECT_LINK_S}>")
|
||||
|
||||
configure_file(tdbcConfig.sh.in
|
||||
tdbcConfig.sh.cmakein
|
||||
@ONLY
|
||||
)
|
||||
file(GENERATE OUTPUT tdbcConfig.sh
|
||||
INPUT "${CMAKE_CURRENT_BINARY_DIR}/tdbcConfig.sh.cmakein"
|
||||
)
|
||||
|
||||
if (TCL_ENABLE_INSTALL)
|
||||
install(TARGETS tea_tdbc tea_tdbcstub
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/tdbc${TDBC_VERSION}"
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/tdbcConfig.sh"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tcl/tdbc.tcl"
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_LIBDIR}/tdbc${TDBC_VERSION}"
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
# tdbcConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by TDBC's configure
|
||||
# script. It will create shell variables for most of the configuration options
|
||||
# discovered by the configure script. This script is intended to be included
|
||||
# by the configure scripts for TDBC extensions so that they don't have to
|
||||
# figure this all out for themselves.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
#
|
||||
# RCS: @(#) $Id$
|
||||
|
||||
# TDBC's version number
|
||||
tdbc_VERSION=@TDBC_VERSION@
|
||||
TDBC_VERSION=@TDBC_VERSION@
|
||||
|
||||
# Name of the TDBC library - may be either a static or shared library
|
||||
tdbc_LIB_FILE=$<TARGET_FILE_NAME:tea_tdbc>
|
||||
TDBC_LIB_FILE=$<TARGET_FILE_NAME:tea_tdbc>
|
||||
|
||||
# String to pass to the linker to pick up the TDBC library from its build dir
|
||||
tdbc_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_tdbc>" @TDBCSTUB_LINK_FLAG@'
|
||||
TDBC_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_tdbc>" @TDBCSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to the linker to pick up the TDBC library from its installed
|
||||
# dir.
|
||||
tdbc_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@" @TDBC_LINK_FLAG@'
|
||||
TDBC_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@" @TDBC_LINK_FLAG@'
|
||||
|
||||
# Name of the TBDC stub library
|
||||
tdbc_STUB_LIB_FILE='$<TARGET_FILE_NAME:tea_tdbcstub>'
|
||||
TDBC_STUB_LIB_FILE='$<TARGET_FILE_NAME:tea_tdbcstub>'
|
||||
|
||||
# String to pass to the linker to pick up the TDBC stub library from its
|
||||
# build directory
|
||||
tdbc_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_tdbcstub>" @TDBCSTUB_LINK_FLAG@'
|
||||
TDBC_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tea_tdbcstub>" @TDBCSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to the linker to pick up the TDBC stub library from its
|
||||
# installed directory
|
||||
tdbc_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@" @TDBCSTUB_LINK_FLAG@'
|
||||
TDBC_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@" @TDBCSTUB_LINK_FLAG@'
|
||||
|
||||
# Path name of the TDBC stub library in its build directory
|
||||
tdbc_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tea_tdbcstub>'
|
||||
TDBC_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tea_tdbcstub>'
|
||||
|
||||
# Path name of the TDBC stub library in its installed directory
|
||||
tdbc_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@/$<TARGET_FILE_NAME:tea_tdbcstub>'
|
||||
TDBC_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@/$<TARGET_FILE_NAME:tea_tdbcstub>'
|
||||
|
||||
# Location of the top-level source directories from which TDBC was built.
|
||||
# This is the directory that contains doc/, generic/ and so on. If TDBC
|
||||
# was compiled in a directory other than the source directory, this still
|
||||
# points to the location of the sources, not the location where TDBC was
|
||||
# compiled.
|
||||
# This is not defined correctly because we *REALLY* changed project layout
|
||||
# and would lead to confusion
|
||||
# Fancy ASCII art as we hope to force a failure upon use
|
||||
tdbc_SRC_DIR='\\&)*(-/SEE PROVIDED tdbcConfig.sh FOR REASONING WHY YOU SEE THIS/-)*(&\\'
|
||||
TDBC_SRC_DIR='\\&)*(-/SEE PROVIDED tdbcConfig.sh FOR REASONING WHY YOU SEE THIS/-)*(&\\'
|
||||
|
||||
# String to pass to the compiler so that an extension can find installed TDBC
|
||||
# headers
|
||||
tdbc_INCLUDE_SPEC='-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@"'
|
||||
TDBC_INCLUDE_SPEC='-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@"'
|
||||
|
||||
# String to pass to the compiler so that an extension can find TDBC headers
|
||||
# in the source directory
|
||||
tdbc_BUILD_INCLUDE_SPEC='-I"@CMAKE_CURRENT_SOURCE_DIR@/src"'
|
||||
TDBC_BUILD_INCLUDE_SPEC='-I"@CMAKE_CURRENT_SOURCE_DIR@/src"'
|
||||
|
||||
# Path name where .tcl files in the tdbc package appear at run time.
|
||||
tdbc_LIBRARY_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@'
|
||||
TDBC_LIBRARY_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/tdbc@TDBC_VERSION@'
|
||||
|
||||
# Path name where .tcl files in the tdbc package appear at build time.
|
||||
tdbc_BUILD_LIBRARY_PATH='@CMAKE_CURRENT_SOURCE_DIR@/tcl'
|
||||
TDBC_BUILD_LIBRARY_PATH='@CMAKE_CURRENT_SOURCE_DIR@/tcl'
|
||||
|
||||
# Additional flags that must be passed to the C compiler to use tdbc
|
||||
tdbc_CFLAGS=$<0:These are literally empty in the original project>
|
||||
TDBC_CFLAGS=$<0:So I'm leaving them empty. Probably legacy reasons>
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
# tclConfig.sh --
|
||||
#
|
||||
# This file is automagically generated by the Tcl CMake build script.
|
||||
# The intent is to provide the correct shell variables as by the original
|
||||
# tclConfig.sh as provided by Tcl's AutoConf files.
|
||||
#
|
||||
# Not that this file is probably buggy as all f**k.
|
||||
#
|
||||
# The information in this file is still specific to a single platform.
|
||||
$<0:While reading the source, these lines are comments.>
|
||||
|
||||
TCL_DLL_FILE="$<TARGET_FILE_NAME:tcl>"
|
||||
|
||||
# Tcl's version number.
|
||||
TCL_VERSION='@TCL_VERSION@'
|
||||
TCL_MAJOR_VERSION='@TCL_MAJOR_VERSION@'
|
||||
TCL_MINOR_VERSION='@TCL_MINOR_VERSION@'
|
||||
TCL_PATCH_LEVEL='@TCL_PATCH_LEVEL@'
|
||||
|
||||
# C compiler to use for compilation.
|
||||
TCL_CC='@CMAKE_C_COMPILER@'
|
||||
|
||||
# -D flags for use with the C compiler.
|
||||
TCL_DEFS='$<$<BOOL:$<TARGET_PROPERTY:tcl,INTERFACE_COMPILE_DEFINITIONS>>:-D$<JOIN:$<TARGET_PROPERTY:tcl,INTERFACE_COMPILE_DEFINITIONS>, -D>>'
|
||||
|
||||
# If TCL was built with debugging symbols, generated libraries contain
|
||||
# this string at the end of the library name (before the extension).
|
||||
$<0:Build suffixes are for the weak and fools>
|
||||
$<0:A debug build should never leave your build system's boundaries therefore this thing is meaningless>
|
||||
TCL_DBGX=
|
||||
|
||||
# Default flags used in an optimized and debuggable build, respectively.
|
||||
TCL_CFLAGS_DEBUG='@CMAKE_C_FLAGS_DEBUG@ $<JOIN:$<TARGET_PROPERTY:tcl,INTERFACE_COMPILE_OPTIONS>, >'
|
||||
TCL_CFLAGS_OPTIMIZE='@CMAKE_C_FLAGS_RELEASE@ $<JOIN:$<TARGET_PROPERTY:tcl,INTERFACE_COMPILE_OPTIONS>, >'
|
||||
|
||||
# Default linker flags used in an optimized and debuggable build, respectively.
|
||||
TCL_LDFLAGS_DEBUG='$<JOIN:$<TARGET_PROPERTY:tcl,INTERFACE_LINK_OPTIONS>, >'
|
||||
TCL_LDFLAGS_OPTIMIZE='$<JOIN:$<TARGET_PROPERTY:tcl,INTERFACE_LINK_OPTIONS>, >'
|
||||
|
||||
# Flag, 1: we built a shared lib, 0 we didn't
|
||||
TCL_SHARED_BUILD=$<BOOL:@TCL_BUILD_SHARED@>
|
||||
|
||||
# The name of the Tcl library (may be either a .a file or a shared library):
|
||||
TCL_LIB_FILE='$<TARGET_LINKER_FILE:tcl>'
|
||||
|
||||
# Flag to indicate whether shared libraries need export files.
|
||||
$<0:CMake by default exports all on AIX, and for Windows we don't need a different file>
|
||||
TCL_NEEDS_EXP_FILE=$<$<PLATFORM_ID:AIX>:$<NOT:$<TARGET_PROPERTY:tcl,AIX_EXPORT_ALL_SYMBOLS>>>
|
||||
|
||||
# String that can be evaluated to generate the part of the export file
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variables
|
||||
# VERSION. On most UNIX systems this is ${VERSION}.exp.
|
||||
TCL_EXPORT_FILE_SUFFIX='@TCL_DOUBLE_VERSION@@CMAKE_IMPORT_LIBRARY_SUFFIX@'
|
||||
|
||||
# Additional libraries to use when linking Tcl.
|
||||
TCL_LIBS='$<$<BOOL:@TCL_LIBS@>:@CMAKE_LINK_LIBRARY_FLAG@$<JOIN:@TCL_LIBS@,$<@IS_IMP_LIB@:@CMAKE_IMPORT_LIBRARY_SUFFIX@> @CMAKE_LINK_LIBRARY_FLAG@>@CMAKE_IMPORT_LIBRARY_SUFFIX@>'
|
||||
|
||||
# Top-level directory in which Tcl's platform-independent files are
|
||||
# installed.
|
||||
TCL_PREFIX='@CMAKE_INSTALL_PREFIX@'
|
||||
|
||||
# Top-level directory in which Tcl's platform-specific files (e.g.
|
||||
# executables) are installed.
|
||||
TCL_EXEC_PREFIX='@CMAKE_INSTALL_PREFIX@'
|
||||
|
||||
# Flags to pass to cc when compiling the components of a shared library:
|
||||
TCL_SHLIB_CFLAGS='@CMAKE_C_FLAGS@'
|
||||
|
||||
# Flags to pass to cc to get warning messages
|
||||
TCL_CFLAGS_WARNING=''
|
||||
|
||||
# Extra flags to pass to cc:
|
||||
TCL_EXTRA_CFLAGS=''
|
||||
|
||||
# Base command to use for combining object files into a shared library:
|
||||
TCL_SHLIB_LD='@TCL_LD@ $<JOIN:$<TARGET_PROPERTY:tcl,LINK_OPTIONS>, >'
|
||||
|
||||
# Base command to use for combining object files into a static library:
|
||||
$<0:If not MSVC we assume UNIX-ish ar which accepts "cr">
|
||||
TCL_STLIB_LD='@TCL_AR@ $<JOIN:$<TARGET_PROPERTY:tclstub,LINK_OPTIONS>, >'
|
||||
|
||||
# Either '$LIBS' (if dependent libraries should be included when linking
|
||||
# shared libraries) or an empty string. See Tcl's configure.in for more
|
||||
# explanation.
|
||||
TCL_SHLIB_LD_LIBS='${LIBS}'
|
||||
|
||||
# Suffix to use for the name of a shared library.
|
||||
TCL_SHLIB_SUFFIX='@CMAKE_SHARED_LIBRARY_SUFFIX@'
|
||||
|
||||
# Library file(s) to include in tclsh and other base applications
|
||||
# in order to provide facilities needed by DLOBJ above.
|
||||
TCL_DL_LIBS='@CMAKE_DL_LIBS@'
|
||||
|
||||
# Flags to pass to the compiler when linking object files into
|
||||
# an executable tclsh or tcltest binary.
|
||||
TCL_LD_FLAGS='@CMAKE_EXE_LINKER_FLAGS@'
|
||||
|
||||
# Flags to pass to cc/ld, such as "-R /usr/local/tcl/lib", that tell the
|
||||
# run-time dynamic linker where to look for shared libraries such as
|
||||
# libtcl.so. Used when linking applications. Only works if there
|
||||
# is a variable "LIB_RUNTIME_DIR" defined in the Makefile.
|
||||
TCL_CC_SEARCH_FLAGS=''
|
||||
TCL_LD_SEARCH_FLAGS=''
|
||||
|
||||
# Additional object files linked with Tcl to provide compatibility
|
||||
# with standard facilities from ANSI C or POSIX.
|
||||
TCL_COMPAT_OBJS='$<$<BOOL:@TCL_COMPAT_FILES@>:$<JOIN:@TCL_COMPAT_FILES@,@CMAKE_C_OUTPUT_EXTENSION@ >>'
|
||||
|
||||
# Name of the ranlib program to use.
|
||||
TCL_RANLIB='@CMAKE_RANLIB@'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tcl library
|
||||
TCL_LIB_FLAG='@TCL_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tcl library from its
|
||||
# build directory.
|
||||
TCL_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tcl>" @TCL_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tcl library from its
|
||||
# installed directory.
|
||||
TCL_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@" @TCL_LINK_FLAG@'
|
||||
|
||||
# String to pass to the compiler so that an extension can
|
||||
# find installed Tcl headers.
|
||||
TCL_INCLUDE_SPEC='-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@"'
|
||||
|
||||
# Indicates whether a version numbers should be used in -l switches
|
||||
# ("ok" means it's safe to use switches like -ltcl7.5; "nodots" means
|
||||
# use switches like -ltcl75). SunOS and FreeBSD require "nodots", for
|
||||
# example.
|
||||
$<0:There is no reason for use to use those things. We build targets without dots>
|
||||
TCL_LIB_VERSIONS_OK='nodots'
|
||||
|
||||
# String that can be evaluated to generate the part of a shared library
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variables
|
||||
# VERSION and SHLIB_SUFFIX. On most UNIX systems this is
|
||||
# ${VERSION}${SHLIB_SUFFIX}.
|
||||
TCL_SHARED_LIB_SUFFIX='@TCL_DOUBLE_VERSION@@CMAKE_SHARED_LIBRARY_SUFFIX@'
|
||||
|
||||
# String that can be evaluated to generate the part of an unshared library
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variable
|
||||
# VERSION. On most UNIX systems this is ${VERSION}.a.
|
||||
TCL_UNSHARED_LIB_SUFFIX='@TCL_DOUBLE_VERSION@@CMAKE_STATIC_LIBRARY_SUFFIX@'
|
||||
|
||||
# Location of the top-level source directory from which Tcl was built.
|
||||
# This is the directory that contains a README file as well as
|
||||
# subdirectories such as generic, unix, etc. If Tcl was compiled in a
|
||||
# different place than the directory containing the source files, this
|
||||
# points to the location of the sources, not the location where Tcl was
|
||||
# compiled.
|
||||
# This is not defined correctly because we *REALLY* changed project layout
|
||||
# and would lead to confusion
|
||||
# Fancy ASCII art as we hope to force a failure upon use
|
||||
TCL_SRC_DIR='\\(*)-/SEE PROVIDED tclConfig.sh FOR REASONING WHY YOU SEE THIS/-(*)\\'
|
||||
|
||||
# List of standard directories in which to look for packages during
|
||||
# "package require" commands. Contains the "prefix" directory plus also
|
||||
# the "exec_prefix" directory, if it is different.
|
||||
TCL_PACKAGE_PATH='{@CMAKE_INSTALL_FULL_LIBDIR@}'
|
||||
|
||||
# Tcl supports stub. $<0:We always support stubs>
|
||||
TCL_SUPPORTS_STUBS=1
|
||||
|
||||
# The name of the Tcl stub library (.a):
|
||||
TCL_STUB_LIB_FILE='$<TARGET_FILE_NAME:tclstub>'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tcl stub library
|
||||
TCL_STUB_LIB_FLAG='@TCLSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tcl stub library from its
|
||||
# build directory.
|
||||
TCL_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tclstub>" @TCLSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tcl stub library from its
|
||||
# installed directory.
|
||||
TCL_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@" @TCLSTUB_LINK_FLAG@'
|
||||
|
||||
# Path to the Tcl stub library in the build directory.
|
||||
TCL_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tclstub>'
|
||||
|
||||
# Path to the Tcl stub library in the install directory.
|
||||
TCL_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/$<TARGET_FILE_NAME:tclstub>'
|
||||
|
||||
# Flag, 1: we built Tcl with threads enabled, 0 we didn't
|
||||
TCL_THREADS=$<BOOL:@TCL_ENABLE_THREADS@>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# tclooConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by TclOO's configure
|
||||
# script, or would be except it has no values that we substitute. It will
|
||||
# create shell variables for most of the configuration options discovered by
|
||||
# the configure script. This script is intended to be included by TEA-based
|
||||
# configure scripts for TclOO extensions so that they don't have to figure
|
||||
# this all out for themselves.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
|
||||
# These are mostly empty because no special steps are ever needed from Tcl 8.6
|
||||
# onwards; all libraries and include files are just part of Tcl.
|
||||
TCLOO_LIB_SPEC=""
|
||||
TCLOO_STUB_LIB_SPEC=""
|
||||
TCLOO_INCLUDE_SPEC=""
|
||||
TCLOO_PRIVATE_INCLUDE_SPEC=""
|
||||
TCLOO_CFLAGS=""
|
||||
TCLOO_VERSION=1.1.0
|
|
@ -130,10 +130,34 @@ add_subdirectory(library)
|
|||
add_subdirectory(tests)
|
||||
|
||||
## Install #####################################################################
|
||||
set(IS_IMP_LIB "$<NOT:$<STREQUAL:$<TARGET_LINKER_FILE_NAME:tk>,${CMAKE_STATIC_LIBRARY_PREFIX}$<TARGET_FILE_NAME:tk>${CMAKE_STATIC_LIBRARY_SUFFIX}>>")
|
||||
set(IMPORT_LINK "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tk>")
|
||||
set(DIRECT_LINK "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tk>")
|
||||
set(TCL_LINK_FLAG "$<IF:${IS_IMP_LIB},${IMPORT_LINK},${DIRECT_LINK}>")
|
||||
|
||||
set(IS_IMP_LIB_S "$<NOT:$<BOOL:${CMAKE_LINK_LIBRARY_FLAG}>>")
|
||||
set(IMPORT_LINK_S "${CMAKE_LINK_LIBRARY_FILE_FLAG}$<TARGET_LINKER_FILE_NAME:tkstub>")
|
||||
set(DIRECT_LINK_S "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_LINKER_FILE_BASE_NAME:tkstub>")
|
||||
set(TCLSTUB_LINK_FLAG "$<IF:${IS_IMP_LIB_S},${IMPORT_LINK_S},${DIRECT_LINK_S}>")
|
||||
|
||||
configure_file(tkConfig.sh.in
|
||||
tkConfig.sh.cmakein
|
||||
@ONLY
|
||||
)
|
||||
file(GENERATE
|
||||
OUTPUT tkConfig.sh
|
||||
INPUT "${CMAKE_CURRENT_BINARY_DIR}/tkConfig.sh.cmakein"
|
||||
)
|
||||
|
||||
if (TCL_ENABLE_INSTALL)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/unix_backend/src/tkAppInit.c"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/tk${TK_VERSION}"
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tkConfig.sh"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
install(TARGETS tk wish tkstub
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
|
|
|
@ -58,6 +58,9 @@ target_sources(tk PRIVATE
|
|||
src/ttk/ttkTrack.c src/ttk/ttkTreeview.c src/ttk/ttkWidget.c
|
||||
src/ttk/ttkWidget.h
|
||||
)
|
||||
if (WIN32 OR APPLE)
|
||||
target_sources(tk PRIVATE src/tkPointer.c)
|
||||
endif ()
|
||||
target_sources(tkstub PRIVATE
|
||||
src/tkStubLib.c
|
||||
src/ttk/ttkStubLib.c
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
# arising from the use of this software.
|
||||
#
|
||||
#
|
||||
# Permission is granted to anyone to use this software for any purpose,
|
||||
# including commercial applications, and to alter it and redistribute it
|
||||
# freely, subject to the following restrictions:
|
||||
#
|
||||
#
|
||||
# 1. The origin of this software must not be misrepresented; you must not
|
||||
# claim that you wrote the original software. If you use this software
|
||||
# in a product, an acknowledgment in the product documentation would be
|
||||
|
@ -20,7 +20,7 @@
|
|||
project(tk-compat-layer C)
|
||||
|
||||
# This file does basically nothing, as we can just check the same values from
|
||||
# the Tcl build, however, if X11 is not available on non Aqua build, we
|
||||
# the Tcl build, however, if X11 is not available on non Aqua build, we
|
||||
# provide that. Applies to Windows too, but don't ask me why.
|
||||
|
||||
if (TK_WINDOWING_SYSTEM STREQUAL "Aqua")
|
||||
|
@ -32,6 +32,7 @@ find_package(X11)
|
|||
if (X11_FOUND)
|
||||
# System has X11, nothing else to do, just use it
|
||||
target_link_libraries(tk_config INTERFACE X11::X11)
|
||||
set(TK_LIBS "${TK_LIBS};${X11_X11_LIB}" CACHE INTERNAL "")
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
|
@ -43,7 +44,7 @@ target_include_directories(tk_config INTERFACE
|
|||
target_sources(tk_config INTERFACE
|
||||
src/X/xbytes.h
|
||||
src/X/xcolors.c
|
||||
src/X/xdraw.c
|
||||
src/X/xdraw.c
|
||||
src/X/xgc.c
|
||||
src/X/ximage.c
|
||||
src/X/xutil.c
|
||||
|
|
|
@ -86,6 +86,7 @@ if (TK_ENABLE_XFT)
|
|||
target_link_libraries(tk_config INTERFACE
|
||||
X11::Xft
|
||||
)
|
||||
set(TK_LIBS "${TK_LIBS};${X11_Xft_LIB}" CACHE INTERNAL "")
|
||||
target_compile_definitions(tk_config INTERFACE
|
||||
HAVE_XFT=1
|
||||
)
|
||||
|
@ -101,10 +102,11 @@ endif ()
|
|||
if (TK_ENABLE_XSS)
|
||||
if (X11_Xext_FOUND AND X11_Xss_FOUND)
|
||||
target_link_libraries(tk_config INTERFACE X11::Xext)
|
||||
if (HAVE_WEAK_LINK)
|
||||
else ()
|
||||
# if (HAVE_WEAK_LINK) TODO
|
||||
# else ()
|
||||
target_link_libraries(tk_config INTERFACE X11::Xss)
|
||||
endif ()
|
||||
# endif ()
|
||||
set(TK_LIBS "${TK_LIBS};${X11_Xss_LIB};${X11_Xext_LIB}" CACHE INTERNAL "")
|
||||
target_compile_definitions(tk_config INTERFACE HAVE_XSS=1)
|
||||
else ()
|
||||
message(WARNING [[Xss was requested but CMake couldn't find it for us. Not using it.]])
|
||||
|
@ -114,4 +116,4 @@ endif ()
|
|||
target_link_libraries(tk_config INTERFACE
|
||||
$<$<BOOL:${HAVE_XBSD}>:Xbsd>
|
||||
)
|
||||
|
||||
set(TK_LIBS "${TK_LIBS};$<$<BOOL:${HAVE_XBSD}>:Xbsd>" CACHE INTERNAL "")
|
||||
|
|
|
@ -100,7 +100,9 @@ target_link_options(wish PRIVATE
|
|||
$<$<C_COMPILER_ID:GNU,Clang>:-mwindows>
|
||||
)
|
||||
|
||||
target_link_libraries(tk_config INTERFACE
|
||||
netapi32 kernel32 user32 advapi32 userenv ws2_32 gdi32
|
||||
comdlg32 imm32 comctl32 shell32 uuid ole32 oleaut32
|
||||
)
|
||||
set(TK_WIN_LIBS
|
||||
netapi32 kernel32 user32 advapi32 userenv ws2_32 gdi32
|
||||
comdlg32 imm32 comctl32 shell32 uuid ole32 oleaut32
|
||||
)
|
||||
target_link_libraries(tk_config INTERFACE ${TK_WIN_LIBS})
|
||||
set(TK_LIBS "${TK_LIBS};${TK_WIN_LIBS}" CACHE INTERNAL "")
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
# tkConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by Tk's
|
||||
# configure script. It will create shell variables for most of
|
||||
# the configuration options discovered by the configure script.
|
||||
# This script is intended to be included by the configure scripts
|
||||
# for Tk extensions so that they don't have to figure this all
|
||||
# out for themselves. This file does not duplicate information
|
||||
# already provided by tclConfig.sh, so you may need to use that
|
||||
# file in addition to this one.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
|
||||
TK_DLL_FILE='$<TARGET_FILE_NAME:tk>'
|
||||
|
||||
# Tk's version number.
|
||||
TK_VERSION='@TK_VERSION@'
|
||||
TK_MAJOR_VERSION='@TK_MAJOR_VERSION@'
|
||||
TK_MINOR_VERSION='@TK_MINOR_VERSION@'
|
||||
TK_PATCH_LEVEL='@TK_PATCH_LEVEL@'
|
||||
|
||||
# -D flags for use with the C compiler.
|
||||
TK_DEFS='$<$<BOOL:$<TARGET_PROPERTY:tk,INTERFACE_COMPILE_DEFINITIONS>>:-D$<JOIN:$<TARGET_PROPERTY:tk,INTERFACE_COMPILE_DEFINITIONS>, -D>>'
|
||||
|
||||
# Flag, 1: we built a shared lib, 0 we didn't
|
||||
TK_SHARED_BUILD=$<BOOL:@TK_BUILD_SHARED@>
|
||||
|
||||
# TK_DBGX used to be used to distinguish debug vs. non-debug builds.
|
||||
# This was a righteous pain so the core doesn't do that any more.
|
||||
TK_DBGX=$<0: ^^^^ now what did I say???? >
|
||||
|
||||
# The name of the Tk library (may be either a .a file or a shared library):
|
||||
TK_LIB_FILE='$<TARGET_LINKER_FILE:tk>'
|
||||
|
||||
# Additional libraries to use when linking Tk.
|
||||
TK_LIBS='$<$<BOOL:@TK_LIBS@>:@CMAKE_LINK_LIBRARY_FLAG@$<JOIN:@TK_LIBS@,$<@IS_IMP_LIB@:@CMAKE_IMPORT_LIBRARY_SUFFIX@> @CMAKE_LINK_LIBRARY_FLAG@>>'
|
||||
|
||||
# Top-level directory in which Tk's platform-independent files are
|
||||
# installed.
|
||||
TK_PREFIX='@CMAKE_INSTALL_PREFIX@'
|
||||
|
||||
# Top-level directory in which Tk's platform-specific files (e.g.
|
||||
# executables) are installed.
|
||||
TK_EXEC_PREFIX='@CMAKE_INSTALL_PREFIX@'
|
||||
|
||||
# -I switch(es) to use to make all of the X11 include files accessible:
|
||||
TK_XINCLUDES='$<$<BOOL:@X11_INCLUDE_DIR@>:-I$<JOIN:@X11_INCLUDE_DIR@, -I>>'
|
||||
|
||||
# Linker switch(es) to use to link with the X11 library archive.
|
||||
TK_XLIBSW='$<$<BOOL:@X11_LIBRARIES@>:@CMAKE_LINK_LIBRARY_FLAG@$<JOIN:@X11_LIBRARIES@,@CMAKE_IMPORT_LIBRARY_SUFFIX@ @CMAKE_LINK_LIBRARY_FLAG@>@CMAKE_IMPORT_LIBRARY_SUFFIX@>'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tk library
|
||||
TK_LIB_FLAG='@TK_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tk library from its
|
||||
# build directory.
|
||||
TK_BUILD_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tk>" @TK_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tk library from its
|
||||
# installed directory.
|
||||
TK_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@" @TK_LINK_FLAG@'
|
||||
|
||||
# String to pass to the compiler so that an extension can
|
||||
# find installed Tk headers.
|
||||
TK_INCLUDE_SPEC='-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@"'
|
||||
|
||||
# Location of the top-level source directory from which Tk was built.
|
||||
# This is the directory that contains a README file as well as
|
||||
# subdirectories such as generic, unix, etc. If Tk was compiled in a
|
||||
# different place than the directory containing the source files, this
|
||||
# points to the location of the sources, not the location where Tk was
|
||||
# compiled.
|
||||
# This is not defined correctly because we *REALLY* changed project layout
|
||||
# and would lead to confusion
|
||||
# Fancy ASCII art as we hope to force a failure upon use
|
||||
TK_SRC_DIR='\\(*)-/SEE PROVIDED tkConfig.sh FOR REASONING WHY YOU SEE THIS/-(*)\\'
|
||||
|
||||
# Needed if you want to make a 'fat' shared library library
|
||||
# containing tk objects or link a different wish.
|
||||
TK_CC_SEARCH_FLAGS=''
|
||||
TK_LD_SEARCH_FLAGS=''
|
||||
|
||||
# The name of the Tk stub library (.a):
|
||||
TK_STUB_LIB_FILE='$<TARGET_FILE_NAME:tkstub>'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tk stub library
|
||||
TK_STUB_LIB_FLAG='@TKSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tk stub library from its
|
||||
# build directory.
|
||||
TK_BUILD_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"$<TARGET_FILE_DIR:tkstub>" @TKSTUB_LINK_FLAG@'
|
||||
|
||||
# String to pass to linker to pick up the Tk stub library from its
|
||||
# installed directory.
|
||||
TK_STUB_LIB_SPEC='@CMAKE_LIBRARY_PATH_FLAG@"@CMAKE_INSTALL_FULL_LIBDIR@" @TKSTUB_LINK_FLAG@'
|
||||
|
||||
# Path to the Tk stub library in the build directory.
|
||||
TK_BUILD_STUB_LIB_PATH='$<TARGET_FILE:tkstub>'
|
||||
|
||||
# Path to the Tk stub library in the install directory.
|
||||
TK_STUB_LIB_PATH='@CMAKE_INSTALL_FULL_LIBDIR@/$<TARGET_FILE_NAME:tkstub>'
|
Loading…
Reference in New Issue