1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
#
# External dependencies
#
find_package(GLFW)
find_package(GLEW)
#
# Executable name and options
#
# Target name
set(target comparison)
# Exit here if required dependencies are not met
if (NOT GLFW_FOUND)
message("Example ${target} skipped: GLFW not found")
return()
endif()
if (NOT GLEW_FOUND)
message("Example ${target} skipped: GLEW not found")
return()
endif()
message(STATUS "Example ${target}")
#
# Sources
#
set(sources
main.cpp
gltest.inl
gltest_data.inl
gltest_error.inl
glbinding.cpp
glbinding.h
glew.cpp
glew.h
Timer.cpp
Timer.h
)
#
# Create executable
#
# Build executable
add_executable(${target}
${sources}
)
# Create namespaced alias
add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target})
#
# Project options
#
set_target_properties(${target}
PROPERTIES
${DEFAULT_PROJECT_OPTIONS}
FOLDER "${IDE_FOLDER}"
)
#
# Include directories
#
target_include_directories(${target}
PRIVATE
${DEFAULT_INCLUDE_DIRECTORIES}
${PROJECT_BINARY_DIR}/source/include
SYSTEM
${GLFW_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
)
#
# Libraries
#
target_link_libraries(${target}
PRIVATE
${DEFAULT_LIBRARIES}
${GLFW_LIBRARIES}
${GLEW_LIBRARY}
${META_PROJECT_NAME}::glbinding
)
#
# Compile definitions
#
target_compile_definitions(${target}
PRIVATE
${DEFAULT_COMPILE_DEFINITIONS}
)
#
# Compile options
#
target_compile_options(${target}
PRIVATE
${DEFAULT_COMPILE_OPTIONS}
)
#
# Linker options
#
target_link_libraries(${target}
PRIVATE
${DEFAULT_LINKER_OPTIONS}
)
#
# Deployment
#
# Executable
install(TARGETS ${target}
RUNTIME DESTINATION ${INSTALL_EXAMPLES} COMPONENT examples_glfw
BUNDLE DESTINATION ${INSTALL_EXAMPLES} COMPONENT examples_glfw
)
|