Hi,
Attached are two small patch files needed to
allow using OSG, and FREEGLUT static libraries.
Yes, I know some of you wonder why ;=)), but then
you do NOT work in windows, and do not quite understand
the appealing idea of being able to copy ONE files,
fgfs.exe, from one windows machine to another, and it
runs...
That is do not need to carry around a dozen or
so big OSG DLL ;=)) which of course is best done in a
windows installer anyway... just copy one EXE file...
For SG this involves just adding two 'options' to
CMakeLists.txt - OSG_LIBRARY_STATIC and FREEGLUT_STATIC.
These are OFF by default, but if enabled, add some
additional MSVC_FLAGS...
For FG this involves adding the same two options to
CmakeLists.txt, but also -
(a) In src/Main/bootstrap.cxx, chopping the code
pthread_win32_process_attach_np(); Thanks to Eric
for alerting me that this pthread library is no longer
required, so this should be removed anyway...
(b) In src/Main/fg_os_osgviewer.cxx, removing the
#ifdef OSG_PNG_ENABLED around the
USE_OSGPLUGIN(png)
As I see it osgdb_png is ABSOLUTELY required, and
thus should NOT be an option, like jpeg and tiff
remain...
This could also be done by emitting an OSG_PNG_ENABLED
from the CMakeLists.txt, but it seems to make more
sense to remove the macro...
Very small changes indeed...
This all 'static' build does still require one manual
change in the MSVC build files, due to the fact
that I have not yet found a way to 'include' the
appropriate built-in osgdb_???? read libraries.
And found when you include osgdb_ive then it is
also necessary to add osgVolume and osgTerrain to
the list of core osg libraries...
At this stage I think this may require customization
of the FindOpenSceneGraph.cmake set of modules, but
still to fully research this... to find an automated
way...
But at this stage it is a small easy manual step...
Have thus started to finalise my -
http://geoffair.org/fg/fgfs-055.htm
where I have placed zipped copies of my '3rdparty'
folder, to give others a quick start into building
SG/FG 'static' ;=)) from current git...
HTH.
Regards,
Geoff.
attached: sg-cmake-01.patch.txt and
fg-cmake-01.patch.txt
diff -uwr C:\FGCVS\flightgear\source\CMakeLists.txt flightgear\CMakeLists.txt
--- C:\FGCVS\flightgear\source\CMakeLists.txt Mon Nov 14 17:37:47 2011
+++ flightgear\CMakeLists.txt Fri Nov 18 15:20:32 2011
@@ -94,6 +94,8 @@
option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF)
option(WITH_FGPANEL "Set to ON to build the fgpanel application" ON)
option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
+option(OSG_LIBRARY_STATIC "Set to ON to build SimGear with OSG static
libraries" OFF)
+option(FREEGLUT_STATIC "Set to ON to build SimGear with freeglut static
libraries" OFF)
if (MSVC)
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH)
@@ -245,8 +247,13 @@
# foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
# SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
# endforeach(warning)
-
- set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES
-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-D__CRT_NONSTDC_NO_WARNINGS")
+ if(OSG_LIBRARY_STATIC)
+ set(ADDED_FLAGS "${ADDED_FLAGS} -DOSG_LIBRARY_STATIC")
+ endif(OSG_LIBRARY_STATIC)
+ if(FREEGLUT_STATIC)
+ set(ADDED_FLAGS "${ADDED_FLAGS} -DFREEGLUT_STATIC")
+ endif(FREEGLUT_STATIC)
+ set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES
-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS
${ADDED_FLAGS}")
if (${MSVC_VERSION} EQUAL 1600)
set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
endif (${MSVC_VERSION} EQUAL 1600)
diff -uwr C:\FGCVS\flightgear\source\src\Main\bootstrap.cxx
flightgear\src\Main\bootstrap.cxx
--- C:\FGCVS\flightgear\source\src\Main\bootstrap.cxx Tue Oct 25 09:48:54 2011
+++ flightgear\src\Main\bootstrap.cxx Thu Nov 17 18:12:56 2011
@@ -196,10 +196,6 @@
signal(SIGPIPE, SIG_IGN);
#endif
-#ifdef PTW32_STATIC_LIB
- // Initialise static pthread win32 lib
- pthread_win32_process_attach_np ();
-#endif
_bootstrap_OSInit = 0;
#if defined(__FreeBSD__)
diff -uwr C:\FGCVS\flightgear\source\src\Main\fg_os_osgviewer.cxx
flightgear\src\Main\fg_os_osgviewer.cxx
--- C:\FGCVS\flightgear\source\src\Main\fg_os_osgviewer.cxx Sun Oct 09
16:38:11 2011
+++ flightgear\src\Main\fg_os_osgviewer.cxx Thu Nov 17 18:12:50 2011
@@ -70,11 +70,9 @@
USE_OSGPLUGIN(pnm);
USE_OSGPLUGIN(rgb);
USE_OSGPLUGIN(tga);
+USE_OSGPLUGIN(png);
#ifdef OSG_JPEG_ENABLED
USE_OSGPLUGIN(jpeg);
-#endif
-#ifdef OSG_PNG_ENABLED
- USE_OSGPLUGIN(png);
#endif
#ifdef OSG_TIFF_ENABLED
USE_OSGPLUGIN(tiff);
diff -uwr C:\FGCVS\simgear\source\CMakeLists.txt simgear\CMakeLists.txt
--- C:\FGCVS\simgear\source\CMakeLists.txt Mon Nov 14 17:48:32 2011
+++ simgear\CMakeLists.txt Mon Nov 14 19:03:33 2011
@@ -51,6 +51,8 @@
option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON)
option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF)
+option(OSG_LIBRARY_STATIC "Set to ON to build SimGear with OSG static
libraries" OFF)
+option(FREEGLUT_STATIC "Set to ON to build SimGear with freeglut static
libraries" OFF)
if (MSVC)
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH)
@@ -195,8 +197,13 @@
# foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
# SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
# endforeach(warning)
-
- set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES
-D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996")
+ if(OSG_LIBRARY_STATIC)
+ set(ADDED_FLAGS "${ADDED_FLAGS} -DOSG_LIBRARY_STATIC")
+ endif(OSG_LIBRARY_STATIC)
+ if(FREEGLUT_STATIC)
+ set(ADDED_FLAGS "${ADDED_FLAGS} -DFREEGLUT_STATIC")
+ endif(FREEGLUT_STATIC)
+ set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES
-D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996 ${ADDED_FLAGS}")
endif(MSVC)
# assumed on Windows
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel