Tagged in

C++

OpenGL with CMake

cmake_minimum_required(VERSION 3.6)
project(ogl)

set(CMAKE_CXX_STANDARD 11)

find_package(glfw3 3.2 REQUIRED)
find_package(OpenGL REQUIRED)

if (OPENGL_FOUND)
    message("opengl found")
    message("include dir: ${OPENGL_INCLUDE_DIR}")
    message("link libraries: ${OPENGL_gl_LIBRARY}")
else (OPENGL_FOUND)
    message("opengl not found")
endif()


set(SOURCE_FILES main.cpp)
add_executable(ogl ${SOURCE_FILES})

include_directories(${OPENGL_INCLUDE_DIR})

target_link_libraries(ogl ${OPENGL_gl_LIBRARY} glfw …

Maya with CMake

cmake_minimum_required(VERSION 2.6)
project(animagi)

set(MAYA_VERSION 2017 CACHE STRING "Maya Version Number")
set(SOURCE_FILES
        "src/pluginMain.cpp"
        )

set(CMAKE_MACOSX_RPATH 1)
FIND_PACKAGE(OpenGL REQUIRED)

set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/bin)

# OS Specific environment setup
SET(CUSTOM_DEFINITIONS "REQUIRE_IOSTREAM;_BOOL")
SET(MAYA_INSTALL_BASE_SUFFIX "")
SET(MAYA_INC_SUFFIX "include")
SET(MAYA_LIB_SUFFIX "lib")
IF(WIN32)
    # Windows
    SET(MAYA_INSTALL_BASE_DEFAULT …