Skip to content

Instantly share code, notes, and snippets.

View yuya-oc's full-sized avatar
👨‍💻

Yuya Ochiai yuya-oc

👨‍💻
View GitHub Profile
@yuya-oc
yuya-oc / options.cpp
Created February 23, 2012 15:14
boost::program_options sample
#include <iostream>
#include <boost/program_options.hpp>
// コンパイル時に-lprogram_optionsを指定
namespace po = boost::program_options;
/**
* main function
*/
int main(int argc, char** argv) {
@yuya-oc
yuya-oc / print.h
Last active October 1, 2015 17:08
Print variable name and value via std::cout
#define print(var) {std::cout<<#var"= "<<std::endl<<(var)<<std::endl}
#include <iostream>
using namespace std;
int main(){
cout << __FUNCTION__ << endl;
cout << __FILE__ << ":" << __LINE__ << endl;
return 0;
}
@yuya-oc
yuya-oc / CMakeLists.txt
Created April 12, 2012 12:49
Using Boost with CMake
find_package(Boost COMPONENTS program_options thread REQUIRED)
if(Boost_FOUND)
message("Boost is found:")
message(" Boost_INCLUDE_DIRS= ${Boost_INCLUDE_DIRS}")
message(" Boost_LIBRARIES= ${Boost_LIBRARIES}")
message(" Boost_LIBRARY_DIRS= ${Boost_LIBRARY_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
add_definitions("-DHAS_BOOST")
endif()
@yuya-oc
yuya-oc / divide2searchWord.bat
Created June 24, 2012 15:08
検索キーワードによるファイル仕分け for TvRock
rem 1:検索ワード 2:フルパス 3:ファイル名
set SAVEDIR=D:\\users\\%USERNAME%\\Videos\\PT3\\%~1
set REC=%~2
set FILENAME=%~3
mkdir "%SAVEDIR%"
move "%REC%" "%SAVEDIR%\\%FILENAME%"
@yuya-oc
yuya-oc / CMakeLists.txt
Created July 18, 2012 17:54
Bullet with cmake
cmake_minimum_required(VERSION 2.8)
project(bullet-sample)
include(FindPkgConfig)
pkg_check_modules(Bullet REQUIRED bullet)
if(Bullet_FOUND)
message("bullet is found:")
message(" Bullet_INCLUDE_DIRS= ${Bullet_INCLUDE_DIRS}")
message(" Bullet_LIBRARIES= ${Bullet_LIBRARIES}")
@yuya-oc
yuya-oc / CMakeLists.txt
Created July 18, 2012 17:58
cmake with pkg-config libs
cmake_minimum_required(VERSION 2.8)
project(pkg)
include(FindPkgConfig)
pkg_check_modules(<PREFIX> REQUIRED <lib_name>)
if(<PREFIX>_FOUND)
message(STATUS "<PREFIX> is found:")
message(STATUS " <PREFIX>_INCLUDE_DIRS= ${<PREFIX>_INCLUDE_DIRS}")
message(STATUS " <PREFIX>_LIBRARIES= ${<PREFIX>_LIBRARIES}")
@yuya-oc
yuya-oc / cmake.rb
Created July 26, 2012 13:49
Homebrew Formula for CMake2.8.8 with gui-option
require 'formula'
class NoExpatFramework < Requirement
def message; <<-EOS.undent
Detected /Library/Frameworks/expat.framework
This will be picked up by CMake's build system and likely cause the
build to fail, trying to link to a 32-bit version of expat.
You may need to move this file out of the way to compile CMake.
@yuya-oc
yuya-oc / drawstuff.pc.in
Created July 30, 2012 12:48
Drawstuff configuration template for pkg-config on Mac OSX
#please replace @prefix@ to ode-prefix(pkg-config ode --variable=prefix)
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: drawstuff
Description: Drawstuff
Version: 0.12
Libs: -L${libdir} -ldrawstuff -framework GLUT -framework OpenGL
@yuya-oc
yuya-oc / ode.rb
Created July 30, 2012 18:06
Homebrew Formula for ODE with Drawstuff
require 'formula'
class Ode < Formula
homepage 'http://www.ode.org/'
url 'http://sourceforge.net/projects/opende/files/ODE/0.12/ode-0.12.tar.bz2'
sha1 '10e7aae6cc6b1afe523ed52e76afd5e06461ea93'
head 'http://opende.svn.sourceforge.net/svnroot/opende/trunk'
depends_on 'pkg-config' => :build
depends_on 'gnu-sed' => :build