# - Package # Define a package # SET(myindent "${myindent}\t") message(STATUS "${myindent}# \"Package\" included!") if(__Package_INCLUDED) return() endif() set(__Package_INCLUDED TRUE) include(PackageSpecial) #------------------------------------------------------------------------------- # icedust_package(package_name package_version) # # Declare name and version of the package. # Handle general procedures for a common package # Should be added in ``CMakeLists.txt`` for each package #------------------------------------------------------------------------------- macro(icedust_package name version) message(STATUS "${myindent}==>macro(icedust_package ${name} ${version})") SET(myindent "${myindent}\t") # Set useful variables and properties set(package_name ${name}) set(package_version ${version}) get_filename_component(package_dir ${CMAKE_CURRENT_LIST_FILE} PATH) get_filename_component(package_dir ${package_dir} PATH) get_filename_component(packages_root ${package_dir} PATH) get_filename_component(packages_root ${packages_root} PATH) get_filename_component(project_dir ${packages_root} PATH) file(RELATIVE_PATH package_reldir ${packages_root} ${package_dir}) # Add cmake directory under the package into CMAKE_MODULE_PATH LIST(APPEND CMAKE_MODULE_PATH ${project_dir}/cmake ${project_dir}/cmake/modules ${package_dir}/cmake ${package_dir}/cmake/modules ${CMAKE_MODULE_PATH}) LIST(REMOVE_DUPLICATES CMAKE_MODULE_PATH) message(STATUS "${myindent} project_dir=${project_dir}") message(STATUS "${myindent} package_dir=${package_dir}") message(STATUS "${myindent} package_reldir=${package_reldir}") message(STATUS "${myindent} CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") set(target_dir ${package_dir}) set(target_reldir ${package_reldir}) icedust_target() icedust_package_special(${name} ${version}) string(REGEX REPLACE "(\t*)\t" "\\1" myindent "${myindent}") message(STATUS "${myindent}<==macro(icedust_package ${name} ${version})") endmacro() string(REGEX REPLACE "(\t*)\t" "\\1" myindent "${myindent}")