Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active February 8, 2018 11:13
Show Gist options
  • Save kjunichi/368acbb7a30bd13caedf to your computer and use it in GitHub Desktop.
Save kjunichi/368acbb7a30bd13caedf to your computer and use it in GitHub Desktop.
2016/2/9

sbclで実行中のプラットフォームを知るには

(software-type)

opencvのクロスコンパイル時のインストール先

CMAKE_INSTALL_PREFIX

をセットすれば良さそう。

pkg-configのオプション

PKG_CONFIG_PATH=/usr/local/opt/opencv3/lib/pkgconfig pkg-config --libs-only-L opencv 

opencvをosxcrossでクロスコンパイルする

include(CMakeForceCompiler)

SET(CMAKE_SYSTEM_NAME Darwin)

SET(CMAKE_SIZEOF_VOID_P 8)

# specify the cross compiler
cmake_force_c_compiler(/opt/osxcross/target/bin/o64-clang Clang)
cmake_force_cxx_compiler(/opt/osxcross/target/bin/o64-clang++ Clang)
#SET(CMAKE_C_COMPILER   /opt/osxcross/target/bin/x86_64-apple-darwin14-clang)
#SET(CMAKE_CXX_COMPILER /opt/osxcross/target/bin/x86_64-apple-darwin14-clang++)
SET(CMAKE_AR /opt/osxcross/target/bin/x86_64-apple-darwin14-ar CACHE FILEPATH "Archiver")
#set(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)


SET(CMAKE_OSX_SYSROOT /opt/osxcross/target/SDK/MacOSX10.10.sdk)

# set PKG_CONFIG_PATH for osxcross Compile Environment
SET(ENV{PKG_CONFIG_PATH} /opt/osxcross/target/macports/pkgs/opt/local/lib/pkgconfig)
# where is the target environment
#set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/)
SET(CMAKE_FIND_ROOT_PATH /opt/osxcross/target/macports/pkgs/opt/local ${CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}/usr/bin )

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

関連

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment