From 9474bbc8e9f21ffb71f714ad5f62e119e1dfa9ec Mon Sep 17 00:00:00 2001 From: Russ Taylor Date: Sat, 4 Jul 2015 16:08:26 -0400 Subject: [PATCH 1/2] Checks for DirectX. If it is not found, does not pull in the assimp_view project that needs it. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a79c0c371..ffbcf5b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${C configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT}) +FIND_PACKAGE( DirectX ) + option ( ASSIMP_NO_EXPORT "Disable Assimp's export functionality." OFF @@ -242,9 +244,9 @@ option ( ASSIMP_BUILD_ASSIMP_TOOLS ON ) IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) - IF ( WIN32 ) + IF ( WIN32 AND DirectX_FOUND ) ADD_SUBDIRECTORY( tools/assimp_view/ ) - ENDIF ( WIN32 ) + ENDIF ( WIN32 AND DirectX_FOUND ) ADD_SUBDIRECTORY( tools/assimp_cmd/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) From 8d07cfe1f3e3d27495b60dd69aef84606bb1a849 Mon Sep 17 00:00:00 2001 From: Russ Taylor Date: Sat, 4 Jul 2015 16:08:56 -0400 Subject: [PATCH 2/2] Does not try and find the math library under Visual Studio compilers, where it is not needed. --- samples/SimpleOpenGL/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/SimpleOpenGL/CMakeLists.txt b/samples/SimpleOpenGL/CMakeLists.txt index ac3b4da1c..52c994b63 100644 --- a/samples/SimpleOpenGL/CMakeLists.txt +++ b/samples/SimpleOpenGL/CMakeLists.txt @@ -1,6 +1,10 @@ FIND_PACKAGE(OpenGL) FIND_PACKAGE(GLUT) -find_library(M_LIB m) +IF ( MSVC ) + SET(M_LIB) +ELSE ( MSVC ) + find_library(M_LIB m) +ENDIF ( MSVC ) IF ( NOT GLUT_FOUND ) IF ( MSVC )