I am Charmie

メモとログ

CMake

cmakeの使い方 (コンパイルしたライブラリを使うため)

とりあえず xxx-config.cmakeさえ作っておけば良い? static library add_libraryでSTATICを指定 ファイルの出力先はset_target_properties(ARCHIVE_OUTPUT_DIRECTORY ${DIR_TO_OUTPUT})で指定 shared library add_libraryでSHAREDを指定 ファイルの出力先は…

Mac OSX: CMake with clang or gcc

デフォルトのコンパイラでclangが選ばれちゃう. シンボリックリンクの参照先をインストールしたgcc, g++に設定したものの,CMakeで選択されるデフォルトコンパイラはclangのままだった. 解決策はコンパイラの指定 コンパイラの指定を選択 コンパイラの指定…

RealSense SDK 2.0 on Mac OSX

目標は以下の通り. - RealSsnse d435をMac OSXで使えるようにする - pythonでも使えるようにする 公式のreadmeで不足している情報も書く. コンパイル時にlibusb関係のエラーが出たので~/.bash_profileに以下を追記 (ディレクトリ名はインストールされてい…

CMake: download a file

The following code download a file from URL as FILE. file(DOWNLOAD URL FILE) ex. file(DOWNLOAD http://www.data.com/download.txt ${CMAKE_SOURCE_DIR}/download.txt)

CMake + Visual Studio from command prompt

[code lang="bash"] cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug nmake [/code]

CMakeLists.txt working with CodeSynthesis XSD

I made a repository that uses CodeSynthesis XSD with CMake. The CMakeLists.txt calls XSD and generates C++ classes so that we can avoid calling XSD from terminal, meaning the compilation is fully automatic. The CMakeLists.txt does find nec…

Install CMake 2.8.12.2 from source

There are several ways for CMake installation from source. I tried to install CMake 2.8.12.2 from source using pre-installed CMake 2.8.7 but it failed. #!/bin/bash wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz tar zxvf cmake-2…

CMake: how to get the name of parent directory

I have been looking for how to get the name of parent directory of CMAKE_SOURCE_DIR and could find the answer today. The solution is to use get_filename_component() function with "PATH" argument. Let's say CMAKE_SOURCE_DIR is "/code/testCm…

CMake

cmake: command line interface.ccmake: terminal GUI available on unix-like systems.cmake-gui: Qt-based GUI.

CMake + Visual Studio on command line

If you compile source code on command prompt with CMake and Visual Studio, you should specify some options as follows: cmake -G "NMake Makefiles" . nmake -G option specifies a makefile generator.