Update cmake files to set slightly different configs based on platform

This commit is contained in:
Tim Warren 2015-10-29 10:54:24 -04:00
parent 4ddd1edf13
commit b73be045d4
2 changed files with 25 additions and 18 deletions

View File

@ -3,16 +3,17 @@
################################################################################
cmake_minimum_required (VERSION 3.0)
# Hunter for dependency management
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.12.24.tar.gz"
SHA1 "a25a7fa55c204a8126efd1f48593a662925b26da"
)
endif()
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.12.24.tar.gz"
SHA1 "a25a7fa55c204a8126efd1f48593a662925b26da"
)
project(Tyro)
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include)
# C++11, please
@ -32,17 +33,13 @@ endif()
# wxwidgets stuff
set(wxWidgets_CONFIG_OPTIONS --static)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
hunter_add_package(wxWidgets)
endif()
hunter_add_package(wxWidgets)
find_package(wxWidgets COMPONENTS core base aui stc adv REQUIRED)
include("${wxWidgets_USE_FILE}")
#libssh2
set(CMAKE_MODULE_PATH ${Tyro_SOURCE_DIR}/cmake)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
hunter_add_package(libssh2)
endif()
hunter_add_package(libssh2)
find_package(LibSSH2 REQUIRED)
if (LIBSSH2_FOUND)
set (INCLUDE_DIRS ${INCLUDE_DIRS} ${LIBSSH2_INCLUDE_DIR})

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
mkdir -p build
unset MACOSX_DEPLOYMENT_TARGET
@ -7,7 +7,17 @@ unset CMAKE_OSX_SYSROOT
export MACOSX_DEPLOYMENT_TARGET="10.7"
export CMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
cd build
cmake ..
make "$@"
cd ..
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cd build
cmake -DHUNTER_SKIP_LOCK=ON ..
make "$@"
cd ..
elif [[ "$OSTYPE" == "darwin"* ]]; then
# On OSX, disable hunter, because it doesn't work
# for building wxWidgets, as it thinks it is on linux
cd build
cmake -DHUNTER_ENABLED=OFF ..
make "$@"
cd ..
fi