Commits

spencercw committed 91ad590

Add OpenGL build to CMake.

  • Participants
  • Parent commits 55390aa

Comments (0)

Files changed (3)

File gb_emulator/CMakeLists.txt

 find_package(Boost REQUIRED)
 find_package(Cg REQUIRED)
 find_package(DirectX REQUIRED)
+find_package(OpenGL REQUIRED)
 
 include_directories(".")
 include_directories("include")
 include_directories("${PROJECT_SOURCE_DIR}/gb_net/include")
+include_directories("${PROJECT_SOURCE_DIR}/third_party/glew/include")
 include_directories("${PROJECT_SOURCE_DIR}/third_party/hqx/include")
 include_directories("${PROJECT_SOURCE_DIR}/third_party/libsndfile/include")
 include_directories("${PROJECT_SOURCE_DIR}/third_party/protobuf/src")
 include_directories(${Boost_INCLUDE_DIRS})
 include_directories(${CG_INCLUDE_PATH})
 include_directories(${DirectX_INCLUDE_DIR})
+include_directories(${OPENGL_INCLUDE_DIR})
 
 link_directories(${Boost_LIBRARY_DIRS})
 
+add_definitions(-D_SCL_SECURE_NO_WARNINGS)
 add_definitions(-DUNICODE -D_UNICODE)
-add_definitions(-DENABLE_SNDFILE_WINDOWS_PROTOTYPES)
 add_definitions(-DGB_EMULATOR_EXPORTS)
-add_definitions(-D_SCL_SECURE_NO_WARNINGS)
+add_definitions(-DGLEW_STATIC)
 add_definitions(-DWIN32_LEAN_AND_MEAN)
 add_definitions(-D_WIN32_WINNT=0x0600)
 
 	src/gb_sound_wasapi_renderer.cpp
 	src/gb_timers.cpp
 	src/gb_video.cpp
-	src/gb_video_d3d11.cpp)
+	src/gb_video_d3d11.cpp
+	src/gb_video_opengl.cpp
+	src/glew_error.cpp)
 
 target_link_libraries(gb_emulator
 	gb_net
+	glew
 	hqx
 	libprotobuf
 	${CG_LIBRARY}
 	${CG_D3D11_LIBRARY}
-	${DirectX_XINPUT_LIBRARY})
+	${CG_GL_LIBRARY}
+	${DirectX_XINPUT_LIBRARY}
+	${OPENGL_gl_LIBRARY})

File third_party/CMakeLists.txt

 add_subdirectory(argtable)
+add_subdirectory(glew)
 add_subdirectory(hqx)
 add_subdirectory(protobuf)

File third_party/glew/CMakeLists.txt

+include_directories("include")
+
+add_definitions(-DGLEW_STATIC)
+add_definitions(-D_LIB)
+add_definitions(-DUNICODE -D_UNICODE)
+add_definitions(-DVC_EXTRALEAN)
+add_definitions(-DWIN32)
+add_definitions(-DWIN32_LEAN_AND_MEAN)
+
+add_library(glew
+	src/glew.c)