Files
itgmania212121/CMake/Modules/FindDirectX.cmake
T
Jason Felds dc94728628 Introduce cmake (min 2.8.12) to StepMania.
tl-dr: view the Build directory to see.

This is intended to replace the project files that we presently maintain
so that only a single set is needed instead of multiples.

The following setups were used for testing:

* Windows 8 and Visual Studio 2013 Desktop Express
* Windows 7 and Visual Studio 2012
* Mac OS X Mavericks and Xcode
* Ubuntu and makefiles
* Fedora 21 and makefiles

All three operating systems can generate projects, compile, link, and
run. Windows and Mac OS X users will find their compiled binary in the
same location as before, but Linux users will be surprised: it goes
straight into the root directory, along with a symlinked GtkModules.so
as appropriate. There is no more need for a manual symlinking step.

Known issues:

* At this time, MinGW likely does not work. Extra time will be needed.
* The WITH_JPEG option may go away, and we'll just always require it.
* Some linux libraries can use the system equivalents, but that is not up yet.

For more information, check out the Build directory.
2015-03-21 20:15:15 -04:00

43 lines
1.1 KiB
CMake

# From the CMake wiki, get the DirectX version needed.
# This assumes default directories.
# Once loaded, the following are defined:
# DIRECTX_FOUND
# DIRECTX_INCLUDE_DIR
# DIRECTX_LIBRARIES
if(NOT WIN32)
return()
endif()
set(DIRECTX_INCLUDE_SEARCH_PATHS
# TODO: Do not be limited to x86 in the future.
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include"
"C:/DXSDK/Include"
)
set(DIRECTX_LIBRARY_SEARCH_PATHS
# TODO: Do not be limited to x86 in the future.
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86"
"C:/DXSDK/Include/Lib/x86"
)
find_path(DIRECTX_INCLUDE_DIR
NAMES "DxErr.h"
PATHS ${DIRECTX_INCLUDE_SEARCH_PATHS}
DOC "Where can DxErr.h be found?"
)
find_library(DIRECTX_LIBRARIES
NAMES "DxErr.lib" "d3dx9.lib"
PATHS ${DIRECTX_LIBRARY_SEARCH_PATHS}
DOC "Where can the DX libraries be found?"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DIRECTX DEFAULT_MSG DIRECTX_INCLUDE_DIR DIRECTX_LIBRARIES)
if(DIRECTX_FOUND)
mark_as_advanced(DIRECTX_INCLUDE_DIR DIRECTX_LIBRARIES)
endif()