2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
..
|
2017-06-22 15:48:18 +00:00
|
|
|
../ThirdPartyLibs
|
2015-04-16 16:55:32 +00:00
|
|
|
../../src
|
2018-02-21 16:16:00 +00:00
|
|
|
../ThirdPartyLibs/glad
|
2015-04-16 16:55:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
FILE(GLOB OpenGLWindow_HDRS "*.h" )
|
|
|
|
|
2017-04-03 06:00:06 +00:00
|
|
|
FILE(GLOB OpenGLWindowMac_CPP "Mac*.cpp")
|
|
|
|
FILE(GLOB OpenGLWindowMacObjC_CPP "Mac*.m")
|
2015-04-16 16:55:32 +00:00
|
|
|
FILE(GLOB OpenGLWindowWin32_CPP "Win32*.cpp")
|
|
|
|
FILE(GLOB OpenGLWindowLinux_CPP "X11*.cpp")
|
|
|
|
|
|
|
|
FILE(GLOB OpenGLWindowCommon_CPP "*.cpp" )
|
|
|
|
|
|
|
|
LIST(REMOVE_ITEM OpenGLWindowCommon_CPP ${OpenGLWindowMac_CPP} )
|
|
|
|
LIST(REMOVE_ITEM OpenGLWindowCommon_CPP ${OpenGLWindowWin32_CPP} )
|
|
|
|
LIST(REMOVE_ITEM OpenGLWindowCommon_CPP ${OpenGLWindowLinux_CPP} )
|
|
|
|
LIST(REMOVE_ITEM OpenGLWindowCommon_CPP X11OpenGLWindow.cpp )
|
2017-04-03 06:00:06 +00:00
|
|
|
LIST(REMOVE_ITEM OpenGLWindowCommon_CPP MacOpenGLWindow.cpp )
|
2015-04-16 16:55:32 +00:00
|
|
|
#MESSAGE (${OpenGLWindowCommon_CPP})
|
|
|
|
|
|
|
|
IF (WIN32)
|
2018-02-21 05:09:31 +00:00
|
|
|
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
2015-04-16 16:55:32 +00:00
|
|
|
INCLUDE_DIRECTORIES(
|
2018-02-21 05:09:31 +00:00
|
|
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
2015-04-16 16:55:32 +00:00
|
|
|
)
|
|
|
|
ADD_DEFINITIONS(-DGLEW_STATIC)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
IF (APPLE)
|
2018-02-21 16:16:00 +00:00
|
|
|
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
|
2015-04-16 16:55:32 +00:00
|
|
|
ENDIF(APPLE)
|
|
|
|
|
|
|
|
#no Linux detection?
|
|
|
|
IF(NOT WIN32 AND NOT APPLE)
|
|
|
|
INCLUDE_DIRECTORIES(
|
2018-02-21 05:09:31 +00:00
|
|
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
2015-12-08 00:42:45 +00:00
|
|
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/optionalX11
|
2015-04-16 16:55:32 +00:00
|
|
|
)
|
2015-12-08 00:38:43 +00:00
|
|
|
ADD_DEFINITIONS(-DGLEW_STATIC)
|
2015-04-16 16:55:32 +00:00
|
|
|
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
2015-12-08 00:38:43 +00:00
|
|
|
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
|
|
|
ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
|
2018-02-21 05:09:31 +00:00
|
|
|
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad_glx.c ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowCommon_CPP} )
|
2015-04-16 16:55:32 +00:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADD_LIBRARY(OpenGLWindow ${OpenGLWindow_SRCS} ${OpenGLWindow_HDRS})
|
|
|
|
if (UNIX AND NOT APPLE)
|
2017-09-09 20:05:45 +00:00
|
|
|
target_link_libraries(OpenGLWindow ${DL})
|
2015-04-16 16:55:32 +00:00
|
|
|
elseif (APPLE)
|
|
|
|
target_link_libraries(OpenGLWindow ${COCOA_LIBRARY})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
target_link_libraries(OpenGLWindow Bullet3Common)
|
|
|
|
if (WIN32 OR APPLE)
|
|
|
|
target_link_libraries(OpenGLWindow ${OPENGL_gl_LIBRARY})
|
|
|
|
else()
|
|
|
|
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
2015-12-07 22:08:04 +00:00
|
|
|
FIND_PACKAGE(Threads)
|
2017-09-10 23:22:45 +00:00
|
|
|
target_link_libraries(OpenGLWindow ${CMAKE_THREAD_LIBS_INIT})
|
2015-04-16 16:55:32 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#target_link_libraries(OpenGLWindow ${OPENGL_gl_LIBRARY})
|