diff options
author | Brody Kenrick <user.fake@server.userfake> | 2013-12-05 04:56:50 (GMT) |
---|---|---|
committer | Brody Kenrick <user.fake@server.userfake> | 2013-12-05 04:56:50 (GMT) |
commit | d3b82dcac0cbd6bb46c3236d1183f84b76b44748 (patch) | |
tree | f5b2fccb043a9961b479e2f54c7c756175cca8c1 | |
parent | 89c21d07c46294e7c28f8852a89550b17d7a4402 (diff) |
Fix for bad boost libraries
Get this error because of a search for a non-existent library on linux64
-----------
[ 69%] Built target tests-cgal
Scanning dependencies of target cgalcachetest
[ 70%] Building CXX object
CMakeFiles/cgalcachetest.dir/cgalcachetest.cc.o
make[2]: *** No rule to make target `/usr/lib/libboost_thread.so',
needed by `cgalcachetest'. Stop.
make[1]: *** [CMakeFiles/cgalcachetest.dir/all] Error 2
make: *** [all] Error 2
[2]+ Done gedit openscad.pro (wd:
~/git/openscad_unicode)
----------
-rw-r--r-- | tests/CMakeLists.txt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0477a45..4cc86f5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -377,11 +377,45 @@ if("${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}" VERSION_LESS 3.6) endif() inclusion(CGAL_DIR CGAL_INCLUDE_DIRS) +#Get rid of bad libraries suggested for BOOST dependencies (they don't exist on some machines and cause build failures). +#/usr/lib/libboost_thread.so;/usr/lib/libboost_system.so; +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( WARNING "CGAL_3RD_PARTY_LIBRARIES:Found erroneous /usr/lib/libboost_system.so -- stripping" ) + 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( WARNING "CGAL_3RD_PARTY_LIBRARIES:Found erroneous /usr/lib/libboost_thread.so -- stripping" ) + 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 libraries (system installed or dependency built) using pkg-config +find_package(PkgConfig REQUIRED) + +#GLib-2 +pkg_search_module(GLIB2 REQUIRED glib-2.0>=2.2.0) +#Can't use the CXXFlags directly as they are ;-separated +string(REPLACE ";" " " GLIB2_CFLAGS "${GLIB2_CFLAGS}") +message(STATUS "glib-2.0 found: ${GLIB2_VERSION}") + +add_definitions(${GLIB2_CFLAGS}) + # Imagemagick if (SKIP_IMAGEMAGICK) |