0031481: Data Exchange - provide parser of STEP EXPRESS schema for generation of...
[occt.git] / adm / cmake / bison.cmake
1 # bison
2
3 # execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
4
5 # delete obsolete 3RDPARTY_BISON_EXECUTABLE cache variable (not used anymore)
6 unset (3RDPARTY_BISON_EXECUTABLE CACHE)
7
8 # delete BISON_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
9 # without reasonable diagnostic
10 if (NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
11   unset (BISON_EXECUTABLE CACHE)
12 endif()
13
14 # Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make
15 # these paths searhed by find_package
16 if (3RDPARTY_DIR)
17   file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/")
18   foreach (candidate_path ${BISON_PATHS})
19     if (IS_DIRECTORY ${candidate_path})
20       list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
21     endif()
22   endforeach()
23 endif()
24  
25 find_package (BISON 3.7.4)