summaryrefslogtreecommitdiff
path: root/cmake/FindFXC.cmake
diff options
context:
space:
mode:
authorJason Maskell <Jason Maskell>2016-07-26 16:21:57 +0700
committerJason Maskell <Jason Maskell>2016-07-26 16:21:57 +0700
commit9d3f79f7e7e68ca9e296368587ab22494ffaf19b (patch)
treeeaa4190d763f6504ba5ba91fe367c937406a2a45 /cmake/FindFXC.cmake
parentModified finders to take Visual Studio platform into account when finding lib... (diff)
downloadwaveworks_archive-9d3f79f7e7e68ca9e296368587ab22494ffaf19b.tar.xz
waveworks_archive-9d3f79f7e7e68ca9e296368587ab22494ffaf19b.zip
Added Packman support - now the GenerateProjects.bat uses Packman to pull dependencies specified in WaveWorksDependencies.xml
Finders of these dependencies are modified to look in the Packman repo.
Diffstat (limited to 'cmake/FindFXC.cmake')
-rw-r--r--cmake/FindFXC.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/FindFXC.cmake b/cmake/FindFXC.cmake
new file mode 100644
index 0000000..27ffd07
--- /dev/null
+++ b/cmake/FindFXC.cmake
@@ -0,0 +1,33 @@
+include(FindPackageHandleStandardArgs)
+
+set(_programfiles "")
+foreach(v "ProgramW6432" "ProgramFiles" "ProgramFiles(x86)")
+ if(DEFINED "ENV{${v}}")
+ file(TO_CMAKE_PATH "$ENV{${v}}" _env_programfiles)
+ list(APPEND _programfiles "${_env_programfiles}/Windows Kits/8.1/bin/x86")
+ unset(_env_programfiles)
+ endif()
+endforeach()
+
+# Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053. See
+# http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html
+set (ProgramFiles_x86 "ProgramFiles(x86)")
+if ("$ENV{${ProgramFiles_x86}}")
+ set (ProgramFiles "$ENV{${ProgramFiles_x86}}")
+else ()
+ set (ProgramFiles "$ENV{ProgramFiles}")
+endif ()
+
+MESSAGE("Trying to find ${ProgramFiles}/Windows Kits/8.1/bin/x86 ${ProgramFiles}/Windows Kits/8.0/bin/x86")
+
+find_program (DirectX_FXC_EXECUTABLE fxc
+ HINTS ${_programfiles}
+
+ DOC "Path to fxc.exe executable."
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FXC
+ DEFAULT_MSG
+ DirectX_FXC_EXECUTABLE
+)
+