Changeset d7aca32 in tol for tolbase


Ignore:
Timestamp:
Dec 7, 2015, 10:23:36 PM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
63b6642
Parents:
b61a88b
Message:

refs #1860, scripts de arranque para tolbase similar a tolsh, se copia logica de #1884

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7087 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tolbase
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • tolbase/CMakeLists.txt

    rb61a88b rd7aca32  
    11cmake_minimum_required( VERSION 2.8 )
    22project( TOLBASE )
     3
     4set( INSTALL_WITH_TOL 1 )
    35
    46set( CMAKE_MODULE_PATH
    … …  
    5254
    5355if( TCL_FOUND )
     56  message( STATUS "TK_LIBRARY_PATH = ${TK_LIBRARY_PATH}" )
     57  message( STATUS ${TCL_STUB_LIBRARY} )
    5458  message( STATUS ${TCL_INCLUDE_PATH} )
    55   get_filename_component( CMAKE_INSTALL_PREFIX ${TCL_LIBRARY_PATH} PATH )
     59  message( STATUS ${TCL_LIBRARY_PATH} )
     60  if( INSTALL_WITH_TOL )
     61    set( CMAKE_INSTALL_PREFIX ${TOL_PREFIX_PATH} )
     62  else( INSTALL_WITH_TOL )
     63    get_filename_component( CMAKE_INSTALL_PREFIX ${TCL_LIBRARY_PATH} PATH )
     64  endif( INSTALL_WITH_TOL )
    5665  if( WIN32 )
    5766    string( REPLACE "\\" "/" CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} )
    … …  
    6574  CACHE INTERNAL "" )
    6675
     76if( UNIX )
     77  add_subdirectory( bin )
     78endif( UNIX )
     79
    6780add_subdirectory( generic )
    6881add_subdirectory( lib )
  • tolbase/generic/CMakeLists.txt

    rb61a88b rd7aca32  
    88if ( WIN32 )
    99  set( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -mwindows" )
    10 else ( WIN32 )
    11         # use, i.e. don't skip the full RPATH for the build tree
    12   SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
    13 
    14   # when building, don't use the install RPATH already
    15   # (but later on when installing)
    16   SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
    17 
    18   SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    19 
    20   # add the automatically determined parts of the RPATH
    21   # which point to directories outside the build tree to the install RPATH
    22   SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
    23 
    24   # the RPATH to be used when installing, but only if it's not a system directory
    25   LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
    26   IF("${isSystemDir}" STREQUAL "-1")
    27      SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    28   ENDIF("${isSystemDir}" STREQUAL "-1")
    2910endif( WIN32 )
    3011
  • tolbase/generic/tolbase.c

    rb61a88b rd7aca32  
    1414#include "tk.h"
    1515#include "locale.h"
     16#ifdef WIN32
    1617#include <windows.h>
     18#endif
    1719
     20static int g_argc = 0;
     21static char **g_argv = NULL;
     22
     23static
     24void SetupArgv( Tcl_Interp *interp )
     25{
     26  Tcl_Obj *argvPtr = Tcl_NewListObj(0, NULL);
     27  int i;
     28  for( i = 1; i < g_argc; i++ )
     29    {
     30      Tcl_DString ds;
     31      Tcl_ExternalToUtfDString(NULL, g_argv[i], -1, &ds);
     32      Tcl_ListObjAppendElement(NULL, argvPtr,
     33                               Tcl_NewStringObj(Tcl_DStringValue(&ds),
     34                                                Tcl_DStringLength(&ds)));
     35      Tcl_DStringFree(&ds);
     36    }
     37    Tcl_SetVar2Ex(interp, "argv", NULL, argvPtr, TCL_GLOBAL_ONLY);
     38    Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewIntObj(g_argc-1), TCL_GLOBAL_ONLY);
     39}
    1840
    1941#ifdef TK_TEST
    … …  
    3961 */
    4062
     63#ifdef WIN32
    4164#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
     65#endif
    4266
    4367int
    … …  
    139163     */
    140164
    141     Tcl_PkgRequire( interp, "TolbaseApp", TOLBASE_VERSION, 1);
     165    SetupArgv( interp );
     166    Tcl_VarEval( interp, "lappend", " auto_path", " [file join",
     167                 " [file dir [file dir ", Tcl_GetNameOfExecutable(),
     168                 " ] ] lib ]", NULL );
     169    if ( !Tcl_PkgRequire( interp, "TolbaseApp", TOLBASE_VERSION, 1) )
     170      {
     171        printf( "%s\n", Tcl_GetStringResult( interp ) );
     172        Tcl_Exit( -1 );
     173      }
     174    //Tcl_PkgRequire( interp, "TolbaseApp", TOLBASE_VERSION, 1);
    142175    return TCL_OK;
    143176}
  • tolbase/lib/pkgIndex.tcl.in

    rb61a88b rd7aca32  
    55      lappend auto_path {%d}
    66      source [ file join {%d} toltk init_toltk.tcl ]
     7      package provide TolbaseApp @TOLBASE_VERSION_MAJOR@.@TOLBASE_VERSION_MINOR@
    78    } ]
Note: See TracChangeset for help on using the changeset viewer.