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

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
mkdir -p build mkdir -p build
unset MACOSX_DEPLOYMENT_TARGET unset MACOSX_DEPLOYMENT_TARGET
@ -7,7 +7,17 @@ unset CMAKE_OSX_SYSROOT
export MACOSX_DEPLOYMENT_TARGET="10.7" export MACOSX_DEPLOYMENT_TARGET="10.7"
export CMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" export CMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
cd build if [[ "$OSTYPE" == "linux-gnu" ]]; then
cmake .. cd build
make "$@" cmake -DHUNTER_SKIP_LOCK=ON ..
cd .. 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