Win MSYS2: improve OPENSCAD_BINPATH finder, link GMP after MPFR, update doc

This commit is contained in:
don bright 2015-06-25 18:58:26 -07:00
parent 99e31e0e7d
commit 82a64f7de6
2 changed files with 44 additions and 41 deletions

View file

@ -3,47 +3,44 @@ Running regression tests:
0) Prerequisites
Install the prerequisite helper programs on your system:
For Linux, BSD, and Mac, install the prerequisite helper programs on
your system:
cmake, python2 (not 3), ImageMagick 6.5.9.3 or newer, diff
There are binary installer packages of these tools available for Mac,
Win, Linux, BSD, and other systems. (except maybe diff for Win)
There are binary installer packages of these tools available on the internet.
Next, get a working qmake GUI build of the main openscad binary working.
For Windows(TM) this means get a cross-build working from within linux.
For Windows(TM) install only the MSYS2 system.
1) GUI Binary
Get a working qmake GUI build of the main openscad binary working.
See README.md for how to do this.
Then, install MCAD under openscad/libraries.
2) MCAD
$ cd openscad
$ git submodule update --init
Install MCAD under openscad/libraries.
$ cd openscad
$ git submodule update --init
A) Building test environment
Linux, Mac:
Linux, Mac, BSD:
$ cd tests
$ cmake .
$ make
Windows(TM):
Windows(TM) under MSYS2:
Cross-build from within linux:
64-bit:
$ source ./scripts/setenv-mingw-xbuild.sh 64
$ ./scripts/release-common.sh mingw64 tests
$ # result is .zip file under ./mingw64/
32-bit:
$ source ./scripts/setenv-mingw-xbuild.sh 32
$ ./scripts/release-common.sh mingw32 tests
$ # result is .zip file under ./mingw32/
$ cd tests
$ cmake -G "MSYS Makefiles" .
$ make
B) Running tests
Linux, Mac:
Linux, Mac, BSD, Win:
$ ctest Runs tests enabled by default
$ ctest -R <regex> Runs only matching tests, e.g. ctest -R dxf
@ -55,12 +52,6 @@ $ ctest -C <configs> Adds extended tests belonging to configs.
Bugs - test known bugs (tests will fail)
All - test everything
Win:
Unzip the OpenSCAD-Tests-YYYY.MM.DD file onto a Windows(TM) machine.
There will be a script called OpenSCAD-Test-Console.py in the parent folder.
Double-click it, and it will open a console, from which you can type the ctest
commands listed above.
C) Automatically upload test results (experimental)
@ -113,7 +104,9 @@ or
$ xvfb-run ctest
Some versions of Xvfb may fail, however.
It is required that the Xvfb / Xvnc have OpenGL support enabled. For example
on some Fedora Linux systems, it is necessary to install the mesa-dri-drivers
package as root to get Xvfb to enable OpenGL.
1. Trouble finding libraries on unix

View file

@ -824,7 +824,8 @@ target_link_libraries(tests-common tests-core)
add_library(tests-cgal STATIC ${CGAL_SOURCES})
set_target_properties(tests-cgal PROPERTIES COMPILE_FLAGS "${ENABLE_OPENCSG_FLAG} -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(tests-cgal tests-common ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${GMP_LIBRARIES} ${MPFR_LIBRARIES})
target_link_libraries(tests-cgal tests-common ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
# GMP must come after MPFR to prevent link errors, see MPFR FAQ
#
# Create non-CGAL tests
@ -872,17 +873,26 @@ endif()
#
# GUI binary tests
#
if(APPLE)
set(OPENSCAD_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../OpenSCAD.app/Contents/MacOS/OpenSCAD")
elseif (MINGW_CROSS_ENV_DIR)
set(OPENSCAD_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../mingw32/release/openscad.exe")
elseif(WIN32) # also should work for msys2 / win64
set(OPENSCAD_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../Release/openscad.exe")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../bin/openscad")
# linux/bsd -> if 'bin' subdir has been created for testing build system
set(OPENSCAD_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../bin/openscad")
else()
set(OPENSCAD_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../openscad")
set(APPLEBIN "${CMAKE_CURRENT_SOURCE_DIR}/../OpenSCAD.app/Contents/MacOS/OpenSCAD")
set(MINGXBIN "${CMAKE_CURRENT_SOURCE_DIR}/../mingw32/release/openscad.exe")
set(WIN32BIN "${CMAKE_CURRENT_SOURCE_DIR}/../Release/openscad.exe")
set(UNXBIN "${CMAKE_CURRENT_SOURCE_DIR}/../openscad") # linux, bsd
# BWORKBIN is for working on the build system, by using out-of-tree build
set(BWORKBIN1 "${CMAKE_CURRENT_SOURCE_DIR}/../bin/openscad")
set(BWORKBIN2 "${CMAKE_CURRENT_SOURCE_DIR}/../bin/release/openscad.exe")
if(APPLE AND EXISTS "${APPLEBIN}")
set(OPENSCAD_BINPATH "${APPLEBIN}")
elseif(MINGW_CROSS_ENV_DIR AND EXISTS "${MINGXBIN}")
set(OPENSCAD_BINPATH "${MINGXBIN}")
elseif(WIN32 AND EXISTS "${WIN32BIN}")
set(OPENSCAD_BINPATH "${WIN32BIN}")
elseif(EXISTS "${UNXBIN}")
set(OPENSCAD_BINPATH "${UNXBIN}")
elseif(EXISTS "${BWORKBIN1}")
set(OPENSCAD_BINPATH "${BWORKBIN1}")
elseif(EXISTS "${BWORKBIN2}")
set(OPENSCAD_BINPATH "${BWORKBIN2}")
endif()
if(EXISTS "${OPENSCAD_BINPATH}")