Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created September 1, 2013 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/a01cb0531cf51c4ca287 to your computer and use it in GitHub Desktop.
Save roxlu/a01cb0531cf51c4ca287 to your computer and use it in GitHub Desktop.
Example showing how to link with a custom dylib in your project
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_CURRENT_LIST_DIR}/../../../../../lib/build/cmake/CMakeLists.txt) # roxlu cmake
include(${CMAKE_CURRENT_LIST_DIR}/../../shift/CMakeLists.txt) # shift
get_filename_component(app_path ${CMAKE_CURRENT_LIST_DIR}/../../ REALPATH) # get the directory name
get_filename_component(app_name ${app_path} NAME) # set directory name as application name
roxlu_enable_opengl()
roxlu_app_initialize(${app_name})
# ---------------------------------------------
roxlu_app_add_source_file(main.cpp)
roxlu_app_add_source_file(Simulation.cpp)
roxlu_add_dylib(${CMAKE_BINARY_DIR}/libshift.dylib)
# ---------------------------------------------
roxlu_install_app()
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_CURRENT_LIST_DIR}/../../../../lib/build/cmake/CMakeLists.txt) # roxlu cmake
set(bd ${CMAKE_CURRENT_LIST_DIR}/)
set(sd ${bd}/src/)
set(id ${bd}/include/)
include_directories(${id})
set(src
${sd}Shift.cpp
)
add_library(shift SHARED ${src} ${roxlu_lib_source_files})
target_link_libraries(shift ${roxlu_libs})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment