1515# FindAtima.cmake - Find module for CaTima / Atima using $ENV{ATIMAPATH}
1616################################################################################
1717
18- message (STATUS "Looking for Atima ..." )
18+ message (STATUS "Looking for ATIMA ..." )
1919
2020if (NOT DEFINED ENV{ATIMAPATH})
2121 message (" - Environment variable ATIMAPATH is not set." )
@@ -26,22 +26,31 @@ else()
2626 NAMES catima/catima.h
2727 HINTS ${CATIMA_ROOT} /include
2828 PATH_SUFFIXES catima
29- DOC "Path to CaTima include directory"
29+ DOC "Path to ATIMA include directory"
3030 )
3131
3232 find_library (Atima_LIBRARY_SHARED
3333 NAMES catima libcatima
3434 HINTS ${CATIMA_ROOT} /lib
35- DOC "Path to CaTima shared library"
35+ DOC "Path to ATIMA shared library"
3636 )
3737
3838 if (Atima_LIBRARY_SHARED)
3939 set (Atima_LIBRARY ${Atima_LIBRARY_SHARED} )
4040 endif ()
41+
42+ set (Atima_VERSION "" )
43+ if (EXISTS "${CATIMA_ROOT} /share/catima/catimaConfigVersion.cmake" )
44+ include ("${CATIMA_ROOT} /share/catima/catimaConfigVersion.cmake" )
45+ if (DEFINED PACKAGE_VERSION)
46+ set (Atima_VERSION "${PACKAGE_VERSION} " )
47+ endif ()
48+ endif ()
4149
4250 include (FindPackageHandleStandardArgs )
43- find_package_handle_standard_args (Atima
51+ find_package_handle_standard_args (Atima
4452 REQUIRED_VARS Atima_LIBRARY Atima_INCLUDE_DIR
53+ VERSION_VAR Atima_VERSION
4554 )
4655
4756 if (ATIMA_FOUND AND NOT TARGET Atima::Atima)
@@ -55,9 +64,12 @@ else()
5564endif ()
5665
5766message (" - ${Cyan} ATIMAPATH${CR} = ${BGreen} $ENV{ATIMAPATH} ${CR} " )
58- message (" - ${Cyan} Atima_INCLUDE_DIR ${CR} = ${BGreen}${Atima_INCLUDE_DIR}${CR} " )
59- message (" - ${Cyan} Atima_LIBRARY ${CR} = ${BGreen}${Atima_LIBRARY}${CR} " )
67+ message (" - ${Cyan} ATIMA_INCLUDE_DIR ${CR} = ${BGreen}${Atima_INCLUDE_DIR}${CR} " )
68+ message (" - ${Cyan} ATIMA_LIBRARY ${CR} = ${BGreen}${Atima_LIBRARY}${CR} " )
6069
6170if (ATIMA_FOUND)
62- add_definitions (-DWITH_ATIMA )
71+ message (STATUS "${BGreen} ATIMA was FOUND${CR} (version ${Atima_VERSION} )" )
72+ add_definitions (-DWITH_ATIMA )
73+ else ()
74+ message (STATUS "${BYellow} Could not find package ATIMA${CR} " )
6375endif ()
0 commit comments