Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Add submodules and build script for
  - tcl
  - tk
  - zlib
  • Loading branch information
mhochsteger committed Nov 10, 2017
0 parents commit ba630bf
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "common/tcl"]
path = win/tcl
url = https://github.com/tcltk/tcl.git
[submodule "common/tk"]
path = win/tk
url = https://github.com/tcltk/tk.git
[submodule "common/zlib"]
path = win/zlib
url = https://github.com/madler/zlib.git
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NGSolve dependencies

Repository to build following dependencies for NGSolve on Windows
- zlib
- TCL/TK

Also contains binaries in the github release section for
- OpenCascade (including minGW runtimes)
- OpenBLAS
66 changes: 66 additions & 0 deletions win/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
cmake_minimum_required(VERSION 3.5)

include(ExternalProject)

project(ExternalLibs)

enable_language(C)

find_program(NMAKE nmake)

set(INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install)
set(TCLTK_INSTALL_DIR ${INSTALL_DIR}/tcltk)
set(ZLIB_INSTALL_DIR ${INSTALL_DIR}/zlib)

file(GLOB TCL_INT_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/tcl/*/tcl*Int*.h
${CMAKE_CURRENT_SOURCE_DIR}/tcl/*/tcl*Port*.h
)
file(GLOB TK_INT_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/tk/*/tk*Int*.h
${CMAKE_CURRENT_SOURCE_DIR}/tk/*/tk*Port*.h
${CMAKE_CURRENT_SOURCE_DIR}/tk/win/tkWin.h
)

ExternalProject_Add(tcl_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tcl/win
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tcl/win
CONFIGURE_COMMAND ""
BUILD_COMMAND ${NMAKE} -f makefile.vc INSTALLDIR=${TCLTK_INSTALL_DIR}
INSTALL_COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${TCLTK_INSTALL_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${TCL_INT_HEADERS} ${TCLTK_INSTALL_DIR}/include/
)

ExternalProject_Add(tk_project
DEPENDS tcl_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tk/win
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tk/win
CONFIGURE_COMMAND ""
BUILD_COMMAND ${NMAKE} -f makefile.vc INSTALLDIR=${TCLTK_INSTALL_DIR} TCLDIR=${CMAKE_CURRENT_SOURCE_DIR}/tcl
INSTALL_COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${TCLTK_INSTALL_DIR} TCLDIR=${CMAKE_CURRENT_SOURCE_DIR}/tcl
COMMAND ${CMAKE_COMMAND} -E copy ${TK_INT_HEADERS} ${TCLTK_INSTALL_DIR}/include/
)

add_custom_target(zip_tcltk ALL
DEPENDS tk_project
COMMAND ${CMAKE_COMMAND} -E tar "cfv"
"${CMAKE_INSTALL_PREFIX}/tcltk_win64.zip" --format=zip
bin include lib
WORKING_DIRECTORY ${TCLTK_INSTALL_DIR}
)

ExternalProject_Add(zlib_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ZLIB_INSTALL_DIR}
)

add_custom_target(zip_zlib ALL
DEPENDS zlib_project
COMMAND ${CMAKE_COMMAND} -E tar "cfv"
"${CMAKE_INSTALL_PREFIX}/zlib_win64.zip" --format=zip
bin include lib
WORKING_DIRECTORY ${ZLIB_INSTALL_DIR}
)

7 changes: 7 additions & 0 deletions win/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake -E make_directory build
cmake -E make_directory packages
cd build
call "%VS140COMNTOOLS%\..\..\VC\vcvarsall" x64
cmake .. -DCMAKE_INSTALL_PREFIX=..\packages -G "Visual Studio 14 2015 Win64"
cmake --build . --config Release
PAUSE
1 change: 1 addition & 0 deletions win/tcl
Submodule tcl added at 443f0a
1 change: 1 addition & 0 deletions win/tk
Submodule tk added at d34d76
1 change: 1 addition & 0 deletions win/zlib
Submodule zlib added at cacf7f

0 comments on commit ba630bf

Please sign in to comment.