Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(WITH_LIB_GLAD_EXAMPLE_CBASIC AND WITH_EXAMPLES)
- if(NOT WITH_LIB_GLAD)
- message(FATAL_ERROR "Try to build example WITH_LIB_GLAD_EXAMPLE_CBASIC without WITH_LIB_GLAD")
- endif()
- message(STATUS "Building example WITH_LIB_GLAD_EXAMPLE_CBASIC")
- set(LIB_GLAD_EXAMPLE_CBASIC_SRC ${CMAKE_SOURCE_DIR}/source/examples/glad/basic/basic.c)
- set(LIB_GLAD_EXAMPLE_CBASIC_COMPILER gcc)
- set(LIB_GLAD_EXAMPLE_CBASIC_C_FLAGS_RELEASE "-O3 -Wall -Werror")
- set(LIB_GLAD_EXAMPLE_CBASIC_C_FLAGS_DEBUG "-g -Wall -Werror")
- set(LIB_GLAD_EXAMPLE_CBASIC_INSTALL_PATH "${OUTPUT_PATH}/examples/glad/basic/")
- set(LIB_GLAD_EXAMPLE_CBASIC_OUTPUT_NAME_RELEASE "glad-basic")
- set(LIB_GLAD_EXAMPLE_CBASIC_OUTPUT_NAME_DEBUG "glad-basic_debug")
- add_executable(LIB_GLAD_EXAMPLE_CBASIC ${LIB_GLAD_EXAMPLE_CBASIC_SRC})
- set(CMAKE_C_COMPILER ${LIB_GLAD_EXAMPLE_CBASIC_COMPILER})
- if(CMAKE_RELEASE_TYPE )
- set(CMAKE_C_LINKER_FLAGS ${LIB_GLAD_EXAMPLE_CBASIC_C_FLAGS_DEBUG})
- else()
- set(CMAKE_C_LINKER_FLAGS ${LIB_GLAD_EXAMPLE_CBASIC_C_FLAGS_RELEASE})
- endif()
- target_include_directories(LIB_GLAD_EXAMPLE_CBASIC PRIVATE ${LIB_GLAD_INC_PATH})
- target_link_directories(LIB_GLAD_EXAMPLE_CBASIC PRIVATE ${LIB_GLAD_LIB_PATH})
- target_link_libraries(LIB_GLAD_EXAMPLE_CBASIC PRIVATE ${LIB_GLAD_STATIC_LIBS})
- set(THREADS_PREFER_PTHREAD_FLAG ON)
- target_link_libraries(LIB_GLAD_EXAMPLE_CBASIC PRIVATE Threads::Threads)
- cmake_print_variables(LIB_GLAD_INC_PAH LIB_GLAD_LIB_PATH LIB_GLAD_STATIC_LIBS)
- set_target_properties(LIB_GLAD_EXAMPLE_CBASIC PROPERTIES RELEASE_OUTPUT_NAME ${LIB_GLAD_EXAMPLE_CBASIC_OUTPUT_NAME_RELEASE})
- set_target_properties(LIB_GLAD_EXAMPLE_CBASIC PROPERTIES DEBUG_OUTPUT_NAME ${LIB_GLAD_EXAMPLE_CBASIC_OUTPUT_NAME_DEBUG})
- set_target_properties(LIB_GLAD_EXAMPLE_CBASIC PROPERTIES LINKER_LANGUAGE C)
- install(
- TARGETS LIB_GLAD_EXAMPLE_CBASIC
- RUNTIME DESTINATION ${LIB_GLAD_EXAMPLE_CBASIC_INSTALL_PATH}
- )
- endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement