summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-11 04:08:04 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-11 04:08:04 (GMT)
commit7cb3ea77ff090e136eb4a9536a394b3766908d17 (patch)
tree3c2ea1c7982e922d58a3076a7b998eee0ef31d10 /tests
parentd46ce3fb8150fe01c0c07fac11ea2e9a8ed97038 (diff)
Build glib2 and gettext on Mac, Find macro for glib2
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt23
-rw-r--r--tests/FindGLIB2.cmake27
2 files changed, 35 insertions, 15 deletions
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}")
contact: Jan Huwald // Impressum