diff options
-rwxr-xr-x | scripts/macosx-build-dependencies.sh | 34 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 23 | ||||
-rw-r--r-- | tests/FindGLIB2.cmake | 27 |
3 files changed, 59 insertions, 25 deletions
diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh index 5e26fee..b61c656 100755 --- a/scripts/macosx-build-dependencies.sh +++ b/scripts/macosx-build-dependencies.sh @@ -285,27 +285,40 @@ build_glew() make GLEW_DEST=$DEPLOYDIR CC=$CC CFLAGS.EXTRA="-no-cpp-precomp -dynamic -fno-common -mmacosx-version-min=$MAC_OSX_VERSION_MIN $GLEW_EXTRA_FLAGS -arch x86_64" LDFLAGS.EXTRA="-mmacosx-version-min=$MAC_OSX_VERSION_MIN $GLEW_EXTRA_FLAGS -arch x86_64" STRIP= install } -build_glib2() +build_gettext() { - version="$1" - maj_min_version="${version%.*}" #Drop micro + version=$1 + echo "Building gettext $version..." - if [ -e $DEPLOYDIR/lib/glib-2.0 ]; then - echo "glib2 already installed. not building" - return + cd "$BASEDIR"/src + rm -rf "gettext-$version" + if [ ! -f "glib-$version.tar.xz" ]; then + curl --insecure -LO "http://ftpmirror.gnu.org/gettext/gettext-$version.tar.gz" fi + tar xzf "gettext-$version.tar.gz" + cd "gettext-$version" + + ./configure --prefix="$DEPLOYDIR" + make -j4 + make install +} + +build_glib2() +{ + version=$1 + echo "Building glib2 $version..." - echo "Building glib2 $version..." cd "$BASEDIR"/src rm -rf "glib-$version" + maj_min_version="${version%.*}" #Drop micro if [ ! -f "glib-$version.tar.xz" ]; then curl --insecure -LO "http://ftp.gnome.org/pub/gnome/sources/glib/$maj_min_version/glib-$version.tar.xz" fi tar xJf "glib-$version.tar.xz" cd "glib-$version" - ./configure --prefix="$DEPLOYDIR" - make -j$NUMCPU + ./configure --disable-gtk-doc --disable-man --prefix="$DEPLOYDIR" CFLAGS="-I$DEPLOYDIR/include" LDFLAGS="-L$DEPLOYDIR/lib" + make -j4 make install } @@ -473,7 +486,8 @@ build_boost 1.54.0 # NB! For CGAL, also update the actual download URL in the function build_cgal 4.3 build_glew 1.10.0 -build_glib2 2.38.1 +build_gettext 0.18.3.1 +build_glib2 2.38.2 build_opencsg 1.3.2 if $OPTION_DEPLOY; then # build_sparkle andymatuschak 0ed83cf9f2eeb425d4fdd141c01a29d843970c20 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2533103..e590070 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}) @@ -413,16 +413,9 @@ if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "") 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}) +find_package(GLIB2 2.2.0 REQUIRED) +add_definitions(${GLIB2_DEFINITIONS}) +inclusion(GLIB2_DIR GLIB2_INCLUDE_DIRS) # Imagemagick @@ -595,7 +588,7 @@ set(OFFSCREEN_SOURCES ../src/OpenCSGRenderer.cc) add_library(tests-core STATIC ${CORE_SOURCES}) -target_link_libraries(tests-core ${OPENGL_LIBRARIES} ${GLIB2_LIBRARIES} ) +target_link_libraries(tests-core) set(TESTS-CORE-LIBRARIES ${OPENGL_LIBRARIES} ${GLIB2_LIBRARIES} ${Boost_LIBRARIES} ) add_library(tests-common STATIC ${COMMON_SOURCES}) @@ -616,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 @@ -636,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 diff --git a/tests/FindGLIB2.cmake b/tests/FindGLIB2.cmake new file mode 100644 index 0000000..b27b9a9 --- /dev/null +++ b/tests/FindGLIB2.cmake @@ -0,0 +1,27 @@ +find_package(PkgConfig REQUIRED) + +pkg_search_module(GLIB2 REQUIRED glib-2.0) +#message("GLIB2_LIBRARIES ${GLIB2_LIBRARIES}") +#message("GLIB2_LIBRARY_DIRS ${GLIB2_LIBRARY_DIRS}") +#message("GLIB2_LDFLAGS ${GLIB2_LDFLAGS}") +#message("GLIB2_LDFLAGS_OTHER ${GLIB2_LDFLAGS_OTHER}") +message("GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS}") +#message("GLIB2_CFLAGS ${GLIB2_CFLAGS}") +#message("GLIB2_CFLAGS_OTHER ${GLIB2_CFLAGS_OTHER}") +#message("GLIB2_LIBDIR ${GLIB2_LIBDIR}") + +set(GLIB2_DEFINITIONS ${GLIB2_CFLAGS_OTHER}) +#message("GLIB2_DEFINITIONS ${GLIB2_DEFINITIONS}") + +set(GLIB2_LIBRARY_NAMES ${GLIB2_LIBRARIES}) +set(GLIB2_LIBRARIES "") +foreach(GLIB2_LIB ${GLIB2_LIBRARY_NAMES}) +# message("lib: ${GLIB2_LIB}") + set(TMP TMP-NOTFOUND) + find_library(TMP NAMES ${GLIB2_LIB} + PATHS ${GLIB2_LIBRARY_DIRS} + NO_DEFAULT_PATH) +# message("TMP: ${TMP}") + list(APPEND GLIB2_LIBRARIES "${TMP}") +endforeach() +message("GLIB2_LIBRARIES: ${GLIB2_LIBRARIES}") |