54 lines
1.3 KiB
CMake
54 lines
1.3 KiB
CMake
cmake_minimum_required (VERSION 3.8)
|
|
|
|
project ("colour-picker" LANGUAGES CXX C)
|
|
|
|
#set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
# source files
|
|
file(GLOB_RECURSE SOURCE_FILES
|
|
${CMAKE_SOURCE_DIR}/src/*.c
|
|
${CMAKE_SOURCE_DIR}/src/*.cpp)
|
|
|
|
# header files
|
|
file(GLOB HEADER_FILES
|
|
${CMAKE_SOURCE_DIR}/src/*.h
|
|
${CMAKE_SOURCE_DIR}/src/*.hpp)
|
|
|
|
# imgui - note: could be done as a library as well but this was easier for now
|
|
file(GLOB IMGUI_FILES
|
|
${CMAKE_SOURCE_DIR}/include/imgui/*.h
|
|
${CMAKE_SOURCE_DIR}/include/imgui/*.cpp
|
|
${CMAKE_SOURCE_DIR}/include/imgui/backends/imgui_impl_opengl3.*
|
|
${CMAKE_SOURCE_DIR}/include/imgui/backends/imgui_impl_glfw.*)
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include/imgui)
|
|
|
|
add_executable(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_FILES})
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
|
|
|
# Package management
|
|
|
|
# OpenGL
|
|
set(OpenGL_GL_PREFERENCE GLVND)
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
# GLFW
|
|
find_package(GLFW3 REQUIRED)
|
|
message(STATUS "Found GLFW3 in ${GLFW3_INCLUDE_DIR}")
|
|
|
|
# GLAD
|
|
# add_library(GLAD "thirdparty/glad.c")
|
|
|
|
set(LIBS ${GLFW3_LIBRARY} ${OPENGL_LIBRARY} ${CMAKE_DL_LIBS})
|
|
# set(LIBS ${GLFW3_LIBRARY} ${OPENGL_LIBRARY} GLAD ${CMAKE_DL_LIBS} ${CUDA_LIBRARIES} ${NETCDF_LIB})
|
|
|
|
include_directories(
|
|
"${CMAKE_SOURCE_DIR}/src"
|
|
"${CMAKE_SOURCE_DIR}/include"
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME} ${LIBS})
|
|
|
|
|