Togl2.1 for Windows

This commit is contained in:
Matthias 2016-03-07 18:52:51 +01:00
parent 32e392aec7
commit 1dfe0c28cb
4 changed files with 30 additions and 28 deletions

View File

@ -163,20 +163,19 @@ if (USE_GUI)
endif(APPLE)
find_package(OpenGL REQUIRED)
add_definitions(-DTCL -DOPENGL)
add_definitions(-DTCL -DOPENGL -DUSE_TOGL_2)
include_directories(${TCL_INCLUDE_PATH})
include_directories(${TK_INCLUDE_PATH})
set(LIBTOGL togl)
if(WIN32)
get_filename_component(MY_LIB_DIR ${TK_LIBRARY} DIRECTORY)
find_library(LIBTOGL NAMES togl togl17 HINTS ${MY_LIB_DIR} )
install( DIRECTORY "${MY_LIB_DIR}/tcl8.5" DESTINATION lib COMPONENT netgen )
install( DIRECTORY "${MY_LIB_DIR}/tk8.5" DESTINATION lib COMPONENT netgen )
install( DIRECTORY "${MY_LIB_DIR}/tcl8.6" DESTINATION lib COMPONENT netgen )
install( DIRECTORY "${MY_LIB_DIR}/tk8.6" DESTINATION lib COMPONENT netgen )
install( DIRECTORY "${MY_LIB_DIR}/tix8.4.3" DESTINATION lib COMPONENT netgen )
install( DIRECTORY "${MY_LIB_DIR}/../bin" DESTINATION . COMPONENT netgen )
add_definitions(-DTOGL_WGL)
else(WIN32)
set(LIBTOGL togl)
add_definitions(-DUSE_TOGL_2)
if(APPLE)
ADD_DEFINITIONS(-DTOGL_NSOPENGL)
else(APPLE)

View File

@ -39,11 +39,6 @@ install(FILES
occgeom.tcl acisgeom.tcl netgen.ocf
DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
if(USE_GUI AND NOT WIN32)
add_subdirectory(Togl2.1)
install(FILES drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
else()
install(FILES drawing_togl17.tcl RENAME drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
endif(USE_GUI AND NOT WIN32)
add_subdirectory(Togl2.1)
install(FILES drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen)

View File

@ -1,19 +1,27 @@
add_definitions("-DPACKAGE_NAME=\"Togl\" -DPACKAGE_TARNAME=\"togl\" -DPACKAGE_VERSION=\"2.1\" -DPACKAGE_STRING=\"Togl\ 2.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=0 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 -DAUTOSTEREOD=\"\"")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tcl-private/generic" "${TCL_INCLUDE_PATH}/tcl-private/unix")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tk-private/generic" "${TCL_INCLUDE_PATH}/tk-private/unix")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tk-private/generic/ttk")
include_directories(BEFORE "${TK_INCLUDE_PATH}/../PrivateHeaders")
include_directories(BEFORE "${TCL_INCLUDE_PATH}")
include_directories(BEFORE "${TK_INCLUDE_PATH}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fomit-frame-pointer -Wall -Wno-implicit-int")
if(APPLE)
set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c")
endif(APPLE)
add_library(togl togl.c toglProcAddr.c toglStubInit.c)
target_link_libraries(togl ${OPENGL_LIBRARIES} -ldl)
if(WIN32)
add_definitions("-DBUILD_togl -DUNICODE -D_UNICODE -DTOGL_USE_FONTS=0 -DSTDC_HEADERS -DSTDC_HEADER")
add_library(togl SHARED togl.c toglProcAddr.c toglStubInit.c)
install(TARGETS togl DESTINATION ${ng_install_dir} COMPONENT netgen)
else(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -Wno-implicit-int")
add_definitions("-DPACKAGE_NAME=\"Togl\" -DPACKAGE_TARNAME=\"togl\" -DPACKAGE_VERSION=\"2.1\" -DPACKAGE_STRING=\"Togl\ 2.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=0 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 -DAUTOSTEREOD=\"\"")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tcl-private/generic" "${TCL_INCLUDE_PATH}/tcl-private/unix")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tk-private/generic" "${TCL_INCLUDE_PATH}/tk-private/unix")
include_directories(BEFORE "${TCL_INCLUDE_PATH}/tk-private/generic/ttk")
include_directories(BEFORE "${TK_INCLUDE_PATH}/../PrivateHeaders")
include_directories(BEFORE "${TCL_INCLUDE_PATH}")
include_directories(BEFORE "${TK_INCLUDE_PATH}")
add_library(togl togl.c toglProcAddr.c toglStubInit.c)
target_link_libraries(togl -ldl)
endif(WIN32)
target_link_libraries(togl ${OPENGL_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY} )
set_target_properties(togl PROPERTIES POSITION_INDEPENDENT_CODE ON )

View File

@ -16,7 +16,6 @@
#define USE_TOGL_STUB_PROCS
#include "togl.h"
// #include <GL/glext.h>
#include <tkInt.h> // don't need it on osx ???
#include <limits.h>
@ -50,6 +49,7 @@
// for Vista -- not strictly needed because we don't use PFD_SUPPORT_GDI/BITMAP
# define PFD_SUPPORT_COMPOSITION 0x00008000
# endif
# include <GL/glext.h>
# include <objbase.h>
# include <GL/wglext.h>
# ifdef _MSC_VER
@ -131,7 +131,7 @@
# error Unsupported platform, or confused platform defines...
#endif
#define NC3D "NVidia Consumer 3D Stereo"
#define NC3D L"NVidia Consumer 3D Stereo"
#ifndef STEREO_BUFFER_NONE
/* From <X11/extensions/SGIStereo.h>, but we use this constants elsewhere */
@ -250,7 +250,7 @@ static LRESULT(CALLBACK *tkWinChildProc) (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) = NULL;
# ifndef TK_WIN_CHILD_CLASS_NAME
# define TK_WIN_CHILD_CLASS_NAME "TkChild"
# define TK_WIN_CHILD_CLASS_NAME L"TkChild"
# endif
#endif /* TOGL_WGL */