SHARE
TWEET

Untitled

a guest Jul 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required (VERSION 3.15)
  2.  
  3. include(FetchContent)
  4.  
  5. project(test LANGUAGES C CXX)
  6.  
  7. IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  8.   SET(CMAKE_INSTALL_PREFIX install CACHE PATH "Install Path" FORCE)
  9. ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  10.  
  11. # SDL2
  12. set(SDL_SHARED OFF CACHE INTERNAL "")
  13. set(SDL_STATIC_PIC ON CACHE INTERNAL "")
  14. FetchContent_Declare(SDL
  15.   HG_REPOSITORY http://hg.libsdl.org/SDL
  16.   HG_TAG        release-2.0.9
  17. )
  18. FetchContent_MakeAvailable(SDL)
  19.  
  20. # assimp
  21. set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
  22. set(ASSIMP_NO_EXPORT ON CACHE INTERNAL "")
  23. set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE INTERNAL "")
  24. set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "")
  25. FetchContent_Declare(assimp
  26.   GIT_REPOSITORY https://github.com/assimp/assimp.git
  27.   GIT_TAG        origin/master
  28.   GIT_SHALLOW    ON
  29.   GIT_PROGRESS   ON
  30. )
  31. FetchContent_MakeAvailable(assimp)
  32.  
  33. add_executable(test)
  34.  
  35. target_sources(test PRIVATE src/test.cpp)
  36. target_link_libraries(test PRIVATE SDL2-static SDL2main assimp)
  37.  
  38. install(TARGETS test)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top