opengl-playground/CMakeLists.txt

58 lines
2.9 KiB
CMake
Raw Normal View History

project(opengl-playground)
#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
cmake_minimum_required(VERSION 3.16)
2020-03-21 22:38:10 +01:00
find_package(glm REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(EPOXY REQUIRED epoxy)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(ASSIMP REQUIRED assimp)
2020-04-02 00:55:18 +02:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/examples" "${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui" ${EPOXY_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
2020-03-18 22:42:04 +01:00
configure_file("shaders/2d-passthrough-vertex.glsl" "shaders/2d-passthrough-vertex.glsl" COPYONLY)
configure_file("shaders/fixed-red-fragment.glsl" "shaders/fixed-red-fragment.glsl" COPYONLY)
configure_file("shaders/triangle-gen-geometry.glsl" "shaders/triangle-gen-geometry.glsl" COPYONLY)
configure_file("shaders/triangle-gen-zoomed-geometry.glsl" "shaders/triangle-gen-zoomed-geometry.glsl" COPYONLY)
configure_file("shaders/textured-rectangle-vertex.glsl" "shaders/textured-rectangle-vertex.glsl" COPYONLY)
configure_file("shaders/textured-rectangle-fragment.glsl" "shaders/textured-rectangle-fragment.glsl" COPYONLY)
configure_file("shaders/2d-zoom-translate-vertex.glsl" "shaders/2d-zoom-translate-vertex.glsl" COPYONLY)
2020-03-18 22:42:04 +01:00
configure_file("shaders/mesh-vertex.glsl" "shaders/mesh-vertex.glsl" COPYONLY)
configure_file("shaders/mesh-fragment.glsl" "shaders/mesh-fragment.glsl" COPYONLY)
2020-03-18 22:42:04 +01:00
configure_file("models/coordinate-system/coordsys.obj" "coordinate-system/coordsys.obj" COPYONLY)
configure_file("models/coordinate-system/coordsys.mtl" "coordinate-system/coordsys.mtl" COPYONLY)
configure_file("models/bmi160/bmi160.obj" "bmi160/bmi160.obj" COPYONLY)
configure_file("models/bmi160/bmi160.mtl" "bmi160/bmi160.mtl" COPYONLY)
configure_file("models/bmi160/texture.png" "bmi160/texture.png" COPYONLY)
2020-03-21 22:38:10 +01:00
set(IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/imgui.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/imgui_draw.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/imgui_demo.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/imgui_widgets.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/misc/cpp/imgui_stdlib.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/examples/imgui_impl_sdl.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/examples/imgui_impl_opengl3.cpp"
)
aux_source_directory("src" SOURCES)
add_compile_options(-Wall)
2020-03-21 22:38:10 +01:00
add_executable(${PROJECT_NAME} ${SOURCES} ${IMGUI_SOURCES})
target_link_libraries(${PROJECT_NAME} m pthread ${EPOXY_LIBRARIES} ${SDL2_LIBRARIES} ${ASSIMP_LIBRARIES} glm)
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
2020-04-02 00:55:18 +02:00
target_precompile_headers(${PROJECT_NAME}
PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:stb/stb_image.h>"
"$<$<COMPILE_LANGUAGE:CXX>:glm/glm.hpp>"
PRIVATE
)