Skip to content

Commit

Permalink
Build fixes for GLEW on linux/mac
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Jul 11, 2024
1 parent 80e7408 commit c909c71
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 73 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y protobuf-compiler libprotobuf-dev
sudo apt-get install -y libtinyxml-dev
sudo apt-get install -y libglew-dev
- uses: actions/checkout@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
brew install protobuf
brew install poco
brew install open-scene-graph
brew install glew
sudo xcode-select -p
- uses: actions/checkout@v2
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ if(OSGEARTH_ASSUME_SINGLE_THREADED_OSG)
add_definitions(-DOSGEARTH_SINGLE_THREADED_OSG)
endif()

# imgui?
if(OSGEARTH_BUILD_IMGUI_NODEKIT)
set(OSGEARTH_HAVE_IMGUI_NODEKIT ON) # for BuildConfig
endif()


# Bring in our utility macros that sub-projects will use to configure themselves.
include(cmake/osgearth-macros.cmake)

Expand Down
26 changes: 13 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

if(OSGEARTH_BUILD_IMGUI_NODEKIT)
add_subdirectory(osgEarthImGui)
endif()

#optionals:
if(OSGEARTH_BUILD_PROCEDURAL_NODEKIT)
add_subdirectory(osgEarthProcedural)
endif()
Expand All @@ -17,26 +19,24 @@ if(OSGEARTH_BUILD_SILVERLINING_NODEKIT)
add_subdirectory(osgEarthSilverLining)
endif()

if(OSGEARTH_BUILD_TOOLS OR OSGEARTH_BUILD_EXAMPLES)
add_subdirectory( applications )
endif()

if(OSGEARTH_BUILD_TESTS AND NOT OSGEARTH_BUILD_PLATFORM_IPHONE)
add_subdirectory( tests )
endif()

if(OSGEARTH_BUILD_LEGACY_SPLAT_NODEKIT)
add_subdirectory(osgEarthSplat)
endif()

if(OSGEARTH_BUILD_IMGUI_NODEKIT)
add_subdirectory(osgEarthImGui)
endif()

# plugins:
add_subdirectory(osgEarthDrivers)


if(OSGEARTH_BUILD_TOOLS OR OSGEARTH_BUILD_EXAMPLES)
add_subdirectory(applications)
endif()

if(OSGEARTH_BUILD_TESTS AND NOT OSGEARTH_BUILD_PLATFORM_IPHONE)
add_subdirectory(tests)
endif()

# Do this LAST since we are generating the BuildConfig header
# based on everything that's happened so far
add_subdirectory(osgEarth)

set_property(TARGET osgEarth PROPERTY FOLDER "Core")
105 changes: 51 additions & 54 deletions src/osgEarthImGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,59 @@
#
find_package(GLEW REQUIRED)

if(GLEW_FOUND)
set(OSGEARTH_HAVE_IMGUI_NODEKIT ON PARENT_SCOPE) # for BuildConfig
set(OSGEARTH_HAVE_IMGUI_NODEKIT ON PARENT_SCOPE) # for BuildConfig

set(LIB_NAME osgEarthImGui)

# This forces the export of all ImGui symbols on Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIB_NAME osgEarthImGui)

# This forces the export of all ImGui symbols on Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# embedded ImGui source code:
set(IMGUI_HEADERS imgui.h imgui_internal.h imgui_impl_opengl3.h imconfig.h)
set(IMGUI_SOURCES imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_impl_opengl3.cpp)

# embedded ImGui source code:
set(IMGUI_HEADERS imgui.h imgui_internal.h imgui_impl_opengl3.h imconfig.h)
set(IMGUI_SOURCES imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_impl_opengl3.cpp)
set(STOCK_PANELS
AnnotationsGUI
CameraGUI
ContentBrowserGUI
#DateTimeGUI
EnvironmentGUI
LayersGUI
NetworkMonitorGUI
NotifyGUI
#PickerGUI
RenderingGUI
SceneGraphGUI
SearchGUI
ShaderGUI
SystemGUI
TerrainGUI
TextureInspectorGUI
ViewpointsGUI

set(STOCK_PANELS
AnnotationsGUI
CameraGUI
ContentBrowserGUI
#DateTimeGUI
EnvironmentGUI
LayersGUI
NetworkMonitorGUI
NotifyGUI
#PickerGUI
RenderingGUI
SceneGraphGUI
SearchGUI
ShaderGUI
SystemGUI
TerrainGUI
TextureInspectorGUI
ViewpointsGUI

# osgEarthProcedural
LifeMapLayerGUI
TerrainEditGUI
TextureSplattingLayerGUI
VegetationLayerGUI

# osgEarthCesium
CesiumIonGUI
)
# osgEarthProcedural
LifeMapLayerGUI
TerrainEditGUI
TextureSplattingLayerGUI
VegetationLayerGUI

# osgEarthCesium
CesiumIonGUI
)

# osgEarth source code:
set(LIB_HEADERS
Common
ImGuiEventHandler
ImGuiApp
ImGuiPanel )
set(LIB_SOURCES
ImGuiEventHandler.cpp )
# osgEarth source code:
set(LIB_HEADERS
Common
ImGuiEventHandler
ImGuiApp
ImGuiPanel )

set(LIB_SOURCES
ImGuiEventHandler.cpp )

add_osgearth_library(
TARGET ${LIB_NAME}
SOURCES ${LIB_SOURCES} ${IMGUI_SOURCES}
PUBLIC_HEADERS ${LIB_HEADERS} ${IMGUI_HEADERS} ${STOCK_PANELS}
LIBRARIES PRIVATE GLEW::GLEW OpenGL::GL
FOLDER "NodeKits")

endif()
add_osgearth_library(
TARGET ${LIB_NAME}
SOURCES ${LIB_SOURCES} ${IMGUI_SOURCES}
PUBLIC_HEADERS ${LIB_HEADERS} ${IMGUI_HEADERS} ${STOCK_PANELS}
LIBRARIES PRIVATE GLEW::GLEW OpenGL::GL
FOLDER "NodeKits")

0 comments on commit c909c71

Please sign in to comment.