From 478b54f9ceafffe42da4461ff74c79af696fa578 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Wed, 19 Sep 2018 03:30:34 +0700 Subject: [PATCH] frameworks for glfw support --- CMakeLists.txt | 8 ++++---- samples/CMakeLists.txt | 26 +++++++++++++++++--------- untests/CMakeLists.txt | 16 ++++++++-------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94e366e6..ee5d42cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 1ee6b49f..67420ee5 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -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) @@ -45,15 +53,15 @@ function(add_e2d_sample NAME) # if(MSVC) - add_custom_command(TARGET ${SAMPLE_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/bin - ${CMAKE_CURRENT_BINARY_DIR}/$/bin) + add_custom_command(TARGET ${SAMPLE_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/bin + ${CMAKE_CURRENT_BINARY_DIR}/$/bin) else() - add_custom_command(TARGET ${SAMPLE_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/bin - ${CMAKE_CURRENT_BINARY_DIR}/bin) + add_custom_command(TARGET ${SAMPLE_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/bin + ${CMAKE_CURRENT_BINARY_DIR}/bin) endif() endfunction(add_e2d_sample) diff --git a/untests/CMakeLists.txt b/untests/CMakeLists.txt index 32360d3e..4b60d85a 100644 --- a/untests/CMakeLists.txt +++ b/untests/CMakeLists.txt @@ -45,15 +45,15 @@ function(add_e2d_tests NAME) # if(MSVC) - add_custom_command(TARGET ${TESTS_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/bin - ${CMAKE_CURRENT_BINARY_DIR}/$/bin) + add_custom_command(TARGET ${TESTS_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/bin + ${CMAKE_CURRENT_BINARY_DIR}/$/bin) else() - add_custom_command(TARGET ${TESTS_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/bin - ${CMAKE_CURRENT_BINARY_DIR}/bin) + add_custom_command(TARGET ${TESTS_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/bin + ${CMAKE_CURRENT_BINARY_DIR}/bin) endif() #