Advertisement
KShah

Untitled

Apr 1st, 2022
2,260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.90 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.0)
  2.  
  3. if (ARM_BUILD)
  4.     set(CMAKE_SYSTEM_PROCESSOR arm)
  5.     set(CMAKE_C_COMPILER ${TOOLCHAIN}/arm-linux-gnueabihf-gcc)
  6.     set(CMAKE_CXX_COMPILER ${TOOLCHAIN}/arm-linux-gnueabihf-g++)
  7. endif()
  8.  
  9. project(SimpleLibrary)
  10.  
  11. include_directories(include)
  12.  
  13. if (ARM_BUILD)
  14.     install(FILES ${SimpleLibrary_SOURCE_DIR}/include/buffer.h
  15.         DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
  16.     set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
  17.     set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  18. endif()
  19.  
  20. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SimpleLibrary_SOURCE_DIR}/bin)
  21. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SimpleLibrary_SOURCE_DIR}/lib)
  22.  
  23. add_subdirectory(src)
  24. add_executable(Main main.cpp)
  25. add_executable(MainLib main_lib.cpp)
  26.  
  27. target_link_libraries(MainLib buffer)
  28.  
  29. if (ARM_BUILD)
  30.     install(TARGETS Main MainLib
  31.         DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
  32. endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement