openthreads: build standalone and fix static build

This commit is contained in:
Tony Theodore 2016-01-11 16:34:11 +11:00
parent f50c9c5263
commit a3124bf7a7
2 changed files with 48 additions and 34 deletions

View File

@ -6,54 +6,67 @@ Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Rashad Kanavath <rashad.kanavath@c-s.fr>
Date: Mon, 11 Jan 2016 15:33:57 +1100
Subject: [PATCH] only build openthreads
Subject: [PATCH] build standalone openthreads
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1046,16 +1046,7 @@ ENDIF()
@@ -649,7 +649,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th
#
IF(ANDROID)
ANDROID_3RD_PARTY()
-ELSE()
+ELSEIF(NOT OPENTHREADS_STANDALONE)
# Common to all platforms except android:
FIND_PACKAGE(Freetype)
FIND_PACKAGE(Inventor)
@@ -787,7 +787,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
# Image readers/writers depend on 3rd party libraries except for OS X which
# can use Quicktime.
-IF(NOT ANDROID)
+IF(NOT ANDROID AND NOT OPENTHREADS_STANDALONE)
IF(NOT APPLE)
FIND_PACKAGE(GIFLIB)
FIND_PACKAGE(JPEG)
@@ -1044,7 +1044,9 @@ ELSE ()
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
ENDIF()
# OSG Core
-ADD_SUBDIRECTORY(src)
-
-IF (BUILD_OSG_APPLICATIONS AND NOT ANDROID)
- ADD_SUBDIRECTORY(applications)
-ENDIF()
-
-IF (BUILD_OSG_EXAMPLES)
- ADD_SUBDIRECTORY(examples)
-ENDIF()
-
+IF(OPENTHREADS_STANDALONE)
+ADD_SUBDIRECTORY(src/OpenThreads)
+ELSE()
# OSG Core
ADD_SUBDIRECTORY(src)
@@ -1055,7 +1057,7 @@ ENDIF()
IF (BUILD_OSG_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()
-
+ENDIF()
IF(APPLE AND NOT ANDROID)
@@ -1251,24 +1242,7 @@ ENDIF()
@@ -1250,7 +1252,9 @@ IF(CMAKE_CPACK_COMMAND)
ENDIF()
# Generate pkg-config configuration files
-SET(PKGCONFIG_FILES
- openscenegraph
- openscenegraph-osg
- openscenegraph-osgDB
- openscenegraph-osgFX
- openscenegraph-osgGA
- openscenegraph-osgParticle
- openscenegraph-osgSim
- openscenegraph-osgText
- openscenegraph-osgUtil
- openscenegraph-osgTerrain
- openscenegraph-osgManipulator
- openscenegraph-osgViewer
- openscenegraph-osgWidget
- openscenegraph-osgShadow
- openscenegraph-osgAnimation
- openscenegraph-osgVolume
-)
-
+IF(OPENTHREADS_STANDALONE)
+SET(PKGCONFIG_FILES)
+ELSE()
SET(PKGCONFIG_FILES
openscenegraph
openscenegraph-osg
@@ -1269,6 +1273,7 @@ SET(PKGCONFIG_FILES
openscenegraph-osgAnimation
openscenegraph-osgVolume
)
+ENDIF()
IF(QT4_FOUND OR Qt5Widgets_FOUND )
SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt)

View File

@ -17,9 +17,10 @@ endef
define $(PKG)_BUILD
mkdir '$(1).build'
cd '$(1).build' && '$(TARGET)-cmake' \
-DBUILD_SHARED_LIBS=$(CMAKE_SHARED_BOOL) \
-DDYNAMIC_OPENTHREADS=$(CMAKE_SHARED_BOOL) \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DPKG_CONFIG_EXECUTABLE='$(PREFIX)/bin/$(TARGET)-pkg-config' \
-DOPENTHREADS_STANDALONE=TRUE \
-DOSG_USE_QT=FALSE \
-D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE=1 \
-D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED=1 \
'$(1)'