mirror of https://github.com/vitalif/openscad
Merge branch 'buildfix'
commit
8b64fa4998
67
boost.pri
67
boost.pri
|
@ -6,35 +6,64 @@ boost {
|
|||
!isEmpty(BOOST_DIR) {
|
||||
QMAKE_INCDIR += $$BOOST_DIR
|
||||
message("boost location: $$BOOST_DIR")
|
||||
win32:QMAKE_LIBDIR += -L$$BOOST_DIR/lib
|
||||
win32: QMAKE_LIBDIR += -L$$BOOST_DIR/lib
|
||||
}
|
||||
|
||||
win32:!CONFIG(mingw-cross-env) {
|
||||
LIBS += -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1
|
||||
}
|
||||
|
||||
CONFIG(mingw-cross-env) {
|
||||
DEFINES += BOOST_STATIC
|
||||
DEFINES += BOOST_THREAD_USE_LIB
|
||||
DEFINES += Boost_USE_STATIC_LIBS
|
||||
LIBS += -lboost_thread_win32-mt -lboost_program_options-mt
|
||||
BOOST_LINK_FLAGS = -lboost_thread_win32-mt -lboost_program_options-mt
|
||||
}
|
||||
|
||||
unix {
|
||||
BMT_TEST1 = /usr/lib64/libboost*thread-mt*
|
||||
BMT_TEST2 = /usr/lib/libboost*thread-mt*
|
||||
BMT_TEST3 = $$BOOST_DIR/lib/libboost*thread-mt*
|
||||
isEmpty(BOOST_LINK_FLAGS):win32 {
|
||||
BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1
|
||||
}
|
||||
|
||||
exists($$BMT_TEST1)|exists($$BMT_TEST2)|exists($$BMT_TEST3) {
|
||||
LIBS += -lboost_thread-mt -lboost_program_options-mt
|
||||
BOOST_IS_MT = true
|
||||
}
|
||||
}
|
||||
|
||||
unix|macx {
|
||||
isEmpty(BOOST_IS_MT) {
|
||||
LIBS += -lboost_thread -lboost_program_options
|
||||
# check for OPENSCAD_LIBDIR + multithread
|
||||
isEmpty(BOOST_LINK_FLAGS) {
|
||||
OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
|
||||
!isEmpty(OPENSCAD_LIBDIR) {
|
||||
exists($$OPENSCAD_LIBDIR/lib/libboost*thread-mt*) {
|
||||
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt
|
||||
} else {
|
||||
exists($$OPENSCAD_LIBDIR/lib/libboost*thread*) {
|
||||
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# check for BOOSTDIR + multithread
|
||||
isEmpty(BOOST_LINK_FLAGS) {
|
||||
BOOST_DIR = $$(BOOSTDIR)
|
||||
!isEmpty(BOOST_DIR) {
|
||||
exists($$BOOST_DIR/lib/libboost*thread-mt*) {
|
||||
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt
|
||||
} else {
|
||||
exists($$BOOST_DIR/lib/libboost*thread*) {
|
||||
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isEmpty(BOOST_LINK_FLAGS) {
|
||||
unix {
|
||||
BMT_TEST1 = /usr/lib64/libboost*thread-mt*
|
||||
BMT_TEST2 = /usr/lib/libboost*thread-mt*
|
||||
exists($$BMT_TEST1)|exists($$BMT_TEST2) {
|
||||
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isEmpty(BOOST_LINK_FLAGS) {
|
||||
unix|macx {
|
||||
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options
|
||||
}
|
||||
}
|
||||
|
||||
LIBS += $$BOOST_LINK_FLAGS
|
||||
|
||||
}
|
||||
|
|
|
@ -50,26 +50,33 @@ Adding a new regression test:
|
|||
Troubleshooting:
|
||||
------------------------------
|
||||
|
||||
0. Headless unix servers (no X11)
|
||||
0. Headless unix servers
|
||||
|
||||
$ Xvfb :5 -screen 0 800x600x24 &
|
||||
If you are attempting to run the tests on a unix-like system but only
|
||||
have shell-console access, you may be able to run the tests by using a
|
||||
virtual framebuffer program like Xvnc or Xvfb. For example:
|
||||
|
||||
$ Xvfb :5 -screen 0 800x600x24 &
|
||||
$ DISPLAY=:5 ctest
|
||||
|
||||
1. Trouble finding libraries
|
||||
Some versions of Xvfb may fail, however.
|
||||
|
||||
1. Trouble finding libraries on unix
|
||||
|
||||
To help CMAKE find eigen2, OpenCSG, CGAL, Boost, and GLEW, you can use
|
||||
environment variables, just like for the main qmake & openscad.pro. Examples:
|
||||
|
||||
OPENCSGDIR=~/OpenCSG-1.3.2 EIGEN2DIR=~/eigen2 cmake .
|
||||
OPENSCAD_LIBRARIES=~ cmake .
|
||||
CGALDIR=~/CGAL-3.9 BOOSTDIR=~/boost-1.47.0 cmake .
|
||||
|
||||
Valid variables are as follows (see CMakeLists.txt for more info):
|
||||
Valid variables are as follows:
|
||||
|
||||
BOOSTDIR, CGALDIR, EIGEN2DIR, GLEWDIR, OPENCSGDIR, OPENSCAD_LIBRARIES
|
||||
|
||||
2. Logs
|
||||
2. Location of logs
|
||||
|
||||
Logs of test runs are found in tests/build/Testing/Temporary
|
||||
Pretty-printed index.html is in a subdir of tests/build/Testing/Temporary
|
||||
A pretty-printed index.html is in a subdir of tests/build/Testing/Temporary
|
||||
Expected results are found in tests/regression/*
|
||||
Actual results are found in tests/build/testname-output/*
|
||||
|
||||
|
@ -77,28 +84,23 @@ Actual results are found in tests/build/testname-output/*
|
|||
|
||||
Cross-compiling of tests has not been automated nor tested
|
||||
|
||||
4. Image-based tests takes a long time, they fail, and it says 'return -11'
|
||||
4. Image-based tests takes a long time, they fail, and the log says 'return -11'
|
||||
|
||||
Imagemagick may have crashed. You can try using the alternate IM comparator
|
||||
based on Normalized Cross Correlation. Pass -DCOMPARATOR=ncc to cmake
|
||||
Imagemagick may have crashed while comparing the expected images to the
|
||||
test-run generated (actual) images. You can try using the alternate
|
||||
ImageMagick comparison method by by erasing CMakeCache, and re-running
|
||||
cmake with -DCOMPARATOR=ncc. This will enable the Normalized Cross
|
||||
Comparison method.
|
||||
|
||||
5. Testing images fails with 'morphology' not found for ImageMagick
|
||||
5. Testing images fails with 'morphology not found" for ImageMagick in the log
|
||||
|
||||
Your version of imagemagick is old. Upgrade, or pass -DCOMPARATOR=old to
|
||||
cmake. The comparison will be of lowered reliability.
|
||||
|
||||
6. Unexplained or bizarre errors.
|
||||
6. Other issues
|
||||
|
||||
This can happen on dynamic-library systems (linux) where you try to use
|
||||
your own version of a library while the system still has another version
|
||||
under the system paths. You can diagnose this by looking at your cmake
|
||||
log as well as your sysinfo.txt file, as well as running 'ldd' against
|
||||
your binaries, to make sure that the proper versions of libraries are
|
||||
getting compiled and linked with the test binaries.
|
||||
|
||||
7. Other issues
|
||||
|
||||
The OpenSCAD User Manual has a section on buildling. Check there for updates:
|
||||
The OpenSCAD User Manual has a section on buildling. Please check there
|
||||
for updates:
|
||||
|
||||
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual
|
||||
|
||||
|
|
38
eigen2.pri
38
eigen2.pri
|
@ -1,20 +1,36 @@
|
|||
eigen2 {
|
||||
|
||||
CONFIG(mingw-cross-env) {
|
||||
EIGEN2_INCLUDEPATH = mingw-cross-env/include/eigen2
|
||||
}
|
||||
|
||||
# Optionally specify location of Eigen2 using the
|
||||
# OPENSCAD_LIBRARIES env. variable
|
||||
isEmpty(EIGEN2_INCLUDEPATH) {
|
||||
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
|
||||
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
|
||||
exists($$OPENSCAD_LIBRARIES_DIR/include/eigen2) {
|
||||
EIGEN2_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/eigen2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Optionally specify location of Eigen2 using the
|
||||
# EIGEN2DIR env. variable
|
||||
EIGEN2_DIR = $$(EIGEN2DIR)
|
||||
!isEmpty(EIGEN2_DIR) {
|
||||
EIGEN2_INCLUDEPATH = $$EIGEN2_DIR
|
||||
}
|
||||
else {
|
||||
CONFIG(mingw-cross-env) {
|
||||
EIGEN2_INCLUDEPATH = mingw-cross-env/include/eigen2
|
||||
} else {
|
||||
freebsd-g++: EIGEN2_INCLUDEPATH *= /usr/local/include/eigen2
|
||||
macx: EIGEN2_INCLUDEPATH *= /opt/local/include/eigen2
|
||||
!macx:!freebsd-g++:!win32:EIGEN2_INCLUDEPATH *= /usr/include/eigen2
|
||||
isEmpty(EIGEN2_INCLUDEPATH) {
|
||||
EIGEN2_DIR = $$(EIGEN2DIR)
|
||||
!isEmpty(EIGEN2_DIR) {
|
||||
EIGEN2_INCLUDEPATH = $$EIGEN2_DIR
|
||||
message("EIGEN2 location: $$EIGEN2_INCLUDEPATH")
|
||||
}
|
||||
}
|
||||
|
||||
isEmpty(EIGEN2_INCLUDEPATH) {
|
||||
freebsd-g++: EIGEN2_INCLUDEPATH = /usr/local/include/eigen2
|
||||
macx: EIGEN2_INCLUDEPATH = /opt/local/include/eigen2
|
||||
linux*: EIGEN2_INCLUDEPATH = /usr/include/eigen2
|
||||
}
|
||||
|
||||
# eigen2 being under 'include/eigen2' needs special prepending
|
||||
QMAKE_INCDIR_QT = $$EIGEN2_INCLUDEPATH $$QMAKE_INCDIR_QT
|
||||
|
||||
|
|
|
@ -65,21 +65,8 @@ endif()
|
|||
#
|
||||
|
||||
# Boost
|
||||
if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
|
||||
set(BOOST_ROOT "$ENV{OPENSCAD_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if (NOT $ENV{BOOSTDIR} STREQUAL "")
|
||||
set(BOOST_DIR "$ENV{BOOSTDIR}")
|
||||
endif()
|
||||
|
||||
if (NOT ${BOOST_DIR} STREQUAL "")
|
||||
set(BOOST_ROOT ${BOOST_DIR})
|
||||
message(STATUS "BOOST_ROOT: " ${BOOST_ROOT})
|
||||
set(Boost_NO_SYSTEM_PATHS "TRUE")
|
||||
set(Boost_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
# Update this if FindBoost.cmake gets out of sync with the current boost release
|
||||
# set(Boost_ADDITIONAL_VERSIONS "1.47.0" "1.46.0")
|
||||
|
||||
if (WIN32)
|
||||
set(Boost_USE_STATIC_LIBS TRUE)
|
||||
|
@ -87,8 +74,23 @@ if (WIN32)
|
|||
set(BOOST_THREAD_USE_LIB TRUE)
|
||||
endif()
|
||||
|
||||
# Update this if FindBoost.cmake gets out of sync with the current boost release
|
||||
# set(Boost_ADDITIONAL_VERSIONS "1.47.0" "1.46.0")
|
||||
if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
|
||||
set(BOOST_ROOT "$ENV{OPENSCAD_LIBRARIES}")
|
||||
if (EXISTS ${BOOST_ROOT}/include/boost)
|
||||
# if boost is under OPENSCAD_LIBRARIES, then
|
||||
# don't look in the system paths (workaround FindBoost.cmake bug)
|
||||
set(Boost_NO_SYSTEM_PATHS "TRUE")
|
||||
message(STATUS "BOOST_ROOT: " ${BOOST_ROOT})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT $ENV{BOOSTDIR} STREQUAL "")
|
||||
set(BOOST_ROOT "$ENV{BOOSTDIR}")
|
||||
set(Boost_NO_SYSTEM_PATHS "TRUE")
|
||||
set(Boost_DEBUG TRUE)
|
||||
message(STATUS "BOOST_ROOT: " ${BOOST_ROOT})
|
||||
endif()
|
||||
|
||||
find_package( Boost 1.35.0 COMPONENTS thread program_options REQUIRED)
|
||||
if(Boost_FOUND)
|
||||
message(STATUS "Boost includes found: " ${Boost_INCLUDE_DIRS})
|
||||
|
@ -132,16 +134,19 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||
endif()
|
||||
|
||||
if (NOT EIGEN2_INCLUDE_DIR)
|
||||
if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
|
||||
set(EIGEN2_FIND_HINTS "$ENV{OPENSCAD_LIBRARIES}/include/eigen2")
|
||||
endif()
|
||||
set(EIGEN2_FIND_HINTS ${EIGEN2_FIND_HINTS} $ENV{EIGEN2DIR})
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
set(EIGEN2_FIND_PATHS /usr/local/include/eigen2)
|
||||
else()
|
||||
set(EIGEN2_FIND_PATHS /opt/local/include/eigen2 /usr/include/eigen2)
|
||||
endif()
|
||||
find_path(EIGEN2_INCLUDE_DIR
|
||||
Eigen/Core
|
||||
HINTS $ENV{EIGEN2DIR}
|
||||
PATHS /opt/local/include/eigen2 /usr/include/eigen2)
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
find_path(EIGEN2_INCLUDE_DIR
|
||||
Eigen/Core
|
||||
HINTS $ENV{EIGEN2DIR}
|
||||
PATHS /usr/local/include/eigen2 )
|
||||
endif()
|
||||
HINTS ${EIGEN2_FIND_HINTS}
|
||||
PATHS ${EIGEN2_FIND_PATHS})
|
||||
if (NOT EIGEN2_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "Eigen2 not found")
|
||||
else()
|
||||
|
@ -211,8 +216,13 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/parser_yacc.c PROPERTIES
|
|||
if (NOT $ENV{CGALDIR} STREQUAL "")
|
||||
set(CGAL_DIR "$ENV{CGALDIR}")
|
||||
elseif (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
|
||||
set(CGAL_DIR "$ENV{OPENSCAD_LIBRARIES}/lib/CGAL")
|
||||
set(CMAKE_MODULE_PATH "${CGAL_DIR}")
|
||||
if (EXISTS "$ENV{OPENSCAD_LIBRARIES}/lib/CGAL")
|
||||
set(CGAL_DIR "$ENV{OPENSCAD_LIBRARIES}/lib/CGAL")
|
||||
set(CMAKE_MODULE_PATH "${CGAL_DIR}")
|
||||
elseif (EXISTS "$ENV{OPENSCAD_LIBRARIES}/include/CGAL")
|
||||
set(CGAL_DIR "$ENV{OPENSCAD_LIBRARIES}")
|
||||
set(CMAKE_MODULE_PATH "${CGAL_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "CGAL_DIR: " ${CGAL_DIR})
|
||||
find_package(CGAL REQUIRED)
|
||||
|
|
Loading…
Reference in New Issue