CMakeLists.txt 972 B

123456789101112131415161718192021222324252627
  1. cmake_minimum_required(VERSION 2.8)
  2. project(PluginTest)
  3. include(${CMAKE_CURRENT_BINARY_DIR}/../mods.cmake)
  4. get_property(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS)
  5. foreach(c ${configs})
  6. string(TOUPPER "${c}" CONFIG)
  7. get_property(soname TARGET exp_example_mod_1 PROPERTY IMPORTED_NO_SONAME_${CONFIG})
  8. if(soname)
  9. message(STATUS "exp_example_mod_1 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname}")
  10. else()
  11. message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_NO_SONAME_${CONFIG} but should")
  12. endif()
  13. endforeach()
  14. # Parse the binary to check for SONAME if possible.
  15. if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF")
  16. find_program(READELF_EXE readelf)
  17. if(READELF_EXE)
  18. add_custom_target(check_mod_soname ALL COMMAND
  19. ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE}
  20. -Dmod=$<TARGET_FILE:exp_example_mod_1>
  21. -P ${CMAKE_CURRENT_SOURCE_DIR}/../check_mod_soname.cmake
  22. )
  23. endif()
  24. endif()