Skip to content

Commit

Permalink
misc: fix cmake packager, hunter, config
Browse files Browse the repository at this point in the history
  • Loading branch information
9prady9 committed Mar 13, 2018
1 parent a4a625c commit 5ae6549
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 10 deletions.
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
cmake_minimum_required(VERSION 3.5)

OPTION(USE_HUNTER "Use Hunter cmake package handler" OFF)
option(BUILD_SHARED_LIBS "Build shared/static library" ON)
option(USE_HUNTER "Use Hunter cmake package handler" OFF)

if(USE_HUNTER)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/HunterGate.cmake)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.208.tar.gz"
SHA1 "4128ac8c79c21b250bf825e8119ce0bff05e5132"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules/Hunter/config.cmake"
)
endif()

project(Forge VERSION 1.1.0 LANGUAGES C CXX)


set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
Expand Down Expand Up @@ -109,11 +111,11 @@ write_basic_package_version_file(
set(INCLUDE_DIRS include)
set(CMAKE_DIR ${FG_INSTALL_CMAKE_DIR})
configure_package_config_file(
${CMAKE_MODULE_PATH}/ForgeConfig.cmake.in
cmake/install/ForgeConfig.cmake
INSTALL_DESTINATION "${FG_INSTALL_CMAKE_DIR}"
PATH_VARS INCLUDE_DIRS CMAKE_DIR
)
"${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
"cmake/install/ForgeConfig.cmake"
INSTALL_DESTINATION "${FG_INSTALL_CMAKE_DIR}"
PATH_VARS INCLUDE_DIRS CMAKE_DIR
)

install(FILES ${Forge_BINARY_DIR}/cmake/install/ForgeConfig.cmake
${Forge_BINARY_DIR}/cmake/ForgeConfigVersion.cmake
Expand All @@ -126,8 +128,8 @@ install(FILES ${Forge_BINARY_DIR}/cmake/install/ForgeConfig.cmake
set(INCLUDE_DIRS "${Forge_SOURCE_DIR}/include" "${Forge_BINARY_DIR}/include")
set(CMAKE_DIR "${Forge_BINARY_DIR}/cmake")
configure_package_config_file(
${CMAKE_MODULE_PATH}/ForgeConfig.cmake.in
cmake/ForgeConfig.cmake
"${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
"cmake/ForgeConfig.cmake"
INSTALL_DESTINATION "${Forge_BINARY_DIR}/cmake"
PATH_VARS INCLUDE_DIRS CMAKE_DIR
INSTALL_PREFIX "${Forge_BINARY_DIR}"
Expand Down
55 changes: 55 additions & 0 deletions CMakeModules/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
include(hunter_config)

macro(myhunter_config pkg_name ver)
hunter_config(
${pkg_name}
VERSION ${ver}
CONFIGURATION_TYPES Release
CMAKE_ARGS CMAKE_POSITION_INDEPENDENT_CODE=ON ${ARGN}
)
endmacro()

myhunter_config(freeimage hunter-v3.17.0)
myhunter_config(freetype 2.6.2)
myhunter_config(OpenCL 2.1-p0)

#freeimag dependencies
myhunter_config(ZLIB 1.2.8-p3)
myhunter_config(TIFF 4.0.2-p3)
myhunter_config(PNG 1.6.26-p1)
myhunter_config(Jpeg 9b-p3)

#glfw dependencies
myhunter_config(xcursor 1.1.13)
myhunter_config(xorg-macros 1.17)
myhunter_config(xrender 0.9.7)
myhunter_config(x11 1.5.0)
myhunter_config(xproto 7.0.23)
myhunter_config(xextproto 7.2.1)
myhunter_config(xtrans 1.2.7)
myhunter_config(xcb 1.11.1)
myhunter_config(xcb-proto 1.11)
myhunter_config(pthread-stubs 0.3)
myhunter_config(xau 1.0.7)
myhunter_config(kbproto 1.0.6)
myhunter_config(inputproto 2.2)
myhunter_config(renderproto 0.11.1)
myhunter_config(xfixes 5.0.1)
myhunter_config(fixesproto 5.0)
myhunter_config(xinerama 1.1.2)
myhunter_config(xineramaproto 1.1.2)
myhunter_config(xrandr 1.3.2)
myhunter_config(randrproto 1.3.2)
myhunter_config(xi 1.6.1)
myhunter_config(xext 1.3.1)

myhunter_config(glbinding 2.1.3-p0
OPTION_BUILD_GPU_TESTS=ON
OPTION_BUILD_TESTS=ON
OPTION_BUILD_TOOLS=ON
gtest_force_shared_crt=ON)

myhunter_config(glfw 3.3.0-p4
GLFW_BUILD_DOCS=OFF
GLFW_BUILD_EXAMPLES=OFF
GLFW_BUILD_TESTS=OFF)
2 changes: 1 addition & 1 deletion src/backend/opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ find_package(OpenGL REQUIRED)

set(BackendTarget "forge")

add_library(${BackendTarget} SHARED "")
add_library(${BackendTarget} "")

set_target_properties(${BackendTarget} PROPERTIES FOLDER Forge)
set_target_properties(${BackendTarget} PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down

0 comments on commit 5ae6549

Please sign in to comment.