Tagged in

CMake

Qt5 with OpenGL CMake

cmake_minimum_required(VERSION 3.6)
project(writer)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)

find_package(Qt5 REQUIRED COMPONENTS Widgets Core)
find_package(glfw3 3.2 REQUIRED)
find_package(OpenGL REQUIRED)

set(SOURCE_FILES main.cpp)
add_executable(writer ${SOURCE_FILES})
qt5_use_modules(writer Core Gui Widgets)


include_directories(${OPENGL_INCLUDE_DIR …

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 …

Boost with CMake

Boost installed via brew

cmake_minimum_required(VERSION 3.6)
project(boost_stuff)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib")

find_package(Boost 1.62.0 COMPONENTS system filesystem REQUIRED)
if (Boost_FOUND)
    message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
    message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
    message(STATUS "Boost_VERSION: ${Boost_VERSION}")

    include_directories(${Boost_INCLUDE_DIRS})

endif()

set(SOURCE_FILES main.cpp)
add_executable(boost_stuff …

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 …