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