1
0
Fork 0

FGPanel: Re-order dependency checks

This commit is contained in:
James Turner 2020-04-02 09:04:25 +01:00
parent d0fd02fa8d
commit 36faef5ad9

View file

@ -2,6 +2,21 @@ find_package(PNG)
find_package(OpenGL)
find_package(Freetype)
find_package(GLUT)
find_package(GLEW)
if(NOT ${GLUT_FOUND})
message(WARNING "GLUT NOT found, can't build FGPanel")
set(WITH_FGPANEL 0)
return()
endif()
if(NOT ${GLEW_FOUND})
message(WARNING "GLEW NOT found, can't build FGPanel")
set(WITH_FGPANEL 0)
return()
endif()
if((NOT PNG_FOUND) OR (NOT OPENGL_FOUND) OR (NOT FREETYPE_FOUND))
message(WARNING "FGPanel enabled, but some dependencies are missing")
message(STATUS "libPNG: ${PNG_FOUND}")
@ -16,11 +31,6 @@ find_path(BCMHOST_INCLUDE_DIR
NO_DEFAULT_PATH
)
include_directories(
${FREETYPE_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
)
set(TARGET_SOURCES
main.cxx
ApplicationProperties.hxx
@ -71,8 +81,23 @@ target_link_libraries(fgpanel
SimGearCore
${PNG_LIBRARIES}
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
${GLEW_LIBRARIES}
)
target_include_directories(fgpanel PUBLIC
${FREETYPE_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
)
if(MSVC)
target_compile_definitions(fgpanel PUBLIC
-DFREEGLUT_LIB_PRAGMAS=0
)
endif(MSVC)
if(BCMHOST_INCLUDE_DIR)
message(STATUS "found Raspberry Pi")
@ -81,6 +106,8 @@ if(BCMHOST_INCLUDE_DIR)
GLES_utils.hxx
)
target_include_directories(fgpanel-egl PUBLIC
${FREETYPE_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${BCMHOST_INCLUDE_DIR}
${BCMHOST_INCLUDE_DIR}/interface/vcos/pthreads
${BCMHOST_INCLUDE_DIR}/interface/vmcs_host/linux
@ -105,36 +132,8 @@ else(BCMHOST_INCLUDE_DIR)
message(STATUS "FGPanel (Raspberry Pi) : DISABLED")
endif(BCMHOST_INCLUDE_DIR)
find_package(GLUT)
if(GLUT_FOUND)
message(STATUS "found GLUT inc ${GLUT_INCLUDE_DIR}, lib ${GLUT_LIBRARIES}")
if(MSVC)
target_compile_definitions(fgpanel PUBLIC
-DFREEGLUT_LIB_PRAGMAS=0
)
endif(MSVC)
find_package(GLEW)
if(GLEW_FOUND)
message(STATUS "found GLEW inc ${GLEW_INCLUDE_DIR}, lib ${GLEW_LIBRARIES}")
target_include_directories(fgpanel PUBLIC
${GLEW_INCLUDE_DIRS}
)
target_link_libraries(fgpanel
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
${GLEW_LIBRARIES}
)
else(GLEW_FOUND)
message(WARNING "GLEW NOT found, can't build FGPanel")
set(WITH_FGPANEL 0)
endif(GLEW_FOUND)
else(GLUT_FOUND)
message(WARNING "GLUT NOT found, can't build FGPanel")
set(WITH_FGPANEL 0)
endif(GLUT_FOUND)
if(WITH_FGPANEL)
message(STATUS "FGPanel : ENABLED")