2015-09-02 18:52:04 +00:00
|
|
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
2017-11-14 04:51:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
2015-07-07 03:24:09 +00:00
|
|
|
project(hecl)
|
2017-06-18 02:50:55 +00:00
|
|
|
|
2015-07-26 02:52:02 +00:00
|
|
|
if(MSVC)
|
2020-04-11 04:58:06 +00:00
|
|
|
add_compile_options(
|
|
|
|
# Disable exceptions
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
|
|
|
|
/wd4267 /wd4244
|
|
|
|
)
|
|
|
|
add_compile_definitions(UNICODE=1 _UNICODE=1 _CRT_SECURE_NO_WARNINGS=1)
|
2015-07-22 19:14:50 +00:00
|
|
|
else()
|
2020-04-11 04:58:06 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
add_compile_options(
|
|
|
|
# Disable exceptions
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
|
|
|
-Wno-multichar
|
|
|
|
)
|
2015-07-22 19:14:50 +00:00
|
|
|
endif()
|
2015-08-17 21:46:04 +00:00
|
|
|
endif()
|
|
|
|
|
2018-10-07 02:53:57 +00:00
|
|
|
include(ApplicationTools.cmake)
|
|
|
|
|
2019-06-12 02:01:19 +00:00
|
|
|
configure_file(DataSpecRegistry.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/DataSpecRegistry.hpp @ONLY)
|
2015-08-17 22:15:23 +00:00
|
|
|
|
2018-10-07 02:53:57 +00:00
|
|
|
unset(HECL_APPLICATION_REPS_INCLUDES_LOCAL)
|
|
|
|
foreach(theHeader ${HECL_APPLICATION_REPS_INCLUDES_LIST})
|
|
|
|
set(HECL_APPLICATION_REPS_INCLUDES_LOCAL "${HECL_APPLICATION_REPS_INCLUDES_LOCAL}#include \"${theHeader}\"\n")
|
|
|
|
endforeach()
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_UNIVERSAL_LOCAL)
|
|
|
|
foreach(name ${HECL_APPLICATION_PIPELINE_REPS_UNIVERSAL})
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_UNIVERSAL_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_UNIVERSAL_LOCAL}UNIVERSAL_PIPELINES_${name} \\\n")
|
|
|
|
endforeach()
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_OPENGL_LOCAL)
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_VULKAN_LOCAL)
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_D3D11_LOCAL)
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_METAL_LOCAL)
|
|
|
|
unset(HECL_APPLICATION_PIPELINE_REPS_NX_LOCAL)
|
|
|
|
foreach(name ${HECL_APPLICATION_PIPELINE_REPS})
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_OPENGL_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_OPENGL_LOCAL}OPENGL_PIPELINES_${name} \\\n")
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_VULKAN_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_VULKAN_LOCAL}VULKAN_PIPELINES_${name} \\\n")
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_D3D11_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_D3D11_LOCAL}D3D11_PIPELINES_${name} \\\n")
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_METAL_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_METAL_LOCAL}METAL_PIPELINES_${name} \\\n")
|
|
|
|
set(HECL_APPLICATION_PIPELINE_REPS_NX_LOCAL "${HECL_APPLICATION_PIPELINE_REPS_NX_LOCAL}NX_PIPELINES_${name} \\\n")
|
|
|
|
endforeach()
|
|
|
|
|
2018-10-14 20:09:15 +00:00
|
|
|
unset(HECL_APPLICATION_STAGE_REPS_LOCAL)
|
2018-10-07 02:53:57 +00:00
|
|
|
foreach(name ${HECL_APPLICATION_STAGE_REPS})
|
2018-10-14 20:09:15 +00:00
|
|
|
set(HECL_APPLICATION_STAGE_REPS_LOCAL "${HECL_APPLICATION_STAGE_REPS_LOCAL}STAGES_${name}(P, S) \\\n")
|
2018-10-07 02:53:57 +00:00
|
|
|
endforeach()
|
|
|
|
|
2019-05-10 23:08:05 +00:00
|
|
|
configure_file(include/hecl/ApplicationReps.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/ApplicationReps.hpp @ONLY)
|
2018-10-07 02:53:57 +00:00
|
|
|
|
2017-12-07 04:09:27 +00:00
|
|
|
if(NOT TARGET atdna)
|
|
|
|
# Import native atdna if cross-compiling
|
|
|
|
find_package(atdna REQUIRED)
|
|
|
|
if(NOT TARGET atdna)
|
|
|
|
message(FATAL_ERROR "atdna required for building hecl; please verify LLVM installation")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-07-07 03:24:09 +00:00
|
|
|
add_subdirectory(lib)
|
2015-07-08 04:26:29 +00:00
|
|
|
add_subdirectory(blender)
|
2015-07-07 03:24:09 +00:00
|
|
|
add_subdirectory(driver)
|
2016-03-04 23:02:44 +00:00
|
|
|
install(DIRECTORY include/hecl DESTINATION include/hecl)
|