target_enable_bddcml.cmake 1.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
macro(target_enable_bddcml _TARGET_ _SCOPE_)
    if (${ARGC} GREATER 2)
      set(LINK_EXECUTABLE ON)
    else ()
      set(LINK_EXECUTABLE OFF)
    endif ()

    SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML")

    find_file(BDDCML_H bddcml_interface_c.h
      HINTS ENV CPATH
      DOC "Header bddcml_interface_c.h for the BDDCML library.")

    if (BDDCML_H)
      get_filename_component(BDDCML_PATH ${BDDCML_H} PATH)
      target_include_directories(${_TARGET_} ${_SCOPE_} ${BDDCML_PATH})
      target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDC_ML=1 Add_)
    else()
      message(FATAL_ERROR "Could not find BDDCML headers.")
    endif()

    if (LINK_EXECUTABLE)
      find_library(BDDCML_LIB bddcml
        HINTS ENV LIBRARY_PATH
        DOC "BDDCML library")

      if(BDDCML_LIB)
        target_link_libraries(${_TARGET_} ${_SCOPE_} ${BDDCML_LIB})
      else()
        message(FATAL_ERROR "Could not find the BDDCML library")
      endif()
    endif (LINK_EXECUTABLE)

    target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDCML=1)
endmacro(target_enable_bddcml)