From 6c7f3305b0dc4cb2bd77d3aff00a2166ab51e415 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Mon, 15 Mar 2021 17:28:32 -0500 Subject: [PATCH] Revert "Build Assimp from source" This reverts commit f5cefe650dfe35b6339c0a840e2d9c996211dd48. --- cmake/modules/FindASSIMP.cmake | 32 ++++++++++++++++++++++++++++++++ core/CMakeLists.txt | 8 ++++++++ roadmap.md | 12 ------------ thirdparty/CMakeLists.txt | 7 ------- 4 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 cmake/modules/FindASSIMP.cmake diff --git a/cmake/modules/FindASSIMP.cmake b/cmake/modules/FindASSIMP.cmake new file mode 100644 index 0000000..c7ff71b --- /dev/null +++ b/cmake/modules/FindASSIMP.cmake @@ -0,0 +1,32 @@ +# - Try to find Assimp +# Once done, this will define +# +# ASSIMP_FOUND - system has Assimp +# ASSIMP_INCLUDE_DIR - the Assimp include directories +# ASSIMP_LIBRARIES - link these to use Assimp +FIND_PATH( ASSIMP_INCLUDE_DIR assimp/mesh.h + /usr/include + /usr/local/include + /opt/local/include + ${CMAKE_SOURCE_DIR}/includes + ) +FIND_LIBRARY( ASSIMP_LIBRARY assimp + /usr/lib64 + /usr/lib + /usr/local/lib + /opt/local/lib + ${CMAKE_SOURCE_DIR}/lib + ) +IF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY) + SET( ASSIMP_FOUND TRUE ) + SET( ASSIMP_LIBRARIES ${ASSIMP_LIBRARY} ) +ENDIF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY) +IF(ASSIMP_FOUND) + IF(NOT ASSIMP_FIND_QUIETLY) + MESSAGE(STATUS "Found ASSIMP: ${ASSIMP_LIBRARY}") + ENDIF(NOT ASSIMP_FIND_QUIETLY) +ELSE(ASSIMP_FOUND) + IF(ASSIMP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find libASSIMP") + ENDIF(ASSIMP_FIND_REQUIRED) +ENDIF(ASSIMP_FOUND) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 2c76e34..a1c0d6f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -8,6 +8,9 @@ find_package(glfw3 3.3 REQUIRED) ## Find Bullet find_package(Bullet REQUIRED) +## Find AssImp +find_package(ASSIMP REQUIRED) + if (LUA_ENABLED) ## Find Lua find_package(Lua REQUIRED) @@ -85,6 +88,10 @@ target_include_directories(couchlib PUBLIC ${BULLET_INCLUDE_DIRS}) +target_include_directories(couchlib + PUBLIC + ${ASSIMP_INCLUDE_DIR}) + target_link_libraries(couchlib glfw) target_link_libraries(couchlib OpenGL::GL) target_link_libraries(couchlib GLEW::GLEW) @@ -92,6 +99,7 @@ if (LUA_ENABLED) target_link_libraries(couchlib_luascripting ${LUA_LIBRARIES}) endif () target_link_libraries(couchlib ${BULLET_LIBRARIES}) +target_link_libraries(couchlib ${ASSIMP_LIBRARY}) ## Add documentation find_package(Doxygen REQUIRED diff --git a/roadmap.md b/roadmap.md index 5d57ea6..a857f42 100644 --- a/roadmap.md +++ b/roadmap.md @@ -96,15 +96,3 @@ motivation comes from new features. - [x] Compiles for windows DLL Hell is still an issue, I have to distribute like 30 of them. Might go back to simply including them in the package. - -## Make platform available for retail -I think I might want to sell this software at some point. -- [ ] Add thirdparty libraries to source package - - [ ] Assimp - - [ ] Bullet - - [ ] Lua - - [ ] GLEW - - [ ] GLFW -- [ ] Double check for GPL compliance -- [ ] Host API somewhere -- [ ] Itch.io stuff diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 1f389d2..a3c7751 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -3,10 +3,3 @@ project(Couch) ## STB (image) target_include_directories(couchlib PUBLIC stb) - -## ASSIMP -add_subdirectory(assimp) -target_include_directories(couchlib - PUBLIC - assimp/include) -target_link_libraries(couchlib assimp::assimp)