Revamping build system

This commit is contained in:
Dynamitos
2022-04-30 20:35:25 +02:00
parent 9939d625b5
commit d7566c5825
16 changed files with 78 additions and 926 deletions
+29 -63
View File
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.19) cmake_minimum_required(VERSION 3.7...3.23)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
# Handle superbuild first # Handle superbuild first
@@ -26,15 +29,9 @@ set(NSAM_ROOT ${EXTERNAL_ROOT}/aftermath)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
set(Boost_NO_WARN_NEW_VERSIONS 1) set(Boost_NO_WARN_NEW_VERSIONS 1)
if (USE_SUPERBUILD) project (Seele)
project (SUPERBUILD NONE)
# execute the superbuild (this script will be invoked again without the include(cmake/Superbuild.cmake)
# USE_SUPERBUILD option this time)
include (cmake/SuperBuild.cmake)
return() # stop processing this file further
else()
project (Seele)
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
#Workaround for vs, because it places artifacts into an additional subfolder #Workaround for vs, because it places artifacts into an additional subfolder
@@ -48,21 +45,7 @@ endif()
find_package(Vulkan REQUIRED) find_package(Vulkan REQUIRED)
find_package(Boost REQUIRED COMPONENTS serialization) find_package(Boost REQUIRED COMPONENTS serialization)
find_package(Threads REQUIRED)
find_package(Assimp REQUIRED)
find_package(JSON REQUIRED)
find_package(GLFW REQUIRED)
find_package(FreeType REQUIRED)
find_package(TTFParser REQUIRED)
find_package(GLM REQUIRED)
find_package(KTX REQUIRED)
find_package(STB REQUIRED)
find_package(SLANG REQUIRED)
find_package(Aftermath REQUIRED)
add_definitions(${Vulkan_DEFINITIONS})
add_definitions(${Boost_DEFINITIONS})
add_compile_definitions(GLFW_WINDOWS)
if(WIN32) if(WIN32)
add_compile_definitions(USE_EXTENSIONS) add_compile_definitions(USE_EXTENSIONS)
endif() endif()
@@ -71,29 +54,21 @@ if(CMAKE_DEBUG_POSTFIX)
add_compile_definitions(SEELE_DEBUG) add_compile_definitions(SEELE_DEBUG)
endif() endif()
add_executable(Engine "") add_executable(Engine "")
target_include_directories(Engine PRIVATE ${GLM_INCLUDE_DIRS}) target_compile_definitions(Engine PUBLIC GLFW_WINDOWS)
target_include_directories(Engine PRIVATE ${KTX_INCLUDE_DIRS}) target_include_directories(Engine PUBLIC src/Engine)
target_include_directories(Engine PRIVATE ${STB_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC Vulkan::Vulkan)
target_include_directories(Engine PRIVATE ${Vulkan_INCLUDE_DIR}) target_link_libraries(Engine PUBLIC Boost::headers)
target_include_directories(Engine PRIVATE ${Boost_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC Boost::serialization)
target_include_directories(Engine PRIVATE ${GLFW_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC EnTT::EnTT)
target_include_directories(Engine PRIVATE ${FREETYPE_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC glfw)
target_include_directories(Engine PRIVATE ${SLANG_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC glm::glm)
target_include_directories(Engine PRIVATE ${ASSIMP_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC freetype)
target_include_directories(Engine PRIVATE ${JSON_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC slang)
target_include_directories(Engine PRIVATE ${NSAM_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC assimp)
target_include_directories(Engine PRIVATE ${TTFPARSER_INCLUDE_DIRS}) target_link_libraries(Engine PUBLIC nsam)
target_include_directories(Engine PRIVATE ${ENGINE_ROOT}) target_link_libraries(Engine PUBLIC ktx)
target_include_directories(Engine PRIVATE src/Engine) target_link_libraries(Engine PUBLIC stb)
target_link_libraries(Engine PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(Engine ${Vulkan_LIBRARY})
target_link_libraries(Engine ${Boost_LIBRARIES})
target_link_libraries(Engine ${GLFW_LIBRARIES})
target_link_libraries(Engine ${FREETYPE_LIBRARIES})
target_link_libraries(Engine ${SLANG_LIBRARIES})
target_link_libraries(Engine ${ASSIMP_LIBRARIES})
target_link_libraries(Engine ${NSAM_LIBRARIES})
target_link_libraries(Engine ${KTX_LIBRARIES})
if(UNIX) if(UNIX)
target_link_libraries(Engine Threads::Threads) target_link_libraries(Engine Threads::Threads)
target_link_libraries(Engine dl) target_link_libraries(Engine dl)
@@ -128,22 +103,13 @@ endif()
add_executable(Seele_unit_tests "") add_executable(Seele_unit_tests "")
add_subdirectory(test/) add_subdirectory(test/)
if(WIN32)
add_custom_target(copy-binaries ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SLANG_BINARIES} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SLANG_GLSLANG} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GLFW_BINARY} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FREETYPE_BINARY} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ASSIMP_BINARY} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NSAM_BINARIES} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NSAM_LLVM} $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${KTX_BINARIES} $<TARGET_FILE_DIR:Engine>)
else()
add_custom_target(copy-binaries ALL COMMAND "")
endif()
add_custom_target(SeeleEngine ALL add_custom_target(SeeleEngine ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/res $<TARGET_FILE_DIR:Engine> COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/res $<TARGET_FILE_DIR:Engine>
DEPENDS Engine copy-binaries) COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:Engine> $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:slang,SLANG_BINARY> $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:slang,GLSLANG_BINARY> $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:nsam,NSAM_BINARY> $<TARGET_FILE_DIR:Engine>
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:nsam,LLVM_BINARY> $<TARGET_FILE_DIR:Engine>
COMMAND_EXPAND_LISTS
DEPENDS Engine slang-build)
-99
View File
@@ -1,99 +0,0 @@
#
# Find Nsight Aftermath
#
# Try to find Nvidia Nsight aftermath library.
# This module defines the following variables:
# - NSAM_INCLUDE_DIRS
# - NSAM_LIBRARIES
# - NSAM_FOUND
#
# The following variables can be set as arguments for the module.
# - NSAM_ROOT : Root library directory of NSAM
# - NSAM_USE_STATIC_LIBS : Specifies to use static version of NSAM library (Windows only)
#
# References:
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindNSAM.cmake
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindNSAM.cmake
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
NSAM_INCLUDE_DIR
NAMES GFSDK_Aftermath.h
PATHS
$ENV{PROGRAMFILES}/include
${NSAM_ROOT}/include
DOC "The directory where GFSDK_Aftermath.h resides")
# Find library files
find_library(
NSAM_LIBRARY
NAMES GFSDK_Aftermath_Lib.${CMAKE_PLATFORM}.lib
PATHS
$ENV{PROGRAMFILES}/lib
${NSAM_ROOT}/lib/${CMAKE_PLATFORM}
${NSAM_ROOT}/lib
PATH_SUFFIXES x86 x64)
find_file(
NSAM_BINARY
NAMES GFSDK_Aftermath_Lib.${CMAKE_PLATFORM}.dll
PATHS
$ENV{PROGRAMFILES}/bin
${NSAM_ROOT}/lib/${CMAKE_PLATFORM}
${NSAM_ROOT}/lib
PATH_SUFFIXES x86 x64)
find_file(
NSAM_LLVM
NAMES llvm_7_0_1.dll
PATHS
$ENV{PROGRAMFILES}/bin
${NSAM_ROOT}/lib/${CMAKE_PLATFORM}
${NSAM_ROOT}/lib
PATH_SUFFIXES x86 x64)
else()
# Find include files
find_path(
NSAM_INCLUDE_DIR
NAMES GFSDK_Aftermath.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${NSAM_ROOT}/include
DOC "The directory where GL/nsam.h resides")
find_file(
NSAM_LIBRARY
NAMES libGFSDK_Aftermath_Lib.${CMAKE_PLATFORM}.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${NSAM_ROOT}/lib
PATH_SUFFIXES x64 x86)
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(NSAM DEFAULT_MSG NSAM_INCLUDE_DIR NSAM_LIBRARY)
# Define NSAM_LIBRARIES and NSAM_INCLUDE_DIRS
if (NSAM_FOUND)
set(NSAM_LIBRARIES ${NSAM_LIBRARY})
set(NSAM_INCLUDE_DIRS ${NSAM_INCLUDE_DIR})
set(NSAM_BINARIES ${NSAM_BINARY})
endif()
# Hide some variables
mark_as_advanced(NSAM_INCLUDE_DIR NSAM_LIBRARY)
-84
View File
@@ -1,84 +0,0 @@
#
# Find Assimp
#
# Try to find Assimp : Open Asset Import Library.
# This module defines the following variables:
# - ASSIMP_INCLUDE_DIRS
# - ASSIMP_LIBRARIES
# - ASSIMP_FOUND
#
# The following variables can be set as arguments for the module.
# - ASSIMP_ROOT : Root library directory of Assimp
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
ASSIMP_INCLUDE_DIR
NAMES assimp/scene.h
PATHS
$ENV{PROGRAMFILES}/include
${ASSIMP_ROOT}/include
DOC "The directory where assimp/scene.h resides")
# Find library files
find_library(
ASSIMP_LIBRARY
NAMES assimp-vc${MSVC_TOOLSET_VERSION}-mt${CMAKE_DEBUG_POSTFIX}.lib
PATHS
$ENV{PROGRAMFILES}/lib
${ASSIMP_ROOT}/lib
${ASSIMP_ROOT}/code
PATH_SUFFIXES Debug Release)
find_file(
ASSIMP_BINARY
NAMES assimp-vc${MSVC_TOOLSET_VERSION}-mt${CMAKE_DEBUG_POSTFIX}.dll
PATHS
$ENV{PROGRAMFILES}/bin
${ASSIMP_ROOT}/code
PATH_SUFFIXES Debug Release)
else()
# Find include files
find_path(
ASSIMP_INCLUDE_DIR
NAMES assimp/scene.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${ASSIMP_ROOT}/include
DOC "The directory where assimp/scene.h resides")
# Find library files
find_library(
ASSIMP_LIBRARY
NAMES libassimp${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${ASSIMP_ROOT}/code
DOC "Assimp library file")
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY)
# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS
if (ASSIMP_FOUND)
set(ASSIMP_LIBRARIES ${ASSIMP_LIBRARY})
set(ASSIMP_INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR})
set(ASSIMP_BINARIES ${ASSIMP_BINARY})
endif()
# Hide some variables
mark_as_advanced(ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY, ASSIMP_BINARY)
-89
View File
@@ -1,89 +0,0 @@
#
# Find FREETYPE
#
# Try to find FREETYPE library.
# This module defines the following variables:
# - FREETYPE_INCLUDE_DIRS
# - FREETYPE_LIBRARIES
# - FREETYPE_FOUND
#
# The following variables can be set as arguments for the module.
# - FREETYPE_ROOT : Root library directory of FREETYPE
# - FREETYPE_USE_STATIC_LIBS : Specifies to use static version of FREETYPE library (Windows only)
#
# References:
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindFREETYPE.cmake
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindFREETYPE.cmake
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
FREETYPE_INCLUDE_DIR
NAMES freetype/freetype.h
PATHS
$ENV{PROGRAMFILES}/include
${FREETYPE_ROOT}/include
DOC "The directory where FREETYPE/glfw.h resides")
# Find library files
find_library(
FREETYPE_LIBRARY
NAMES freetype${CMAKE_DEBUG_POSTFIX}.lib
PATHS
$ENV{PROGRAMFILES}/lib
${FREETYPE_ROOT}/lib
${FREETYPE_ROOT}
PATH_SUFFIXES Debug Release)
find_file(
FREETYPE_BINARY
NAMES freetype${CMAKE_DEBUG_POSTFIX}.dll
PATHS
$ENV{PROGRAMFILES}/bin
${CMAKE_BINARY_DIR}
${FREETYPE_ROOT}/src
${FREETYPE_ROOT}
PATH_SUFFIXES Debug Release)
else()
# Find include files
find_path(
FREETYPE_INCLUDE_DIR
NAMES FREETYPE/glfw3.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glfw.h resides")
# Find library files
find_file(
FREETYPE_LIBRARY
NAMES libglfw${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${FREETYPE_ROOT}/src
)
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(FREETYPE DEFAULT_MSG FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY FREETYPE_BINARY)
# Define FREETYPE_LIBRARIES and FREETYPE_INCLUDE_DIRS
if (FREETYPE_FOUND)
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
endif()
# Hide some variables
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY)
-97
View File
@@ -1,97 +0,0 @@
#
# Find GLFW
#
# Try to find GLFW library.
# This module defines the following variables:
# - GLFW_INCLUDE_DIRS
# - GLFW_LIBRARIES
# - GLFW_FOUND
#
# The following variables can be set as arguments for the module.
# - GLFW_ROOT : Root library directory of GLFW
# - GLFW_USE_STATIC_LIBS : Specifies to use static version of GLFW library (Windows only)
#
# References:
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindGLFW.cmake
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindGLFW.cmake
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
GLFW_INCLUDE_DIR
NAMES GLFW/glfw3.h
PATHS
$ENV{PROGRAMFILES}/include
${GLFW_ROOT}/include
DOC "The directory where GLFW/glfw.h resides")
# Use glfw3(d).lib for static library
if (GLFW_USE_STATIC_LIBS)
set(GLFW_LIBRARY_NAME glfw3${CMAKE_DEBUG_POSTFIX})
else()
set(GLFW_LIBRARY_NAME glfw3${CMAKE_DEBUG_POSTFIX}dll)
endif()
# Find library files
find_library(
GLFW_LIBRARY
NAMES ${GLFW_LIBRARY_NAME}.lib
PATHS
$ENV{PROGRAMFILES}/lib
${GLFW_ROOT}/lib
${GLFW_ROOT}/src
PATH_SUFFIXES Debug Release)
unset(GLFW_LIBRARY_NAME)
find_file(
GLFW_BINARY
NAMES glfw3${CMAKE_DEBUG_POSTFIX}.dll
PATHS
$ENV{PROGRAMFILES}/bin
${CMAKE_BINARY_DIR}
${GLFW_ROOT}/src
${GLFW_ROOT}/bin
PATH_SUFFIXES Debug Release)
else()
# Find include files
find_path(
GLFW_INCLUDE_DIR
NAMES GLFW/glfw3.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glfw.h resides")
# Find library files
find_file(
GLFW_LIBRARY
NAMES libglfw${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${GLFW_ROOT}/src
)
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_INCLUDE_DIR GLFW_LIBRARY)
# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS
if (GLFW_FOUND)
set(GLFW_LIBRARIES ${GLFW_LIBRARY})
set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_DIR})
endif()
# Hide some variables
mark_as_advanced(GLFW_INCLUDE_DIR GLFW_LIBRARY)
-54
View File
@@ -1,54 +0,0 @@
#
# 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/glm.hpp
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${GLM_ROOT}
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)
-41
View File
@@ -1,41 +0,0 @@
#
# Find nlohmann_json
#
# Try to find nlohmann_json library
# This module defines the following variables:
# - JSON_INCLUDE_DIRS
# - JSON_FOUND
#
# The following variables can be set as arguments for the module.
# - JSON_ROOT : Root library directory of json
#
# Additional modules
include(FindPackageHandleStandardArgs)
if(JSON_MultipleHeaders)
find_path(
JSON_INCLUDE_DIR
NAMES nlohmann/json.hpp
PATHS
$ENV{PROGRAMFILES}/include
${JSON_ROOT}/single_include
DOC "The directory where nlohmann/json.hpp resides")
else()
find_path(
JSON_INCLUDE_DIR
NAMES nlohmann/json.hpp
PATHS
$ENV{PROGRAMFILES}/include
${JSON_ROOT}/include
DOC "The directory where nlohmann/json.hpp resides")
endif()
find_package_handle_standard_args(JSON DEFAULT_MSG JSON_INCLUDE_DIR)
if(JSON_FOUND)
set(JSON_INCLUDE_DIRS ${JSON_INCLUDE_DIR})
endif()
# Hide some variables
mark_as_advanced(JSON_INCLUDE_DIR)
-84
View File
@@ -1,84 +0,0 @@
#
# Find KTX
#
# Try to find KTX library.
# This module defines the following variables:
# - KTX_INCLUDE_DIRS
# - KTX_LIBRARIES
# - KTX_FOUND
#
# The following variables can be set as arguments for the module.
# - KTX_ROOT : Root library directory of KTX
# - KTX_USE_STATIC_LIBS : Specifies to use static version of KTX library (Windows only)
#
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
KTX_INCLUDE_DIR
NAMES ktx.h
PATHS
$ENV{PROGRAMFILES}/include
${KTX_ROOT}/include
DOC "The directory where ktx.h resides")
# Find library files
find_library(
KTX_LIBRARY
NAMES ktx${CMAKE_DEBUG_POSTFIX}.lib
PATHS
$ENV{PROGRAMFILES}/lib
${KTX_ROOT}
${KTX_ROOT}/lib
PATH_SUFFIXES Debug Release)
find_file(
KTX_BINARY
NAMES ktx${CMAKE_DEBUG_POSTFIX}.dll
PATHS
$ENV{PROGRAMFILES}/lib
${KTX_ROOT}
${KTX_ROOT}/lib
PATH_SUFFIXES Debug Release)
else()
# Find include files
find_path(
KTX_INCLUDE_DIR
NAMES ktx.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${KTX_ROOT}
DOC "The directory where KTX/ktx.h resides")
find_library(
KTX_LIBRARY
NAMES libktx${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${KTX_ROOT}
DOC "The directory where KTX/libktx.so resides")
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(KTX DEFAULT_MSG KTX_INCLUDE_DIR KTX_LIBRARY)
# Define KTX_LIBRARIES and KTX_INCLUDE_DIRS
if (KTX_FOUND)
set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR})
set(KTX_LIBRARIES ${KTX_LIBRARY})
set(KTX_BINARIES ${KTX_BINARY})
endif()
# Hide some variables
mark_as_advanced(KTX_INCLUDE_DIR)
mark_as_advanced(KTX_LIBRARY)
-82
View File
@@ -1,82 +0,0 @@
#
# 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()
set(SLANG_BINARY_PATH ${SLANG_ROOT}/bin/linux-${CMAKE_PLATFORM}/release/)
# Find include files
find_path(
SLANG_INCLUDE_DIR
NAMES slang.h
PATHS
${SLANG_ROOT}
DOC "The directory where GL/glfw.h resides")
# Find library files
find_library(
SLANG_LIBRARY
NAMES libslang.so
PATHS
${SLANG_BINARY_PATH}
NO_DEFAULT_PATH
DOC "The SLANG library")
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(SLANG DEFAULT_MSG SLANG_INCLUDE_DIR SLANG_LIBRARY)
# Define SLANG_LIBRARIES and SLANG_INCLUDE_DIRS
if (SLANG_FOUND)
set(SLANG_BINARIES ${SLANG_BINARY})
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)
-50
View File
@@ -1,50 +0,0 @@
#
# Find SPIR-V Cross
#
# Try to find SPIR-V Cross library.
# This module defines the following variables:
# - SPIRV_INCLUDE_DIRS
# - SPIRV_LIBRARIES
# - SPIRV_FOUND
#
# The following variables can be set as arguments for the module.
# - SPIRV_ROOT : Root library directory of SPIR-V Cross
#
# References:
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindGLFW.cmake
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindGLFW.cmake
#
# Additional modules
include(FindPackageHandleStandardArgs)
find_path(SPIRV_INCLUDE_DIR
NAMES spirv.h
PATHS
${SPIRV_ROOT})
find_library(SPIRV_CORE_LIBRARY
NAMES spirv-cross-core${CMAKE_DEBUG_POSTFIX}
PATHS
${Seele_BINARY_DIR}/external/SPIRV-Cross)
find_library(SPIRV_GLSL_LIBRARY
NAMES spirv-cross-glsl${CMAKE_DEBUG_POSTFIX}
PATHS
${Seele_BINARY_DIR}/external/SPIRV-Cross)
find_library(SPIRV_REFLECT_LIBRARY
NAMES spirv-cross-reflect${CMAKE_DEBUG_POSTFIX}
PATHS
${Seele_BINARY_DIR}/external/SPIRV-Cross)
find_package_handle_standard_args(SPIRV DEFAULT_MSG SPIRV_CORE_LIBRARY SPIRV_GLSL_LIBRARY SPIRV_REFLECT_LIBRARY SPIRV_INCLUDE_DIR)
if(SPIRV_FOUND)
set(SPIRV_LIBRARIES ${SPIRV_CORE_LIBRARY} ${SPIRV_GLSL_LIBRARY} ${SPIRV_REFLECT_LIBRARY})
set(SPIRV_INCLUDE_DIRS ${SPIRV_INCLUDE_DIR})
endif()
mark_as_advanced(SPIRV_INCLUDE_DIR SPIRV_LIBRARY)
-51
View File
@@ -1,51 +0,0 @@
#
# 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)
#
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
STB_INCLUDE_DIR
NAMES stb.h
PATHS
$ENV{PROGRAMFILES}/include
${STB_ROOT}/include
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
${STB_ROOT}
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)
-68
View File
@@ -1,68 +0,0 @@
#
# Find TTFPARSER
#
# Try to find TTFPARSER library.
# This module defines the following variables:
# - TTFPARSER_INCLUDE_DIRS
# - TTFPARSER_LIBRARIES
# - TTFPARSER_FOUND
#
# The following variables can be set as arguments for the module.
# - TTFPARSER_ROOT : Root library directory of TTFPARSER
# - TTFPARSER_USE_STATIC_LIBS : Specifies to use static version of TTFPARSER library (Windows only)
#
# References:
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindTTFPARSER.cmake
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindTTFPARSER.cmake
#
# Additional modules
include(FindPackageHandleStandardArgs)
if (WIN32)
# Find include files
find_path(
TTFPARSER_INCLUDE_DIR
NAMES ttfParser.h
PATHS
$ENV{PROGRAMFILES}/include
${TTFPARSER_ROOT}/src
DOC "The directory where TTFPARSER/glfw.h resides")
else()
# Find include files
find_path(
TTFPARSER_INCLUDE_DIR
NAMES TTFPARSER/glfw3.h
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glfw.h resides")
# Find library files
find_file(
TTFPARSER_LIBRARY
NAMES libglfw${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${TTFPARSER_ROOT}/src
)
endif()
# Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(TTFPARSER DEFAULT_MSG TTFPARSER_INCLUDE_DIR)
# Define TTFPARSER_LIBRARIES and TTFPARSER_INCLUDE_DIRS
if (TTFPARSER_FOUND)
set(TTFPARSER_INCLUDE_DIRS ${TTFPARSER_INCLUDE_DIR})
endif()
# Hide some variables
mark_as_advanced(TTFPARSER_INCLUDE_DIR)
+43 -54
View File
@@ -1,57 +1,39 @@
include (ExternalProject) include (ExternalProject)
set(DEPENDENCIES)
set(EXTRA_CMAKE_ARGS)
#------------ASSIMP--------------- #------------ASSIMP---------------
list(APPEND DEPENDENCIES assimp)
set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "") set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "")
set(ASSIMP_BUILD_SAMPLES OFF CACHE INTERNAL "") set(ASSIMP_BUILD_SAMPLES OFF CACHE INTERNAL "")
set(ASSIMP_BUILD_OVERALLS OFF CACHE INTERNAL "") set(ASSIMP_BUILD_OVERALLS OFF CACHE INTERNAL "")
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "") set(BUILD_SHARED_LIBS ON CACHE INTERNAL "")
add_subdirectory(${ASSIMP_ROOT} ${ASSIMP_ROOT}) add_subdirectory(${ASSIMP_ROOT})
target_compile_definitions(assimp PRIVATE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING) target_compile_definitions(assimp PRIVATE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
if(WIN32) if(WIN32)
target_compile_options(assimp PRIVATE /WX-) target_compile_options(assimp PRIVATE /WX-)
else() else()
target_compile_options(assimp PRIVATE -Wno-error -fPIC) target_compile_options(assimp PRIVATE -Wno-error -fPIC)
target_compile_options(IrrXML PRIVATE -fPIC) target_compile_options(IrrXML PRIVATE -fPIC)
endif() endif()
#-------------BOOST---------------- #-------------BOOST----------------
list(APPEND DEPENDENCIES boost) add_subdirectory(${BOOST_ROOT})
if(WIN32)
set(BOOTSTRAP_EXTENSION bat)
else()
set(BOOTSTRAP_EXTENSION sh)
endif()
ExternalProject_Add(boost
SOURCE_DIR ${BOOST_ROOT}
CONFIGURE_COMMAND ./bootstrap.${BOOTSTRAP_EXTENSION} --with-libraries=serialization,test
BUILD_COMMAND ./b2 -d0 -link=shared
BUILD_IN_SOURCE 1
INSTALL_COMMAND "")
list (APPEND EXTRA_CMAKE_ARGS
-DBoost_NO_SYSTEM_PATHS=ON)
#-----------------KTX---------------------------- #-----------------KTX----------------------------
list(APPEND DEPENDENCIES ktx)
find_program(BASH_EXECUTABLE git-bash) find_program(BASH_EXECUTABLE git-bash)
set(KTX_FEATURE_TESTS off) set(KTX_FEATURE_TESTS off)
add_subdirectory(${KTX_ROOT} ${KTX_ROOT}) add_subdirectory(${KTX_ROOT} ${KTX_ROOT})
#--------------------JSON------------------ #--------------------JSON------------------
list(APPEND DEPENDENCIES nlohmann_json)
set(JSON_MultipleHeaders ON CACHE INTERNAL "") set(JSON_MultipleHeaders ON CACHE INTERNAL "")
set(JSON_BuildTests OFF CACHE INTERNAL "") set(JSON_BuildTests OFF CACHE INTERNAL "")
set(JSON_Install OFF CACHE INTERNAL "") set(JSON_Install OFF CACHE INTERNAL "")
add_subdirectory(${JSON_ROOT} ${JSON_ROOT}) add_subdirectory(${JSON_ROOT})
#--------------GLM------------------------------
add_subdirectory(${GLM_ROOT})
#--------------GLFW------------------------------ #--------------GLFW------------------------------
list(APPEND DEPENDENCIES glfw)
set(ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build basic example applications" ) set(ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build basic example applications" )
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW lib only" )
set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" )
@@ -59,43 +41,50 @@ set(GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only" )
set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" )
set(GLFW_VULKAN_STATIC OFF CACHE BOOL "GLFW vulkan static") set(GLFW_VULKAN_STATIC OFF CACHE BOOL "GLFW vulkan static")
add_subdirectory(${GLFW_ROOT} ${GLFW_ROOT}) add_subdirectory(${GLFW_ROOT})
#--------------EnTT------------------------------ #--------------EnTT------------------------------
list(APPEND DEPENDENCIES EnTT) add_subdirectory(${ENTT_ROOT})
add_subdirectory(${ENTT_ROOT} ${ENTT_ROOT})
#--------------FreeType------------------------------ #--------------FreeType------------------------------
list(APPEND DEPENDENCIES freetype) add_subdirectory(${FREETYPE_ROOT})
#--------------STB-----------------------------------
add_library(stb INTERFACE)
target_include_directories(stb INTERFACE ${STB_ROOT})
#--------------Aftermath------------------------------
add_library(nsam INTERFACE)
target_include_directories(nsam INTERFACE ${NSAM_ROOT}/include)
target_link_libraries(nsam INTERFACE ${NSAM_ROOT}/lib/${CMAKE_PLATFORM}/*.lib)
set_target_properties(nsam PROPERTIES NSAM_BINARY ${NSAM_ROOT}/lib/${CMAKE_PLATFORM}/GFSDK_Aftermath_Lib.${CMAKE_PLATFORM}.dll)
set_target_properties(nsam PROPERTIES LLVM_BINARY ${NSAM_ROOT}/lib/${CMAKE_PLATFORM}/llvm_7_0_1.dll)
add_subdirectory(${FREETYPE_ROOT} ${FREETYPE_ROOT})
#--------------SLang------------------------------ #--------------SLang------------------------------
list(APPEND DEPENDENCIES slang)
string(TOLOWER release_${CMAKE_PLATFORM} SLANG_CONFIG) string(TOLOWER release_${CMAKE_PLATFORM} SLANG_CONFIG)
if(WIN32) if(WIN32)
ExternalProject_Add(slang string(TOLOWER ${SLANG_ROOT}/bin/windows-${CMAKE_PLATFORM}/release SLANG_BINARY_DIR)
SOURCE_DIR ${SLANG_ROOT} ExternalProject_Add(slang-build
BINARY_DIR ${SLANG_ROOT} SOURCE_DIR ${SLANG_ROOT}
CONFIGURE_COMMAND premake.bat vs2019 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake --arch=${CMAKE_PLATFORM} --deps=true BINARY_DIR ${SLANG_ROOT}
BUILD_COMMAND msbuild slang.sln -p:Configuration=Release -p:Platform=${CMAKE_PLATFORM} CONFIGURE_COMMAND ${SLANG_ROOT}/premake.bat vs2019 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake --arch=${CMAKE_PLATFORM} --deps=true
INSTALL_COMMAND "") BUILD_COMMAND msbuild slang.sln -p:Configuration=Release -p:Platform=${CMAKE_PLATFORM}
INSTALL_COMMAND "")
elseif(UNIX) elseif(UNIX)
ExternalProject_Add(slang ExternalProject_Add(slang-build
SOURCE_DIR ${SLANG_ROOT} SOURCE_DIR ${SLANG_ROOT}
BINARY_DIR ${SLANG_ROOT} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake --arch=${CMAKE_PLATFORM} --deps=true --build-location=build/linux CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake --arch=${CMAKE_PLATFORM} --deps=true --build-location=build/linux
BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build/linux config=${SLANG_CONFIG} BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build/linux config=${SLANG_CONFIG}
INSTALL_COMMAND "") INSTALL_COMMAND "")
endif() endif()
add_library(slang INTERFACE)
#-----------------SeeleEngine-------------------- target_include_directories(slang INTERFACE ${SLANG_ROOT})
ExternalProject_Add(SeeleEngine target_link_libraries(slang INTERFACE ${SLANG_BINARY_DIR}/*.lib)
DEPENDS ${DEPENDENCIES} set_target_properties(slang PROPERTIES SLANG_BINARY ${SLANG_BINARY_DIR}/slang.dll)
SOURCE_DIR ${PROJECT_SOURCE_DIR} set_target_properties(slang PROPERTIES GLSLANG_BINARY ${SLANG_BINARY_DIR}/slang-glslang.dll)
PREFIX ${CMAKE_BINARY_DIR}
BINARY_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -DUSE_SUPERBUILD=OFF ${EXTRA_CMAKE_ARGS}
INSTALL_COMMAND "")
+1 -1
+1 -1
+4 -8
View File
@@ -1,19 +1,15 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ".") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ".")
find_package(Boost COMPONENTS unit_test_framework REQUIRED) find_package(Boost COMPONENTS unit_test_framework REQUIRED)
find_package(Aftermath REQUIRED) find_package(Vulkan REQUIRED)
add_subdirectory(Engine/) add_subdirectory(Engine/)
target_include_directories(Seele_unit_tests PRIVATE ${ENGINE_ROOT}) target_include_directories(Seele_unit_tests PRIVATE ${ENGINE_ROOT})
target_include_directories(Seele_unit_tests PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(Seele_unit_tests PRIVATE ${GLM_INCLUDE_DIRS})
target_include_directories(Seele_unit_tests PRIVATE ${Vulkan_INCLUDE_DIR})
target_include_directories(Seele_unit_tests PRIVATE ${NSAM_INCLUDE_DIRS})
target_link_libraries(Seele_unit_tests ${Boost_LIBRARIES}) target_link_libraries(Seele_unit_tests PRIVATE Boost::unit_test_framework)
target_link_libraries(Seele_unit_tests ${Vulkan_LIBRARY}) target_link_libraries(Seele_unit_tests PRIVATE Vulkan::Vulkan)
target_link_libraries(Seele_unit_tests ${NSAM_LIBRARIES}) target_link_libraries(Seele_unit_tests PRIVATE nsam)
if(UNIX) if(UNIX)
target_compile_definitions(Seele_unit_tests PRIVATE -DBOOST_TEST_DYN_LINK) target_compile_definitions(Seele_unit_tests PRIVATE -DBOOST_TEST_DYN_LINK)
endif() endif()