frameworks for glfw support

This commit is contained in:
2018-09-19 03:30:34 +07:00
parent 4387fa65ec
commit 478b54f9ce
3 changed files with 29 additions and 21 deletions

View File

@@ -83,12 +83,12 @@ target_include_directories(${PROJECT_NAME} PRIVATE
# subdirectories
#
option(BUILD_SAMPLES "Build samples" ON)
if(BUILD_SAMPLES)
option(E2D_BUILD_SAMPLES "Build samples" ON)
if(E2D_BUILD_SAMPLES)
add_subdirectory(samples)
endif()
option(BUILD_UNTESTS "Build untests" ON)
if(BUILD_UNTESTS)
option(E2D_BUILD_UNTESTS "Build untests" ON)
if(E2D_BUILD_UNTESTS)
add_subdirectory(untests)
endif()

View File

@@ -5,9 +5,13 @@ function(add_e2d_sample NAME)
# external
#
find_package(OpenGL REQUIRED)
find_package(Threads REQUIRED)
if(APPLE)
find_library(Cocoa Cocoa)
find_library(IOKit IOKit)
find_library(CoreVideo CoreVideo)
find_library(Foundation Foundation)
endif(APPLE)
@@ -33,10 +37,14 @@ function(add_e2d_sample NAME)
target_link_libraries(${SAMPLE_NAME}
enduro2d
"${CMAKE_THREAD_LIBS_INIT}")
${OPENGL_gl_LIBRARY}
${CMAKE_THREAD_LIBS_INIT})
if(APPLE)
target_link_libraries(${SAMPLE_NAME}
${Cocoa}
${IOKit}
${CoreVideo}
${Foundation})
endif(APPLE)