Browse Source

Hunter integration: add package/hunter and reference it in main CMakeLists

package/hunter
├── .gitignore               # ignore HunterGate.cmake
├── HunterFetchDeps.cmake    # Fetch SDL, corrade and glfw
├── HunterGate.cmake         # main hunter scripts (ignored in git)
└── HunterInit.cmake         # entry point
pull/298/head
Pascal Thomet 8 years ago
parent
commit
6edd250cbe
  1. 12
      CMakeLists.txt
  2. 1
      package/hunter/.gitignore
  3. 7
      package/hunter/HunterFetchDeps.cmake
  4. 11
      package/hunter/HunterInit.cmake

12
CMakeLists.txt

@ -49,8 +49,20 @@ endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.4.0 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android") if(NOT CMAKE_VERSION VERSION_LESS 3.4.0 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
set(LANG CXX) set(LANG CXX)
endif() endif()
option(HUNTER_ENABLED "Get third parties (Corrade, glfw, SDL2) via hunter " OFF)
if (HUNTER_ENABLED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/package/hunter")
include(HunterInit)
endif()
project(Magnum ${LANG}) project(Magnum ${LANG})
if(HUNTER_ENABLED)
include(HunterFetchDeps)
endif()
# Use folders for nice tree in Visual Studio and XCode # Use folders for nice tree in Visual Studio and XCode
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)

1
package/hunter/.gitignore vendored

@ -0,0 +1 @@
HunterGate.cmake

7
package/hunter/HunterFetchDeps.cmake

@ -0,0 +1,7 @@
hunter_add_package(corrade)
if(WITH_GLFWAPPLICATION)
hunter_add_package(glfw)
endif()
if(WITH_SDL2APPLICATION)
hunter_add_package(SDL2)
endif()

11
package/hunter/HunterInit.cmake

@ -0,0 +1,11 @@
file(
DOWNLOAD
https://raw.githubusercontent.com/hunter-packages/gate/master/cmake/HunterGate.cmake
${CMAKE_CURRENT_LIST_DIR}//HunterGate.cmake
)
include("${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake")
HunterGate(
URL "https://github.com/pthom/hunter/archive/test-corrade-v2018.10.tar.gz"
SHA1 "3415f425f0ff1aa1754b8a2b57c77ba20f5b7bbc"
)
Loading…
Cancel
Save