You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 regels
1.2 KiB

  1. Set ( CPPMP_REPOSITORY https://git.bergmann89.de/cpp/cppmp.git )
  2. Set ( CPPMP_COMMIT master )
  3. Set ( CPPMP_CHECKOUT_DIR ${CMAKE_BINARY_DIR}/sources/cppmp )
  4. # Clone Repository
  5. If ( NOT EXISTS ${CPPMP_CHECKOUT_DIR} )
  6. Execute_Process ( COMMAND
  7. git clone ${CPPMP_REPOSITORY} ${CPPMP_CHECKOUT_DIR}
  8. RESULT_VARIABLE
  9. CLONE_RET )
  10. If ( NOT ${CLONE_RET} EQUAL 0 )
  11. Return ( )
  12. EndIf ( )
  13. EndIf ( )
  14. # Checkout Specific Commit
  15. Execute_Process ( COMMAND
  16. git -C ${CPPMP_CHECKOUT_DIR} -c advice.detachedHead=false checkout origin/${CPPMP_COMMIT}
  17. COMMAND
  18. git -C ${CPPMP_CHECKOUT_DIR} submodule update --init --recursive
  19. RESULT_VARIABLE
  20. CHECKOUT_RET )
  21. If ( NOT ${CHECKOUT_RET} EQUAL 0 )
  22. Return ( )
  23. EndIf ( )
  24. # Include Cloned Repository
  25. Include ( ${CMAKE_CURRENT_LIST_DIR}/modules/cmake/find_local_module.cmake )
  26. FindLocalModule ( cppmp ${CPPMP_CHECKOUT_DIR} )
  27. # Create Alias Targets
  28. If ( NOT TARGET cppmp::cppmp )
  29. Add_Library ( cppmp::cppmp ALIAS cppmp )
  30. EndIf ( )