From 591c44b9a1a6e0a803b6d8af9e35aa8552b421c0 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sat, 15 Jun 2019 15:21:32 +0800 Subject: DevIL support --- smelt/glfw/CMakeLists.txt | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'smelt/glfw/CMakeLists.txt') diff --git a/smelt/glfw/CMakeLists.txt b/smelt/glfw/CMakeLists.txt index 6785ca1..73c2130 100644 --- a/smelt/glfw/CMakeLists.txt +++ b/smelt/glfw/CMakeLists.txt @@ -1,10 +1,13 @@ -option(BUILD_DUMB "Disable sound support" OFF) +option (BUILD_DUMB "Disable sound support" OFF) +option (USE_CXIMAGE "Use CxImage instead of DevIL" OFF) -find_package(PkgConfig REQUIRED) +find_package(glfw3 REQUIRED) find_package(GLEW REQUIRED) find_package(OpenAL REQUIRED) -pkg_search_module(GLFW REQUIRED glfw3) +if (NOT USE_CXIMAGE) + find_package(DevIL REQUIRED) +endif () set (SMELT_GLFW_CPP_FILES gfx_glfw.cpp @@ -14,12 +17,15 @@ set (SMELT_GLFW_CPP_FILES ) include_directories( - ${GLFW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ) add_library(smelt STATIC ${SMELT_GLFW_CPP_FILES}) +target_include_directories(smelt PUBLIC ../../include) + +target_link_libraries(smelt glfw) + if (BUILD_DUMB) message (STATUS "") message (STATUS "BUILD_DUMB build option enabled") @@ -28,3 +34,12 @@ if (BUILD_DUMB) ENABLE_DUMB ) endif () + +if (USE_CXIMAGE) + message (STATUS "") + message (STATUS "USE_CXIMAGE build option enabled") + message (STATUS "") + target_compile_definitions(smelt PRIVATE + USE_CXIMAGE + ) +endif () -- cgit v1.2.3