TestMappedConfig.cmake 679 B

12345678910111213141516171819202122232425
  1. macro(set_config_map CONFIG)
  2. string(TOUPPER "${CONFIG}" CONFIG_UPPER)
  3. set(CMAKE_MAP_IMPORTED_CONFIG_${CONFIG_UPPER} "${ANIMAL_CONFIGS}")
  4. message(STATUS "CMAKE_MAP_IMPORTED_CONFIG_${CONFIG_UPPER} => \"${ANIMAL_CONFIGS}\"")
  5. endmacro()
  6. # Set up configuration maps
  7. if(DEFINED CMAKE_BUILD_TYPE)
  8. set_config_map(${CMAKE_BUILD_TYPE})
  9. else()
  10. foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
  11. set_config_map(${CONFIG})
  12. endforeach()
  13. endif()
  14. # Find the test package
  15. set(animal_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  16. find_package(animal REQUIRED)
  17. # Set up the test executable
  18. set(CMAKE_CXX_STANDARD 11)
  19. add_executable(test test.cpp)
  20. target_link_libraries(test animal::animal)