diff options
| author | Jason Maskell <[email protected]> | 2016-05-16 15:00:36 +0200 |
|---|---|---|
| committer | Jason Maskell <[email protected]> | 2016-05-16 15:00:36 +0200 |
| commit | 3eb017d032e0c542401ea202f7a62b7c7ddcd498 (patch) | |
| tree | 6470077bdc344f1493778976917f7217a3159707 /cmake | |
| parent | Project now compiles with Cmake. (diff) | |
| download | waveworks_archive-3eb017d032e0c542401ea202f7a62b7c7ddcd498.tar.xz waveworks_archive-3eb017d032e0c542401ea202f7a62b7c7ddcd498.zip | |
Added the test_d3d11 app to the solution. Not compiling yet, mostly a paranoia commit.
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/CompileFXToFXO.cmake | 20 | ||||
| -rw-r--r-- | cmake/FindDXUT.cmake | 48 | ||||
| -rw-r--r-- | cmake/FindDirectXTK.cmake | 39 | ||||
| -rw-r--r-- | cmake/FindFX11.cmake | 40 |
4 files changed, 147 insertions, 0 deletions
diff --git a/cmake/CompileFXToFXO.cmake b/cmake/CompileFXToFXO.cmake new file mode 100644 index 0000000..24482bf --- /dev/null +++ b/cmake/CompileFXToFXO.cmake @@ -0,0 +1,20 @@ +FUNCTION(CompileFXToFXO FILE OUTPUT_FILE TARGET INCLUDE_DIR OPTIONS) + + GET_FILENAME_COMPONENT(FILE_WE ${FILE} NAME_WE) + +#fxc /nologo /O3 /Tfx_5_0 /Fo..\..\..\test\media\skybox_d3d11.fxo /I..\..\..\output\distro\win-public\shader ..\..\..\test\d3d11\skybox.fx + + + ADD_CUSTOM_COMMAND( + PRE_BUILD +# TARGET ${TARGET} + OUTPUT ${OUTPUT_FILE} + COMMAND ${DirectX_FXC_EXECUTABLE} /I${INCLUDE_DIR} ${FILE} /Fo ${OUTPUT_FILE} ${OPTIONS} ${ARGV5} ${ARGV6} + MAIN_DEPENDENCY ${FILE} + COMMENT "FXC Compile ${FILE}" + VERBATIM + ) + + #ADD_DEPENDENCIES(${TARGET} ${OUTPUT_DIR}/generated/${FILE_WE}.h) + +ENDFUNCTION(CompileFXToFXO) diff --git a/cmake/FindDXUT.cmake b/cmake/FindDXUT.cmake new file mode 100644 index 0000000..00cc663 --- /dev/null +++ b/cmake/FindDXUT.cmake @@ -0,0 +1,48 @@ +# Find DXUT + +include(FindPackageHandleStandardArgs) + +if (CMAKE_CL_64) + set(DXUTARCH "x64") +else() + set(DXUTARCH "Win32") +endif() + +find_path(DXUT_SDK_PATH Core/DXUT.h + HINTS ${GW_DEPS_ROOT}/DXUT + ) + +find_library(DXUT_LIBRARY_RELEASE + NAMES DXUT + PATHS ${DXUT_SDK_PATH}/Core/Bin/*/${DXUTARCH}/Release) + +find_library(DXUT_LIBRARY_DEBUG + NAMES DXUT + PATHS ${DXUT_SDK_PATH}/Core/Bin/*/${DXUTARCH}/Debug) + +find_library(DXUT_Opt_LIBRARY_RELEASE + NAMES DXUTOpt + PATHS ${DXUT_SDK_PATH}/Optional/Bin/*/${DXUTARCH}/Release) + +find_library(DXUT_Opt_LIBRARY_DEBUG + NAMES DXUTOpt + PATHS ${DXUT_SDK_PATH}/Optional/Bin/*/${DXUTARCH}/Debug) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXUT + DEFAULT_MSG + DXUT_LIBRARY_RELEASE + DXUT_Opt_LIBRARY_RELEASE + DXUT_SDK_PATH) + +if(DXUT_FOUND) + mark_as_advanced(DXUT_SDK_PATH DXUT_LIBRARY_RELEASE DXUT_LIBRARY_DEBUG DXUT_Opt_LIBRARY_RELEASE DXUT_Opt_LIBRARY_DEBUG) + set(DXUT_INCLUDE_DIRS + ${DXUT_SDK_PATH}/Core + ${DXUT_SDK_PATH}/Optional + CACHE STRING "") + + set(DXUT_LIBRARIES + optimized ${DXUT_LIBRARY_RELEASE} optimized ${DXUT_Opt_LIBRARY_RELEASE} + debug ${DXUT_LIBRARY_DEBUG} debug ${DXUT_Opt_LIBRARY_DEBUG} + CACHE STRING "") +endif()
\ No newline at end of file diff --git a/cmake/FindDirectXTK.cmake b/cmake/FindDirectXTK.cmake new file mode 100644 index 0000000..21ecbe3 --- /dev/null +++ b/cmake/FindDirectXTK.cmake @@ -0,0 +1,39 @@ +# Find DirectXTK + +include(FindPackageHandleStandardArgs) + +if (CMAKE_CL_64) + set(DXTKARCH "x64") +else() + set(DXTKARCH "Win32") +endif() + +find_path(DXTK_SDK_PATH DirectXHelpers.h + HINTS ${GW_DEPS_ROOT}/DirectXTK/Inc + ) + +find_library(DXTK_LIBRARY_RELEASE + NAMES DirectXTK + PATHS ${DXTK_SDK_PATH}/Bin/*/${DXTKARCH}/Release) + +find_library(DXTK_LIBRARY_DEBUG + NAMES DirectXTK + PATHS ${DXTK_SDK_PATH}/Bin/*/${DXTKARCH}/Debug) + + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXTK + DEFAULT_MSG + DXTK_LIBRARY_RELEASE + DXTK_SDK_PATH) + +if(DXTK_FOUND) + mark_as_advanced(DXTK_SDK_PATH DXTK_LIBRARY_RELEASE DXTK_LIBRARY_DEBUG) + set(DXTK_INCLUDE_DIRS + ${DXTK_SDK_PATH}/inc + CACHE STRING "") + + set(DXTK_LIBRARIES + optimized ${DXTK_LIBRARY_RELEASE} + debug ${DXTK_LIBRARY_DEBUG} + CACHE STRING "") +endif()
\ No newline at end of file diff --git a/cmake/FindFX11.cmake b/cmake/FindFX11.cmake new file mode 100644 index 0000000..0620b29 --- /dev/null +++ b/cmake/FindFX11.cmake @@ -0,0 +1,40 @@ +# Find FX11 + +include(FindPackageHandleStandardArgs) + +if (CMAKE_CL_64) + set(FX11ARCH "x64") +else() + set(FX11ARCH "Win32") +endif() + +find_path(FX11_SDK_PATH Effect.h + HINTS ${GW_DEPS_ROOT}/FX11 + ) + +find_library(FX11_LIBRARY_RELEASE + NAMES Effects11 + PATHS ${FX11_SDK_PATH}/Bin/*/${FX11ARCH}/Release) + +find_library(FX11_LIBRARY_DEBUG + NAMES Effects11 + PATHS ${FX11_SDK_PATH}/Bin/*/${FX11ARCH}/Debug) + + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(FX11 + DEFAULT_MSG + FX11_LIBRARY_RELEASE + FX11_SDK_PATH) + +if(FX11_FOUND) + mark_as_advanced(FX11_SDK_PATH FX11_LIBRARY_RELEASE FX11_LIBRARY_DEBUG) + set(FX11_INCLUDE_DIRS + ${FX11_SDK_PATH} + ${FX11_SDK_PATH}/inc + CACHE STRING "") + + set(FX11_LIBRARIES + optimized ${FX11_LIBRARY_RELEASE} + debug ${FX11_LIBRARY_DEBUG} + CACHE STRING "") +endif()
\ No newline at end of file |