First runnable render loop
This commit is contained in:
+2
-22
@@ -26,17 +26,10 @@ if (WIN32)
|
||||
# Find library files
|
||||
find_library(
|
||||
ASSIMP_LIBRARY
|
||||
NAMES assimp-vc${MSVC_TOOLSET_VERSION}-mt${CMAKE_DEBUG_POSTFIX}
|
||||
NAMES assimp-vc${MSVC_TOOLSET_VERSION}-mt${CMAKE_DEBUG_POSTFIX}.lib
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/lib
|
||||
${ASSIMP_ROOT}/lib/)
|
||||
|
||||
find_file(
|
||||
ASSIMP_BINARY
|
||||
NAMES assimp-vc${MSVC_TOOLSET_VERSION}-mt${CMAKE_DEBUG_POSTFIX}.dll
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/bin
|
||||
${ASSIMP_ROOT}/bin/)
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
@@ -62,23 +55,10 @@ else()
|
||||
/opt/local/lib
|
||||
${ASSIMP_ROOT}/lib
|
||||
DOC "The Assimp library")
|
||||
|
||||
find_file(
|
||||
ASSIMP_BINARY
|
||||
NAMES assimp.so
|
||||
PATHS
|
||||
/usr/bin64
|
||||
/usr/bin
|
||||
/usr/local/bin64
|
||||
/usr/local/bin
|
||||
/sw/bin
|
||||
/opt/local/bin
|
||||
${ASSIMP_ROOT}/lib
|
||||
DOC "The Assimp binary")
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY ASSIMP_BINARY)
|
||||
find_package_handle_standard_args(assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY)
|
||||
|
||||
# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS
|
||||
if (ASSIMP_FOUND)
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Find GLM
|
||||
#
|
||||
# Try to find GLM library.
|
||||
# This module defines the following variables:
|
||||
# - GLM_INCLUDE_DIRS
|
||||
# - GLM_LIBRARIES
|
||||
# - GLM_FOUND
|
||||
#
|
||||
# The following variables can be set as arguments for the module.
|
||||
# - GLM_ROOT : Root library directory of GLM
|
||||
# - GLM_USE_STATIC_LIBS : Specifies to use static version of GLM library (Windows only)
|
||||
#
|
||||
# References:
|
||||
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindGLM.cmake
|
||||
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindGLM.cmake
|
||||
#
|
||||
|
||||
# Additional modules
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (WIN32)
|
||||
# Find include files
|
||||
find_path(
|
||||
GLM_INCLUDE_DIR
|
||||
NAMES GLM/glm.hpp
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${GLM_ROOT}
|
||||
DOC "The directory where GLM/glm.h resides")
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
GLM_INCLUDE_DIR
|
||||
NAMES GLM/glfw.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where GLM/glm.h resides")
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(GLM DEFAULT_MSG GLM_INCLUDE_DIR)
|
||||
|
||||
# Define GLM_LIBRARIES and GLM_INCLUDE_DIRS
|
||||
if (GLM_FOUND)
|
||||
set(GLM_INCLUDE_DIRS ${GLM_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Hide some variables
|
||||
mark_as_advanced(GLM_INCLUDE_DIR)
|
||||
@@ -0,0 +1,103 @@
|
||||
#
|
||||
# Find SLANG
|
||||
#
|
||||
# Try to find SLANG library.
|
||||
# This module defines the following variables:
|
||||
# - SLANG_INCLUDE_DIRS
|
||||
# - SLANG_LIBRARIES
|
||||
# - SLANG_FOUND
|
||||
#
|
||||
# The following variables can be set as arguments for the module.
|
||||
# - SLANG_ROOT : Root library directory of SLANG
|
||||
#
|
||||
# References:
|
||||
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindSLANG.cmake
|
||||
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindSLANG.cmake
|
||||
#
|
||||
|
||||
# Additional modules
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (WIN32)
|
||||
set(SLANG_BINARY_PATH ${SLANG_ROOT}/bin/windows-${CMAKE_PLATFORM}/release/)
|
||||
# Find include files
|
||||
find_path(
|
||||
SLANG_INCLUDE_DIR
|
||||
NAMES slang.h
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${SLANG_ROOT}
|
||||
DOC "The directory where SLANG/slang.h resides")
|
||||
|
||||
# Find library files
|
||||
find_library(
|
||||
SLANG_LIBRARY
|
||||
NAMES slang.lib
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/lib
|
||||
${SLANG_BINARY_PATH})
|
||||
|
||||
find_file(
|
||||
SLANG_BINARY
|
||||
NAMES slang.dll
|
||||
PATHS
|
||||
${SLANG_BINARY_PATH})
|
||||
|
||||
find_file(
|
||||
SLANG_GLSLANG
|
||||
NAMES slang-glslang.dll
|
||||
PATHS
|
||||
${SLANG_BINARY_PATH})
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
SLANG_INCLUDE_DIR
|
||||
NAMES slang.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where GL/glfw.h resides")
|
||||
|
||||
# Find library files
|
||||
# Try to use static libraries
|
||||
find_library(
|
||||
SLANG_LIBRARY
|
||||
NAMES slang.a
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
${SLANG_ROOT}/lib
|
||||
DOC "The SLANG library")
|
||||
|
||||
find_file(
|
||||
SLANG_BINARY
|
||||
NAMES slang.so
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
${SLANG_ROOT}/lib
|
||||
)
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(SLANG DEFAULT_MSG SLANG_INCLUDE_DIR SLANG_LIBRARY SLANG_BINARY SLANG_GLSLANG)
|
||||
|
||||
# Define SLANG_LIBRARIES and SLANG_INCLUDE_DIRS
|
||||
if (SLANG_FOUND)
|
||||
set(SLANG_BINARIES ${SLANG_BINARY} ${SLANG_GLSLANG})
|
||||
set(SLANG_LIBRARIES ${SLANG_LIBRARY})
|
||||
set(SLANG_INCLUDE_DIRS ${SLANG_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Hide some variables
|
||||
mark_as_advanced(SLANG_INCLUDE_DIR SLANG_LIBRARY SLANG_GLSLANG SLANG_BINARY)
|
||||
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Find STB
|
||||
#
|
||||
# Try to find STB library.
|
||||
# This module defines the following variables:
|
||||
# - STB_INCLUDE_DIRS
|
||||
# - STB_LIBRARIES
|
||||
# - STB_FOUND
|
||||
#
|
||||
# The following variables can be set as arguments for the module.
|
||||
# - STB_ROOT : Root library directory of STB
|
||||
# - STB_USE_STATIC_LIBS : Specifies to use static version of STB library (Windows only)
|
||||
#
|
||||
# References:
|
||||
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindSTB.cmake
|
||||
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindSTB.cmake
|
||||
#
|
||||
|
||||
# Additional modules
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (WIN32)
|
||||
# Find include files
|
||||
find_path(
|
||||
STB_INCLUDE_DIR
|
||||
NAMES stb.h
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${STB_ROOT}
|
||||
DOC "The directory where STB/stb.h resides")
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
STB_INCLUDE_DIR
|
||||
NAMES stb.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where STB/stb.h resides")
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(STB DEFAULT_MSG STB_INCLUDE_DIR)
|
||||
|
||||
# Define STB_LIBRARIES and STB_INCLUDE_DIRS
|
||||
if (STB_FOUND)
|
||||
set(STB_INCLUDE_DIRS ${STB_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Hide some variables
|
||||
mark_as_advanced(STB_INCLUDE_DIR)
|
||||
+3
-28
@@ -7,8 +7,9 @@ list(APPEND DEPENDENCIES assimp)
|
||||
set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "")
|
||||
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE INTERNAL "")
|
||||
set(ASSIMP_INSTALL OFF CACHE INTERNAL "")
|
||||
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "")
|
||||
|
||||
add_subdirectory(${ASSIMP_ROOT} ${})
|
||||
add_subdirectory(${ASSIMP_ROOT} ${ASSIMP_ROOT})
|
||||
target_compile_definitions(assimp PRIVATE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
|
||||
|
||||
#-------------BOOST----------------
|
||||
@@ -29,25 +30,13 @@ ExternalProject_Add(boost
|
||||
list (APPEND EXTRA_CMAKE_ARGS
|
||||
-DBoost_NO_SYSTEM_PATHS=ON)
|
||||
|
||||
#----------------GLM-----------------------
|
||||
list(APPEND DEPENDENCIES glm)
|
||||
ExternalProject_Add(glm
|
||||
SOURCE_DIR ${GLM_ROOT}
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
list(APPEND EXTRA_CMAKE_ARGS
|
||||
-DGLM_INCLUDE_DIRS=${GLM_ROOT}
|
||||
)
|
||||
|
||||
#--------------------JSON------------------
|
||||
list(APPEND DEPENDENCIES nlohmann_json)
|
||||
set(JSON_MultipleHeaders ON CACHE INTERNAL "")
|
||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||
set(JSON_Install OFF CACHE INTERNAL "")
|
||||
|
||||
add_subdirectory(${JSON_ROOT})
|
||||
add_subdirectory(${JSON_ROOT} ${JSON_ROOT})
|
||||
|
||||
#--------------GLFW------------------------------
|
||||
list(APPEND DEPENDENCIES glfw)
|
||||
@@ -59,10 +48,6 @@ set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" )
|
||||
|
||||
add_subdirectory(${GLFW_ROOT} ${GLFW_ROOT})
|
||||
|
||||
#---------------STB_IMAGE------------------------
|
||||
list(APPEND EXTRA_CMAKE_ARGS
|
||||
-DSTB_INCLUDE_DIRS=${STB_ROOT})
|
||||
|
||||
#--------------SLang------------------------------
|
||||
list(APPEND DEPENDENCIES slang)
|
||||
string(TOLOWER release_${CMAKE_PLATFORM} SLANG_CONFIG)
|
||||
@@ -74,9 +59,6 @@ ExternalProject_Add(slang
|
||||
BUILD_COMMAND msbuild -p:Configuration=Release -p:WarningLevel=0 -p:Platform=${CMAKE_PLATFORM} -p:WindowsTargetPlatformVersion=10.0 ${SLANG_ROOT}/source/slang/slang.vcxproj
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
string(TOLOWER bin/windows-${CMAKE_PLATFORM}/Release/slang.dll SLANG_BINARY)
|
||||
string(TOLOWER bin/windows-${CMAKE_PLATFORM}/Release/slang-glslang.dll SLANG_GLSLANG)
|
||||
string(TOLOWER bin/windows-${CMAKE_PLATFORM}/Release/slang.lib SLANG_LIB_PATH)
|
||||
set(SLANG_LIB_PATH ${SLANG_ROOT}/${SLANG_LIB_PATH})
|
||||
elseif(UNIX)
|
||||
ExternalProject_Add(slang
|
||||
@@ -91,13 +73,6 @@ ExternalProject_Add(slang
|
||||
set(SLANG_LIB_PATH)
|
||||
endif()
|
||||
|
||||
list(APPEND EXTRA_CMAKE_ARGS
|
||||
-DSLANG_INCLUDE_DIRS=${EXTERNAL_ROOT}/slang
|
||||
-DSLANG_LIBRARY=${SLANG_LIB_PATH}
|
||||
-DSLANG_BINARY=${SLANG_BINARY}
|
||||
-DSLANG_GLSLANG=${SLANG_GLSLANG})
|
||||
|
||||
|
||||
#----------------SPIR-V-CROSS--------------------
|
||||
list(APPEND DEPENDENCIES spirv-cross-reflect)
|
||||
set(SPIRV_CROSS_ENABLE_HLSL OFF CACHE BOOL "")
|
||||
|
||||
Reference in New Issue
Block a user