We are using CMake to build our project. Depending if we build against OCCT
Does anyone know how to implement a check for the OCCT version in CMakeLists.txt?
Daniel Neander Fri, 08/01/2014 - 16:50
Hello Sebastian,
Standard_Version.hxx defines version macros.
if (OCC_VERSION_COMPLETE LESS "6.7.3" OR OCC_VERSION_DEVELOPMENT)
# OCC version <= 6.7.3 and
# link against TKAdvTools
# Note OCC_VERSION_DEVELOPMENT is not found (commented out) in official release.
else()
# don't link TKAdvTools
endif()
There is other macros in there that you can find :P
Note I don't use cmake so syntax may be incorrect.
Kind regards
Daniel
OCC_VERSION_HEX is a preprocessor macro. AFAIK CMake does not expand those. Did anyone yet implement such check either compiling a program for try_run or parsing Standard_Version.h using regular expressions?
Fri, 08/01/2014 - 16:50
Hello Sebastian,
Standard_Version.hxx defines version macros.
if (OCC_VERSION_COMPLETE LESS "6.7.3" OR OCC_VERSION_DEVELOPMENT)
# OCC version <= 6.7.3 and
# link against TKAdvTools
# Note OCC_VERSION_DEVELOPMENT is not found (commented out) in official release.
else()
# don't link TKAdvTools
endif()
There is other macros in there that you can find :P
Note I don't use cmake so syntax may be incorrect.
Kind regards
Daniel
Fri, 08/01/2014 - 18:26
Hello Sebastian,
to check whether TKAdvTools should be linked with we recommend to use the following test: "OCC_VERSION_HEX <= 0x060702".
Regards,
Forum Supervisor
Fri, 08/01/2014 - 19:56
OCC_VERSION_HEX is a preprocessor macro. AFAIK CMake does not expand those. Did anyone yet implement such check either compiling a program for try_run or parsing Standard_Version.h using regular expressions?