diff options
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 370c8be..d76f498 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -366,10 +366,10 @@ if (NOT $ENV{CGALDIR} STREQUAL "") elseif (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "") if (EXISTS "$ENV{OPENSCAD_LIBRARIES}/lib/CGAL") set(CGAL_DIR "$ENV{OPENSCAD_LIBRARIES}/lib/CGAL") - set(CMAKE_MODULE_PATH "${CGAL_DIR}") + set(CMAKE_MODULE_PATH "${CGAL_DIR}" ${CMAKE_MODULE_PATH}) elseif (EXISTS "$ENV{OPENSCAD_LIBRARIES}/include/CGAL") set(CGAL_DIR "$ENV{OPENSCAD_LIBRARIES}") - set(CMAKE_MODULE_PATH "${CGAL_DIR}") + set(CMAKE_MODULE_PATH "${CGAL_DIR}" ${CMAKE_MODULE_PATH}) endif() endif() message(STATUS "CGAL_DIR: " ${CGAL_DIR}) @@ -383,12 +383,40 @@ if("${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}" VERSION_LESS 3.6) message(FATAL_ERROR "CGAL >= 3.6 required") endif() inclusion(CGAL_DIR CGAL_INCLUDE_DIRS) +#Remove bad BOOST libraries from CGAL 3rd party dependencies when they don't exist (such as on 64-bit Ubuntu 13.10). +#Libs of concern are /usr/lib/libboost_thread.so;/usr/lib/libboost_system.so; +#Confirmed bug in CGAL @ https://bugs.launchpad.net/ubuntu/+source/cgal/+bug/1242111 +string(FIND "${CGAL_3RD_PARTY_LIBRARIES}" "/usr/lib/libboost_system.so" FIND_POSITION ) +if(NOT "-1" STREQUAL ${FIND_POSITION} ) + if(NOT EXISTS "/usr/lib/libboost_system.so") + MESSAGE( STATUS "CGAL_3RD_PARTY_LIBRARIES:Removing non-existent /usr/lib/libboost_system.so" ) + string(REPLACE "/usr/lib/libboost_system.so" "" CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES}) + endif() +endif() +string(FIND "${CGAL_3RD_PARTY_LIBRARIES}" "/usr/lib/libboost_thread.so" FIND_POSITION ) +if(NOT "-1" STREQUAL ${FIND_POSITION} ) + if(NOT EXISTS "/usr/lib/libboost_thread.so") + MESSAGE( STATUS "CGAL_3RD_PARTY_LIBRARIES:Removing non-existent /usr/lib/libboost_thread.so" ) + string(REPLACE "/usr/lib/libboost_thread.so" "" CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES}) + endif() +endif() if(${CMAKE_CXX_COMPILER} MATCHES ".*clang.*" AND NOT ${CGAL_CXX_FLAGS_INIT} STREQUAL "" ) string(REPLACE "-frounding-math" "" CGAL_CXX_FLAGS_INIT ${CGAL_CXX_FLAGS_INIT}) string(REPLACE "--param=ssp-buffer-size=4" "" CGAL_CXX_FLAGS_INIT ${CGAL_CXX_FLAGS_INIT}) endif() +if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "") + # Force pkg-config to look _only_ in the local library folder + # in case OPENSCAD_LIBRARIES is set. + set(ENV{PKG_CONFIG_PATH} "$ENV{OPENSCAD_LIBRARIES}/lib/pkgconfig") + set(ENV{PKG_CONFIG_LIBDIR} "$ENV{OPENSCAD_LIBRARIES}/lib/pkgconfig") +endif() + +find_package(GLIB2 2.2.0 REQUIRED) +add_definitions(${GLIB2_DEFINITIONS}) +inclusion(GLIB2_DIR GLIB2_INCLUDE_DIRS) + # Imagemagick if (SKIP_IMAGEMAGICK) @@ -560,8 +588,8 @@ set(OFFSCREEN_SOURCES ../src/OpenCSGRenderer.cc) add_library(tests-core STATIC ${CORE_SOURCES}) -target_link_libraries(tests-core ${OPENGL_LIBRARIES}) -set(TESTS-CORE-LIBRARIES ${OPENGL_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(tests-core ${OPENGL_LIBRARIES} ${GLIB2_LIBRARIES} ) +set(TESTS-CORE-LIBRARIES ${OPENGL_LIBRARIES} ${GLIB2_LIBRARIES} ${Boost_LIBRARIES} ) add_library(tests-common STATIC ${COMMON_SOURCES}) target_link_libraries(tests-common tests-core) @@ -581,7 +609,7 @@ set(TESTS-NOCGAL-LIBRARIES ${TESTS-CORE-LIBRARIES}) # modulecachetest # add_executable(modulecachetest modulecachetest.cc) -target_link_libraries(modulecachetest tests-nocgal ${TESTS-NOCGAL-LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(modulecachetest tests-nocgal ${TESTS-NOCGAL-LIBRARIES}) # # csgtexttest @@ -601,7 +629,7 @@ target_link_libraries(cgalcachetest tests-cgal ${TESTS-CGAL-LIBRARIES} ${GLEW_LI # add_executable(openscad_nogui ../src/openscad.cc) set_target_properties(openscad_nogui PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN -DENABLE_CGAL -DENABLE_OPENCSG ${CGAL_CXX_FLAGS_INIT}") -target_link_libraries(openscad_nogui tests-offscreen tests-cgal tests-nocgal ${TESTS-CORE-LIBRARIES} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${Boost_LIBRARIES} ${OPENCSG_LIBRARY} ${COCOA_LIBRARY} ) +target_link_libraries(openscad_nogui tests-offscreen tests-cgal tests-nocgal ${TESTS-CORE-LIBRARIES} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${COCOA_LIBRARY} ) # # GUI binary tests @@ -781,8 +809,10 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES} ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/dim-all.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-test.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-indexing.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-unicode.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/vector-values.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/search-tests.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/search-tests-unicode.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/recursion-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/value-reassignment-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/value-reassignment-tests2.scad |