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
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()

22
    if (LINK_EXECUTABLE OR APPLE)
23
24
25
26
27
      find_library(BDDCML_LIB bddcml
        HINTS ENV LIBRARY_PATH
        DOC "BDDCML library")

      if(BDDCML_LIB)
28
        target_link_libraries(${_TARGET_} ${BDDCML_LIB})
29
30
31
      else()
        message(FATAL_ERROR "Could not find the BDDCML library")
      endif()
32
    endif (LINK_EXECUTABLE OR APPLE)
33
34
35

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