Courtney Goeltzenleuchter | 3f2606d | 2014-10-13 17:51:58 -0600 | [diff] [blame] | 1 | pkg_check_modules(XCB REQUIRED xcb) |
| 2 | if (NOT XCB_FOUND) |
| 3 | message(FATAL_ERROR "xcb not found") |
Chia-I Wu | c19795a | 2014-09-13 11:12:55 +0800 | [diff] [blame] | 4 | endif() |
Courtney Goeltzenleuchter | 4825f6a | 2014-10-28 10:27:47 -0600 | [diff] [blame] | 5 | if(NOT EXISTS /usr/include/glm/glm.hpp) |
| 6 | message(FATAL_ERROR "Necessary libglm-dev headers cannot be found: sudo apt-get install libglm-dev") |
| 7 | endif() |
Courtney Goeltzenleuchter | 1722360 | 2014-10-29 15:59:49 -0600 | [diff] [blame] | 8 | if(NOT EXISTS /usr/include/png.h) |
Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 9 | message(FATAL_ERROR "Necessary png12-dev headers cannot be found: sudo apt-get install libpng12-dev") |
Courtney Goeltzenleuchter | 1722360 | 2014-10-29 15:59:49 -0600 | [diff] [blame] | 10 | endif() |
Courtney Goeltzenleuchter | 4825f6a | 2014-10-28 10:27:47 -0600 | [diff] [blame] | 11 | |
Courtney Goeltzenleuchter | d72c619 | 2014-10-29 16:25:34 -0600 | [diff] [blame] | 12 | file(GLOB TEXTURES |
| 13 | "${PROJECT_SOURCE_DIR}/demos/*.png" |
| 14 | ) |
| 15 | file(COPY ${TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/demos) |
Courtney Goeltzenleuchter | 3f2606d | 2014-10-13 17:51:58 -0600 | [diff] [blame] | 16 | |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame^] | 17 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES") |
| 18 | |
Courtney Goeltzenleuchter | 7e33498 | 2014-10-30 15:14:16 -0600 | [diff] [blame] | 19 | add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.bil |
| 20 | COMMAND ${GLSLANG_PREFIX}/build/install/bin/glslangValidator -s -b ${PROJECT_SOURCE_DIR}/demos/cube.vert |
| 21 | COMMAND mv vert.bil ${CMAKE_BINARY_DIR}/demos/cube-vert.bil |
| 22 | DEPENDS cube.vert ${GLSLANG_PREFIX}/build/install/bin/glslangValidator |
| 23 | ) |
| 24 | |
| 25 | add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.bil |
| 26 | COMMAND ${GLSLANG_PREFIX}/build/install/bin/glslangValidator -s -b ${PROJECT_SOURCE_DIR}/demos/cube.frag |
| 27 | COMMAND mv frag.bil ${CMAKE_BINARY_DIR}/demos/cube-frag.bil |
| 28 | DEPENDS cube.frag ${GLSLANG_PREFIX}/build/install/bin/glslangValidator |
| 29 | ) |
| 30 | |
Courtney Goeltzenleuchter | 3f2606d | 2014-10-13 17:51:58 -0600 | [diff] [blame] | 31 | include_directories ( |
| 32 | ${XCB_INCLUDE_DIRS} |
| 33 | "${PROJECT_SOURCE_DIR}/icd/common" |
| 34 | ) |
| 35 | |
| 36 | link_directories(${XCB_LIBRARY_DIRS}) |
Courtney Goeltzenleuchter | 1722360 | 2014-10-29 15:59:49 -0600 | [diff] [blame] | 37 | link_libraries(${XCB_LIBRARIES} XGL png m) |
Courtney Goeltzenleuchter | 3f2606d | 2014-10-13 17:51:58 -0600 | [diff] [blame] | 38 | |
Chia-I Wu | a4933f1 | 2014-12-02 22:08:35 +0800 | [diff] [blame] | 39 | add_executable(xglinfo xglinfo.c) |
| 40 | |
Courtney Goeltzenleuchter | 3f2606d | 2014-10-13 17:51:58 -0600 | [diff] [blame] | 41 | add_executable(tri tri.c) |
| 42 | target_link_libraries(tri) |
Courtney Goeltzenleuchter | 4e8246e | 2014-10-23 13:16:59 -0600 | [diff] [blame] | 43 | |
Courtney Goeltzenleuchter | 7e33498 | 2014-10-30 15:14:16 -0600 | [diff] [blame] | 44 | add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.bil ${CMAKE_BINARY_DIR}/demos/cube-frag.bil) |
Courtney Goeltzenleuchter | 4e8246e | 2014-10-23 13:16:59 -0600 | [diff] [blame] | 45 | target_link_libraries(cube) |