From f5cd05e88b4068550b8ec244541c95050b1e6a5e Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 15 Jun 2019 20:55:20 +0800 Subject: Fix building of the example application. --- examples/CMakeLists.txt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4b1defa..9e750bb 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,13 +2,20 @@ option (USE_CXIMAGE "Use CxImage instead of DevIL" OFF) find_package(glfw3 3.2 REQUIRED) find_package(GLEW REQUIRED) -find_package(OpenAL REQUIRED) find_package(Freetype REQUIRED) +find_package(ZLIB REQUIRED) if (NOT USE_CXIMAGE) find_package(DevIL REQUIRED) endif () +if (NOT BUILD_DUMB) + find_package(PkgConfig REQUIRED) + find_package(OpenAL REQUIRED) + pkg_search_module(VORBISFILE vorbisfile REQUIRED) + pkg_search_module(VORBIS vorbis REQUIRED) +endif () + add_executable(example smelt_test.cpp) @@ -18,12 +25,21 @@ include_directories( ${FREETYPE_INCLUDE_DIRS} ) +if (NOT USE_CXIMAGE) + target_link_libraries(example ${IL_LIBRARIES}) +endif () + +if (NOT BUILD_DUMB) + target_link_libraries(example ${OPENAL_LIBRARY} ${VORBISFILE_LIBRARIES} ${VORBIS_LIBRARIES}) +endif () + target_link_libraries(example + smelt smeltext glfw ${GLEW_LIBRARIES} - ${OpenAL_LIBRARIES} ${FREETYPE_LIBRARIES} - smelt smeltext + ${ZLIB_LIBRARIES} + GL ) get_cmake_property(__cmake_debug_var VARIABLES) -- cgit v1.2.3