123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- set(_Ice_db_programs
- db_archive
- db_checkpoint
- db_deadlock
- db_dump
- db_hotbackup
- db_load
- db_log_verify
- db_printlog
- db_recover
- db_stat
- db_tuner
- db_upgrade
- db_verify
- dumpdb
- transformdb)
- set(_Ice_programs
- glacier2router
- icebox
- icebox++11
- iceboxadmin
- iceboxd
- iceboxnet
- icebridge
- icegridadmin
- icegriddb
- icegridnode
- icegridnoded
- icegridregistry
- icegridregistryd
- icepatch2calc
- icepatch2client
- icepatch2server
- iceserviceinstall
- icestormadmin
- icestormdb
- icestormmigrate)
- set(_Ice_slice_programs
- slice2cpp
- slice2cs
- slice2freezej
- slice2freeze
- slice2html
- slice2java
- slice2js
- slice2objc
- slice2php
- slice2py
- slice2rb)
- function(_Ice_FIND)
-
- set(ice_versions
- 3
- 3.7
- 3.7.0
- 3.6
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5
- 3.5.1
- 3.5.0
- 3.4
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3
- 3.3.1
- 3.3.0)
- foreach(ver ${ice_versions})
- string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\$" two_digit_version_match "${ver}")
- if(two_digit_version_match)
- string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\$" "\\1\\2" two_digit_version "${ver}")
- list(APPEND ice_suffix_versions "${two_digit_version}")
- endif()
- endforeach()
-
-
- if(Ice_HOME)
- list(APPEND ice_roots "${Ice_HOME}")
- else()
- if(NOT "$ENV{ICE_HOME}" STREQUAL "")
- file(TO_CMAKE_PATH "$ENV{ICE_HOME}" NATIVE_PATH)
- list(APPEND ice_roots "${NATIVE_PATH}")
- set(Ice_HOME "${NATIVE_PATH}"
- CACHE PATH "Location of the Ice installation" FORCE)
- endif()
- endif()
- set(_bin "bin/Win32")
- set(_lib "lib/Win32")
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(_bin "bin/x64")
- set(_lib "lib/x64")
-
- set(_x64 "/x64")
-
- set(_lib64 "lib64")
- endif()
- unset(vcvers)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
- set(vcvers "141;140")
- elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
- set(vcvers "140")
- elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
- set(vcvers "120")
- elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
- set(vcvers "110")
- elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
- set(vcvers "100")
- elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
- set(vcvers "90")
- set(vcyear "2008")
- elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
- set(vcvers "80")
- set(vcyear "2005")
- else()
- set(vcvers Unknown)
- endif()
- endif()
-
- if(vcvers)
- list(APPEND ice_binary_suffixes "build/native/${_bin}/Release" "tools")
- list(APPEND ice_debug_library_suffixes "build/native/${_lib}/Debug")
- list(APPEND ice_release_library_suffixes "build/native/${_lib}/Release")
- foreach(vcver IN LISTS vcvers)
-
- list(APPEND ice_binary_suffixes "bin/vc${vcver}${_x64}" "bin/vc${vcver}")
- list(APPEND ice_debug_library_suffixes "lib/vc${vcver}${_x64}" "lib/vc${vcver}")
- list(APPEND ice_release_library_suffixes "lib/vc${vcver}${_x64}" "lib/vc${vcver}")
- endforeach()
- endif()
-
- list(APPEND ice_binary_suffixes "bin${_x64}" "bin")
- list(APPEND ice_debug_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
- list(APPEND ice_release_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
- if(vcvers)
- list(APPEND ice_include_suffixes "build/native/include")
- endif()
- list(APPEND ice_include_suffixes "include")
- list(APPEND ice_slice_suffixes "slice")
-
-
- if(vcvers)
- foreach(ice_version ${ice_versions})
- foreach(vcver IN LISTS vcvers)
- list(APPEND ice_nuget_dirs "zeroc.ice.v${vcver}.${ice_version}")
- list(APPEND freeze_nuget_dirs "zeroc.freeze.v${vcver}.${ice_version}")
- endforeach()
- endforeach()
- find_path(Ice_NUGET_DIR
- NAMES "tools/slice2cpp.exe"
- PATH_SUFFIXES ${ice_nuget_dirs}
- DOC "Ice NuGet directory")
- if(Ice_NUGET_DIR)
- list(APPEND ice_roots "${Ice_NUGET_DIR}")
- endif()
- find_path(Freeze_NUGET_DIR
- NAMES "tools/slice2freeze.exe"
- PATH_SUFFIXES ${freeze_nuget_dirs}
- DOC "Freeze NuGet directory")
- if(Freeze_NUGET_DIR)
- list(APPEND ice_roots "${Freeze_NUGET_DIR}")
- endif()
- foreach(ice_version ${ice_versions})
-
-
-
- unset(ice_location)
- if(vcyear)
- get_filename_component(ice_location
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ZeroC\\Ice ${ice_version} for Visual Studio ${vcyear};InstallDir]"
- PATH)
- if(ice_location AND NOT ("${ice_location}" STREQUAL "/registry" OR "${ice_location}" STREQUAL "/"))
- string(REGEX REPLACE "^\"(.*)\"?$" "\\1" ice_location "${ice_location}")
- get_filename_component(ice_location "${ice_location}" ABSOLUTE)
- else()
- unset(ice_location)
- endif()
- endif()
-
- if(NOT ice_location OR "${ice_location}" STREQUAL "/registry")
- get_filename_component(ice_location
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ZeroC\\Ice ${ice_version};InstallDir]"
- ABSOLUTE)
- endif()
- if(ice_location AND NOT "${ice_location}" STREQUAL "/registry")
- list(APPEND ice_roots "${ice_location}")
- endif()
- endforeach()
- else()
- foreach(ice_version ${ice_versions})
-
- list(APPEND ice_roots "/opt/Ice-${ice_version}")
- endforeach()
- endif()
-
- foreach(program ${_Ice_db_programs} ${_Ice_programs} ${_Ice_slice_programs})
- string(TOUPPER "${program}" program_upcase)
- set(cache_var "Ice_${program_upcase}_EXECUTABLE")
- set(program_var "Ice_${program_upcase}_EXECUTABLE")
- find_program("${cache_var}" "${program}"
- HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_binary_suffixes}
- DOC "Ice ${program} executable")
- mark_as_advanced(cache_var)
- set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
- endforeach()
-
- if(Ice_SLICE2CPP_EXECUTABLE)
-
- set(_Ice_SAVED_LC_ALL "$ENV{LC_ALL}")
- set(ENV{LC_ALL} C)
- execute_process(COMMAND ${Ice_SLICE2CPP_EXECUTABLE} --version
- ERROR_VARIABLE Ice_VERSION_SLICE2CPP_FULL
- ERROR_STRIP_TRAILING_WHITESPACE)
-
- set(ENV{LC_ALL} ${_Ice_SAVED_LC_ALL})
-
- string(REGEX REPLACE "^(.*)\\.[^.]*$" "\\1" Ice_VERSION_SLICE2CPP_SHORT "${Ice_VERSION_SLICE2CPP_FULL}")
- set(Ice_VERSION "${Ice_VERSION_SLICE2CPP_FULL}" PARENT_SCOPE)
- endif()
- if(NOT Ice_FIND_QUIETLY)
- message(STATUS "Ice version: ${Ice_VERSION_SLICE2CPP_FULL}")
- endif()
-
- find_path(Ice_INCLUDE_DIR
- NAMES "Ice/Ice.h"
- HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_include_suffixes}
- DOC "Ice include directory")
- set(Ice_INCLUDE_DIR "${Ice_INCLUDE_DIR}" PARENT_SCOPE)
- find_path(Freeze_INCLUDE_DIR
- NAMES "Freeze/Freeze.h"
- HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_include_suffixes}
- DOC "Freeze include directory")
- set(Freeze_INCLUDE_DIR "${Freeze_INCLUDE_DIR}" PARENT_SCOPE)
-
-
- list(APPEND ice_slice_paths
- /usr/local/share /usr/share)
- list(APPEND ice_slice_suffixes
- "Ice-${Ice_VERSION_SLICE2CPP_FULL}/slice"
- "Ice-${Ice_VERSION_SLICE2CPP_SHORT}/slice"
- "ice/slice"
- Ice)
-
- find_path(Ice_SLICE_DIR
- NAMES "Ice/Connection.ice"
- HINTS ${ice_roots}
- ${ice_slice_paths}
- PATH_SUFFIXES ${ice_slice_suffixes}
- NO_DEFAULT_PATH
- DOC "Ice slice directory")
- set(Ice_SLICE_DIR "${Ice_SLICE_DIR}" PARENT_SCOPE)
-
- set(Ice_REQUIRED_LIBS_FOUND ON)
- foreach(component ${Ice_FIND_COMPONENTS})
- string(TOUPPER "${component}" component_upcase)
- set(component_cache "Ice_${component_upcase}_LIBRARY")
- set(component_cache_release "${component_cache}_RELEASE")
- set(component_cache_debug "${component_cache}_DEBUG")
- set(component_found "${component_upcase}_FOUND")
- set(component_library "${component}")
- unset(component_library_release_names)
- unset(component_library_debug_names)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- string(REGEX MATCH ".+\\+\\+11$" component_library_cpp11 "${component_library}")
- if(component_library_cpp11)
- string(REGEX REPLACE "^(.+)(\\+\\+11)$" "\\1" component_library "${component_library}")
- endif()
- foreach(suffix_ver ${ice_suffix_versions})
- set(_name "${component_library}${suffix_ver}")
- if(component_library_cpp11)
- string(APPEND _name "++11")
- endif()
- list(APPEND component_library_debug_names "${_name}d")
- list(APPEND component_library_release_names "${_name}")
- endforeach()
- set(_name "${component_library}")
- if(component_library_cpp11)
- string(APPEND _name "++11")
- endif()
- list(APPEND component_library_debug_names "${_name}d")
- list(APPEND component_library_release_names "${_name}")
- else()
- list(APPEND component_library_debug_names "${component_library}d")
- list(APPEND component_library_release_names "${component_library}")
- endif()
- find_library("${component_cache_release}" ${component_library_release_names}
- HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_release_library_suffixes}
- DOC "Ice ${component} library (release)")
- find_library("${component_cache_debug}" ${component_library_debug_names}
- HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_debug_library_suffixes}
- DOC "Ice ${component} library (debug)")
- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
- select_library_configurations(Ice_${component_upcase})
- mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
- if(${component_cache})
- set("${component_found}" ON)
- list(APPEND Ice_LIBRARY "${${component_cache}}")
- endif()
- mark_as_advanced("${component_found}")
- set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
- set("${component_found}" "${${component_found}}" PARENT_SCOPE)
- if(${component_found})
- if (Ice_FIND_REQUIRED_${component})
- list(APPEND Ice_LIBS_FOUND "${component} (required)")
- else()
- list(APPEND Ice_LIBS_FOUND "${component} (optional)")
- endif()
- else()
- if (Ice_FIND_REQUIRED_${component})
- set(Ice_REQUIRED_LIBS_FOUND OFF)
- list(APPEND Ice_LIBS_NOTFOUND "${component} (required)")
- else()
- list(APPEND Ice_LIBS_NOTFOUND "${component} (optional)")
- endif()
- endif()
- endforeach()
- set(_Ice_REQUIRED_LIBS_FOUND "${Ice_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
- set(Ice_LIBRARY "${Ice_LIBRARY}" PARENT_SCOPE)
- if(NOT Ice_FIND_QUIETLY)
- if(Ice_LIBS_FOUND)
- message(STATUS "Found the following Ice libraries:")
- foreach(found ${Ice_LIBS_FOUND})
- message(STATUS " ${found}")
- endforeach()
- endif()
- if(Ice_LIBS_NOTFOUND)
- message(STATUS "The following Ice libraries were not found:")
- foreach(notfound ${Ice_LIBS_NOTFOUND})
- message(STATUS " ${notfound}")
- endforeach()
- endif()
- endif()
- if(Ice_DEBUG)
- message(STATUS "--------FindIce.cmake search debug--------")
- message(STATUS "ICE binary path search order: ${ice_roots}")
- message(STATUS "ICE binary suffixes: ${ice_binary_suffixes}")
- message(STATUS "ICE include path search order: ${ice_roots}")
- message(STATUS "ICE include suffixes: ${ice_include_suffixes}")
- message(STATUS "ICE slice path search order: ${ice_roots} ${ice_slice_paths}")
- message(STATUS "ICE slice suffixes: ${ice_slice_suffixes}")
- message(STATUS "ICE library path search order: ${ice_roots}")
- message(STATUS "ICE debug library suffixes: ${ice_debug_library_suffixes}")
- message(STATUS "ICE release library suffixes: ${ice_release_library_suffixes}")
- message(STATUS "----------------")
- endif()
- endfunction()
- _Ice_FIND()
- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ice
- FOUND_VAR Ice_FOUND
- REQUIRED_VARS Ice_SLICE2CPP_EXECUTABLE
- Ice_INCLUDE_DIR
- Ice_SLICE_DIR
- Ice_LIBRARY
- _Ice_REQUIRED_LIBS_FOUND
- VERSION_VAR Ice_VERSION
- FAIL_MESSAGE "Failed to find all Ice components")
- unset(_Ice_REQUIRED_LIBS_FOUND)
- if(Ice_FOUND)
- set(Ice_INCLUDE_DIRS "${Ice_INCLUDE_DIR}")
- if (Freeze_INCLUDE_DIR)
- list(APPEND Ice_INCLUDE_DIRS "${Freeze_INCLUDE_DIR}")
- endif()
- set(Ice_SLICE_DIRS "${Ice_SLICE_DIR}")
- set(Ice_LIBRARIES "${Ice_LIBRARY}")
- foreach(_Ice_component ${Ice_FIND_COMPONENTS})
- string(TOUPPER "${_Ice_component}" _Ice_component_upcase)
- set(_Ice_component_cache "Ice_${_Ice_component_upcase}_LIBRARY")
- set(_Ice_component_cache_release "Ice_${_Ice_component_upcase}_LIBRARY_RELEASE")
- set(_Ice_component_cache_debug "Ice_${_Ice_component_upcase}_LIBRARY_DEBUG")
- set(_Ice_component_lib "Ice_${_Ice_component_upcase}_LIBRARIES")
- set(_Ice_component_found "${_Ice_component_upcase}_FOUND")
- set(_Ice_imported_target "Ice::${_Ice_component}")
- if(${_Ice_component_found})
- set("${_Ice_component_lib}" "${${_Ice_component_cache}}")
- if(NOT TARGET ${_Ice_imported_target})
- add_library(${_Ice_imported_target} UNKNOWN IMPORTED)
- set_target_properties(${_Ice_imported_target} PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${Ice_INCLUDE_DIRS}")
- if(EXISTS "${${_Ice_component_cache}}")
- set_target_properties(${_Ice_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
- IMPORTED_LOCATION "${${_Ice_component_cache}}")
- endif()
- if(EXISTS "${${_Ice_component_cache_release}}")
- set_property(TARGET ${_Ice_imported_target} APPEND PROPERTY
- IMPORTED_CONFIGURATIONS RELEASE)
- set_target_properties(${_Ice_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
- IMPORTED_LOCATION_RELEASE "${${_Ice_component_cache_release}}")
- endif()
- if(EXISTS "${${_Ice_component_cache_debug}}")
- set_property(TARGET ${_Ice_imported_target} APPEND PROPERTY
- IMPORTED_CONFIGURATIONS DEBUG)
- set_target_properties(${_Ice_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
- IMPORTED_LOCATION_DEBUG "${${_Ice_component_cache_debug}}")
- endif()
- endif()
- endif()
- unset(_Ice_component_upcase)
- unset(_Ice_component_cache)
- unset(_Ice_component_lib)
- unset(_Ice_component_found)
- unset(_Ice_imported_target)
- endforeach()
- endif()
- if(Ice_DEBUG)
- message(STATUS "--------FindIce.cmake results debug--------")
- message(STATUS "Ice_VERSION number: ${Ice_VERSION}")
- message(STATUS "Ice_HOME directory: ${Ice_HOME}")
- message(STATUS "Ice_INCLUDE_DIR directory: ${Ice_INCLUDE_DIR}")
- message(STATUS "Ice_SLICE_DIR directory: ${Ice_SLICE_DIR}")
- message(STATUS "Ice_LIBRARIES: ${Ice_LIBRARIES}")
- message(STATUS "Freeze_INCLUDE_DIR directory: ${Freeze_INCLUDE_DIR}")
- message(STATUS "Ice_INCLUDE_DIRS directory: ${Ice_INCLUDE_DIRS}")
- foreach(program ${_Ice_db_programs} ${_Ice_programs} ${_Ice_slice_programs})
- string(TOUPPER "${program}" program_upcase)
- message(STATUS "${program} executable: ${Ice_${program_upcase}_EXECUTABLE}")
- endforeach()
- foreach(component ${Ice_FIND_COMPONENTS})
- string(TOUPPER "${component}" component_upcase)
- set(component_lib "Ice_${component_upcase}_LIBRARIES")
- set(component_found "${component_upcase}_FOUND")
- message(STATUS "${component} library found: ${${component_found}}")
- message(STATUS "${component} library: ${${component_lib}}")
- endforeach()
- message(STATUS "----------------")
- endif()
- unset(_Ice_db_programs)
- unset(_Ice_programs)
- unset(_Ice_slice_programs)
|