-
-
Save blt/5606902 to your computer and use it in GitHub Desktop.
Revisions
-
blt revised this gist
May 19, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def install args = std_cmake_args args.delete '-DCMAKE_BUILD_TYPE=None' args.push '-DCMAKE_BUILD_TYPE=Release', '-DINSTALL_EXTERNAL_LIBS=FALSE' args.push '-DSFML_BUILD_FRAMEWORKS=TRUE', "-DCMAKE_INSTALL_FRAMEWORK_PREFIX=#{prefix}/Frameworks" args << '-DBUILD_SHARED_LIBS=FALSE' if build.include? 'static' -
blt revised this gist
May 19, 2013 . 1 changed file with 1 addition and 31 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,13 +19,6 @@ class Sfml < Formula # libsndfile depends on them (it is all or none) # flac, libogg, libvorbis def install ENV.universal_binary if build.include? 'universal' @@ -34,13 +27,7 @@ def install args.push '-DCMAKE_BUILD_TYPE=Release', '-DINSTALL_EXTERNAL_LIBS=FALSE' args << '-DBUILD_SHARED_LIBS=FALSE' if build.include? 'static' system 'cmake', '.', *args system 'make install' end @@ -56,21 +43,4 @@ def caveats msg end end -
blt revised this gist
May 19, 2013 . 1 changed file with 1 addition and 84 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,11 +23,8 @@ class Sfml < Formula option :static, 'Build Static Libraries' option :framework, 'Build Framework' def patches; end def install ENV.universal_binary if build.include? 'universal' @@ -77,83 +74,3 @@ def examples_caveats; <<-EOS.undent EOS end end -
blt revised this gist
May 19, 2013 . 1 changed file with 64 additions and 67 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,9 @@ class Sfml < Formula homepage 'http://www.sfml-dev.org' version '2.0' url 'http://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-sources.zip' sha1 'ff8cf290f49e1a1d8517a4a344e9214139da462f' depends_on 'cmake' => :build depends_on 'freetype' => :build @@ -87,76 +84,76 @@ def examples_caveats; <<-EOS.undent --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,9 @@ sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples, # add an option for building the API documentation sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") +# set an option for install included external libraries +sfml_set_option(INSTALL_EXTERNAL_LIBS TRUE BOOL "TRUE to install external libraries (sndfile and openal)") + # Mac OS X specific options if(MACOSX) # add an option to build frameworks instead of dylibs (release only) @@ -215,18 +218,22 @@ install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR}) install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR}) -if(WINDOWS) - if(ARCH_32BITS) - install(FILES extlibs/bin/x86/libsndfile-1.dll DESTINATION bin) - install(FILES extlibs/bin/x86/openal32.dll DESTINATION bin) - elseif(ARCH_64BITS) - install(FILES extlibs/bin/x64/libsndfile-1.dll DESTINATION bin) - install(FILES extlibs/bin/x64/openal32.dll DESTINATION bin) - endif() -elseif(MACOSX) - install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) +if(INSTALL_EXTERNAL_LIBS) + if(WINDOWS) + if(ARCH_32BITS) + install(FILES extlibs/bin/x86/libsndfile-1.dll DESTINATION bin) + install(FILES extlibs/bin/x86/openal32.dll DESTINATION bin) + elseif(ARCH_64BITS) + install(FILES extlibs/bin/x64/libsndfile-1.dll DESTINATION bin) + install(FILES extlibs/bin/x64/openal32.dll DESTINATION bin) + endif() + elseif(MACOSX) + install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif() +endif() - if(SFML_INSTALL_XCODE4_TEMPLATES) - install(DIRECTORY tools/xcode/templates/SFML DESTINATION /Library/Developer/Xcode/Templates) - endif() +if(MACOSX) + if(SFML_INSTALL_XCODE4_TEMPLATES) + install(DIRECTORY tools/xcode/templates/SFML DESTINATION /Library/Developer/Xcode/Templates) + endif() endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 777a72e..99cc3e2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,6 +13,10 @@ if(WINDOWS) add_subdirectory(win32) elseif(LINUX) add_subdirectory(X11) -elseif(MACOSX) - add_subdirectory(cocoa) + elseif(MACOSX) + if(CMAKE_OSX_SYSROOT STREQUAL "" OR OSX_DEVELOPER_ROOT STREQUAL "") + message(STATUS "Could not find XCode: skipping cocoa example") + else() + add_subdirectory(cocoa) + endif() endif() diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 7fed4ac..fd2b4b6 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -67,5 +67,5 @@ endif() if(WINDOWS) set(INSTALL_MISC_DIR .) elseif(UNIX) - set(INSTALL_MISC_DIR share/SFML) + set(INSTALL_MISC_DIR share/sfml) endif() -
Reinaldo Junior revised this gist
Jan 12, 2013 . 1 changed file with 26 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,15 +51,34 @@ def install system 'make install' end def caveats msg = "" msg = <<-EOS.undent The CMake find-module is available at #{opt_prefix}/share/sfml/cmake/Modules/FindSFML.cmake You may need to copy it to #{HOMEBREW_PREFIX}/share/cmake/Modules EOS msg.concat framework_caveats if build.include? 'framework' msg.concat examples_caveats if build.include? 'build-examples' msg end private def framework_caveats; <<-EOS.undent SFML.framework was installed to: #{opt_prefix}/Frameworks/SFML.framework To use this Framework with IDEs it must be linked to the standard OS X location: sudo ln -s #{opt_prefix}/Frameworks/SFML.framework /Library/Frameworks EOS end def examples_caveats; <<-EOS.undent The examples were installed to: #{opt_prefix}/share/sfml/examples EOS end end __END__ -
Reinaldo Junior revised this gist
Jan 3, 2013 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,14 +5,15 @@ class Sfml < Formula homepage 'http://www.sfml-dev.org' version '2.0-rc' url 'https://github.com/LaurentGomila/SFML/archive/2.0-rc.zip' sha1 '71bdbd9abe46fe4f87c09175cf2a25246b7251c8' head 'https://github.com/LaurentGomila/SFML/archive/master.zip' depends_on 'cmake' => :build depends_on 'freetype' => :build depends_on 'jpeg' => :build depends_on 'glew' => :build -
Reinaldo Junior revised this gist
Jan 3, 2013 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -129,3 +129,14 @@ def caveats; <<-EOS.undent + add_subdirectory(cocoa) + endif() endif() diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 7fed4ac..fd2b4b6 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -67,5 +67,5 @@ endif() if(WINDOWS) set(INSTALL_MISC_DIR .) elseif(UNIX) - set(INSTALL_MISC_DIR share/SFML) + set(INSTALL_MISC_DIR share/sfml) endif() -
Reinaldo Junior revised this gist
Jan 3, 2013 . 1 changed file with 131 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,131 @@ require 'formula' # Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! class Sfml < Formula homepage 'http://www.sfml-dev.org' version '2.0-head' url 'https://github.com/LaurentGomila/SFML/archive/master.zip' # version '2.0-rc' # url 'https://github.com/LaurentGomila/SFML/archive/2.0-rc.zip' sha1 '781c0623bfed3703e43bff7adde46c9a3def3697' depends_on 'cmake' => :build depends_on 'freetype' => :build depends_on 'jpeg' => :build depends_on 'glew' => :build depends_on 'libsndfile' => :build # libsndfile depends on them (it is all or none) # flac, libogg, libvorbis option :universal option :static, 'Build Static Libraries' option :framework, 'Build Framework' option :xcode, 'Install XCode 4 Templates (requires sudo to install)' option 'build-examples', 'Build Examples' def patches; DATA; end def install ENV.universal_binary if build.include? 'universal' args = std_cmake_args args.delete '-DCMAKE_BUILD_TYPE=None' args.push '-DCMAKE_BUILD_TYPE=Release', '-DINSTALL_EXTERNAL_LIBS=FALSE' args << '-DBUILD_SHARED_LIBS=FALSE' if build.include? 'static' args << '-DSFML_INSTALL_XCODE4_TEMPLATES=TRUE' if build.include? 'xcode' args << '-DSFML_BUILD_EXAMPLES=TRUE' if build.include? 'build-examples' if build.include? 'framework' args.push '-DSFML_BUILD_FRAMEWORKS=TRUE', "-DCMAKE_INSTALL_FRAMEWORK_PREFIX=#{prefix}/Frameworks" end system 'cmake', '.', *args system 'make install' end def caveats; <<-EOS.undent SFML.framework was installed to: #{opt_prefix}/Frameworks/SFML.framework To use this Framework with IDEs it must be linked to the standard OS X location: sudo ln -s #{opt_prefix}/Frameworks/SFML.framework /Library/Frameworks EOS end end __END__ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e7605a..e1bad9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,9 @@ sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples, # add an option for building the API documentation sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") +# set an option for install included external libraries +sfml_set_option(INSTALL_EXTERNAL_LIBS TRUE BOOL "TRUE to install external libraries (sndfile and openal)") + # Mac OS X specific options if(MACOSX) # add an option to build frameworks instead of dylibs (release only) @@ -215,18 +218,22 @@ install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR}) install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR}) -if(WINDOWS) - if(ARCH_32BITS) - install(FILES extlibs/bin/x86/libsndfile-1.dll DESTINATION bin) - install(FILES extlibs/bin/x86/openal32.dll DESTINATION bin) - elseif(ARCH_64BITS) - install(FILES extlibs/bin/x64/libsndfile-1.dll DESTINATION bin) - install(FILES extlibs/bin/x64/openal32.dll DESTINATION bin) - endif() -elseif(MACOSX) - install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) +if(INSTALL_EXTERNAL_LIBS) + if(WINDOWS) + if(ARCH_32BITS) + install(FILES extlibs/bin/x86/libsndfile-1.dll DESTINATION bin) + install(FILES extlibs/bin/x86/openal32.dll DESTINATION bin) + elseif(ARCH_64BITS) + install(FILES extlibs/bin/x64/libsndfile-1.dll DESTINATION bin) + install(FILES extlibs/bin/x64/openal32.dll DESTINATION bin) + endif() + elseif(MACOSX) + install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif() +endif() - if(SFML_INSTALL_XCODE4_TEMPLATES) - install(DIRECTORY tools/xcode/templates/SFML DESTINATION /Library/Developer/Xcode/Templates) - endif() +if(MACOSX) + if(SFML_INSTALL_XCODE4_TEMPLATES) + install(DIRECTORY tools/xcode/templates/SFML DESTINATION /Library/Developer/Xcode/Templates) + endif() endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 777a72e..99cc3e2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,6 +13,10 @@ if(WINDOWS) add_subdirectory(win32) elseif(LINUX) add_subdirectory(X11) -elseif(MACOSX) - add_subdirectory(cocoa) + elseif(MACOSX) + if(CMAKE_OSX_SYSROOT STREQUAL "" OR OSX_DEVELOPER_ROOT STREQUAL "") + message(STATUS "Could not find XCode: skipping cocoa example") + else() + add_subdirectory(cocoa) + endif() endif() -
juniorz created this gist
Jan 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Creating the gist