Hi All,
In WIN32, building SG, due to the fact that I am
using STATIC OSG and pthread libraries, I added two
entries - OSG_LIBRARY_STATIC and PTW32_STATIC_LIB
to the CMake GUI...
But on SG generation done get
CMake Warning:
Manually-specified variables were not used
by the project.
Well, YES they ARE! See a number of OSG headers
used in SG, and see FG Main\bootstrap.cxx,
Main\util.cxx and Main\fg_os_osgviewer.cxx
and maybe other places...
How, where do I add these - they can default
OFF - to avoid this CMake warning?
That seems important so they will ALSO be added
to the preprocessor definition of ALL projects...
I can see in the root CMakeLists.txt, and entry
set(MSVC_FLAGS "-DWIN32 -DNOMINMAX ...etc... ")
but this is NOT an OPTIONAL addition...
Then I can see other 'options' like
<root>/CMakeLists.txt
option(SIMGEAR_SHARED "Set to ON...etc" OFF)
Then in
simgear\CMakeLists.txt
if(SIMGEAR_SHARED)
...
endif(SIMGEAR_SHARED)
Or another option, JPEG_FACTORY
<root>/CMakeLists.txt
option(JPEG_FACTORY "Enable JPEG..." OFF)
Then in simgear\screen\CMakeList.txt
if(JPEG_FACTORY)
list(APPEND SOURCE jpgfactory.cxx)
...
endif()
So I can sort of see adding to -
<root>/CMakeLists.txt
option(OSG_LIBRARY_STATIC
"Set ON to link with OSG static libraries." OFF)
option(PTW32_STATIC_LIB
"Set ON to ink with static pthread library." OFF)
Then maybe
if(OSG_LIBRARY_STATIC)
set(MSVC_FLAGS "${MSVC_FLAGS} -DOSG_LIBRARY_STATIC")
endif()
if(PTW32_STATIC_LIB)
set(MSVC_FLAGS "${MSVC_FLAGS} -DPTW32_STATIC_LIB")
endif()
OR maybe better, as I read more -
===============
if(WIN32)
if(MSVC)
if(OSG_LIBRARY_STATIC)
set(ADDED_FLAGS "${ADDED_FLAGS} -DOSG_LIBRARY_STATIC")
endif()
if(PTW32_STATIC_LIB)
set(ADDED_FLAGS "${ADDED_FLAGS} -DPTW32_STATIC_LIBRARY")
endif()
set(MSVC_FLAGS "-DWIN32 -DNOMINMAX etc ${ADDED_FLAGS}")
endif()
...
Will try that...
YOW, that seemed to have WORKED ;=))
And maybe an improvement would be to have a user
STRING input option, say ADDED_MSVC_FLAGS, where
a user could add these, and any other not thought of
yet options, to the MSVC preprocessor definitions...
but not sure how to set that up yet...
Put me down as an EXPERT CMake tactician ;=))))
Not really, but learning more each day...
Regards,
Geoff.
PS: James, just read your reply as I was posting
this, so will reply on it tomorrow...
PPS: Now on cmake of FG, after adding the
above STATIC stuff there as well, but have run
into the 'stupid' error -
missing SIMGEAR_VERSION_OK,
but again will have to address that tomorrow...
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@list...
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
opensubscriber is not affiliated with the authors of this message nor responsible for its content.