diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4f00cbc --- /dev/null +++ b/.gitmodules @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..29f72c5 --- /dev/null +++ b/README.md @@ -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 diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt new file mode 100644 index 0000000..57de960 --- /dev/null +++ b/win/CMakeLists.txt @@ -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} +) + diff --git a/win/build.bat b/win/build.bat new file mode 100644 index 0000000..e6a24ab --- /dev/null +++ b/win/build.bat @@ -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 diff --git a/win/tcl b/win/tcl new file mode 160000 index 0000000..443f0a7 --- /dev/null +++ b/win/tcl @@ -0,0 +1 @@ +Subproject commit 443f0a7ceffa45b9f450afea22b701c44f84b87b diff --git a/win/tk b/win/tk new file mode 160000 index 0000000..d34d76d --- /dev/null +++ b/win/tk @@ -0,0 +1 @@ +Subproject commit d34d76dd0d9c0144e573d9e194655a56e56d32be diff --git a/win/zlib b/win/zlib new file mode 160000 index 0000000..cacf7f1 --- /dev/null +++ b/win/zlib @@ -0,0 +1 @@ +Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f