From f61293a935a0ae465e6fbc750deb61f150e003c6 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sun, 8 Jan 2017 10:23:46 +0100 Subject: [PATCH] Geoff McLane: 1. The variables SIMGEAR_CORE_LIBRARIES and SIMGEAR_CORE_LIBRARY_DEPENDENCIES are no longer set... hence the need to hard-code 'SimGearCore' in the target_link_libraries() 2. And -lfreetype means the linker must know the specific link path to it, while the variable FREETYPE_LIBRARIES contains the fully qualified path to the library. 3. Improved the 'found glut' message to show exactly what was found, and being used... This is due to the user possibly also have the near binary compatible glut32.lib found, which will fail in the link due to some freeglut extensions have been used. 4. Adding the define -DFREEGLUT_LIB_PRAGMAS=0 is necessary to stop the freeglut headers from using a MSVC pragma to declare the library, which will /not/ not be found... 5. In Windows the glew library is not -lGLEW, and even if it was, it would not be found, without adding a link_directories( path/to/library ), while the GLEW_LIBRARIES variable has the fully qualified path. --- utils/fgpanel/ApplicationProperties.cxx | 8 ++++++-- utils/fgpanel/CMakeLists.txt | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/utils/fgpanel/ApplicationProperties.cxx b/utils/fgpanel/ApplicationProperties.cxx index 0c26b8694..2224e0730 100644 --- a/utils/fgpanel/ApplicationProperties.cxx +++ b/utils/fgpanel/ApplicationProperties.cxx @@ -16,8 +16,12 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include -#include + +#ifdef _WIN32 +# include // for getcwd() +#else // !_WIN32 +# include +#endif #include "ApplicationProperties.hxx" diff --git a/utils/fgpanel/CMakeLists.txt b/utils/fgpanel/CMakeLists.txt index 732471b70..484c14261 100644 --- a/utils/fgpanel/CMakeLists.txt +++ b/utils/fgpanel/CMakeLists.txt @@ -80,19 +80,21 @@ add_executable(fgpanel target_link_libraries(fgpanel SimGearCore ${PNG_LIBRARIES} - ${SIMGEAR_CORE_LIBRARIES} - ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - -lfreetype + ${FREETYPE_LIBRARIES} ) if(${BCMHOST_INCLUDE_DIR} STREQUAL "BCMHOST_INCLUDE_DIR-NOTFOUND") find_package(GLUT REQUIRED) if(GLUT_FOUND) - message(STATUS "found glut") + message(STATUS "found GLUT inc ${GLUT_INCLUDE_DIR}, lib ${GLUT_LIBRARIES} ") + if (MSVC) + add_definitions( -DFREEGLUT_LIB_PRAGMAS=0 ) + endif () target_link_libraries(fgpanel + ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} - -lGLEW ${OPENGL_LIBRARIES} + ${GLEW_LIBRARIES} ) else(GLUT_FOUND) message(STATUS "glut NOT found, can't build fgpanel")