diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-27 13:16:34 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-27 13:16:34 (GMT) |
commit | 8b64fa49984136d900a5f7496c392d63448d3292 (patch) | |
tree | 2c93ce70485c545b64bfe2f43fc70cf26b618ba6 | |
parent | 27983e001b574eb5087a7d4cc6d33871891a9478 (diff) | |
parent | cde24f681580f8911ac4fe29265b169a0bac5f49 (diff) |
Merge branch 'buildfix'
-rw-r--r-- | boost.pri | 63 | ||||
-rw-r--r-- | doc/testing.txt | 46 | ||||
-rw-r--r-- | eigen2.pri | 38 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 60 |
4 files changed, 132 insertions, 75 deletions
@@ -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 - } + # 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 + } + } + } } - unix|macx { - isEmpty(BOOST_IS_MT) { - LIBS += -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 + } diff --git a/doc/testing.txt b/doc/testing.txt index 4623a96..a50c95f 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -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. - -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 +6. 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 @@ -1,20 +1,36 @@ eigen2 { + + CONFIG(mingw-cross-env) { + EIGEN2_INCLUDEPATH = mingw-cross-env/include/eigen2 + } + # Optionally specify location of Eigen2 using the - # EIGEN2DIR env. variable - EIGEN2_DIR = $$(EIGEN2DIR) - !isEmpty(EIGEN2_DIR) { - EIGEN2_INCLUDEPATH = $$EIGEN2_DIR + # 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 + } + } } - 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 + + # Optionally specify location of Eigen2 using the + # EIGEN2DIR env. variable + 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 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2c49d94..b18669c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -65,30 +65,32 @@ endif() # # Boost +# 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) + set(BOOST_STATIC TRUE) + set(BOOST_THREAD_USE_LIB TRUE) +endif() + 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_DIR "$ENV{BOOSTDIR}") -endif() - -if (NOT ${BOOST_DIR} STREQUAL "") - set(BOOST_ROOT ${BOOST_DIR}) - message(STATUS "BOOST_ROOT: " ${BOOST_ROOT}) + set(BOOST_ROOT "$ENV{BOOSTDIR}") set(Boost_NO_SYSTEM_PATHS "TRUE") set(Boost_DEBUG TRUE) + message(STATUS "BOOST_ROOT: " ${BOOST_ROOT}) endif() - -if (WIN32) - set(Boost_USE_STATIC_LIBS TRUE) - set(BOOST_STATIC TRUE) - 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") 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) |