Skip to content

Commit

Permalink
Fixed MXML configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenwintersberger committed Dec 15, 2015
1 parent 9c73bd8 commit c5af93f
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions cmake_include/FindMXML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,30 @@
#==============================================================================


if(CMAKE_HOST_UNIX)
find_module(MXML
LIB_NAMES mxml
HEADER_NAMES mxml.h
MOD_NAME mxml)
#------------------------------------------------------------------------------
# find the runtime binaries of the MXML library
#------------------------------------------------------------------------------
find_library(MXML_LIBRARY NAMES mxml mxml1)


if(MXML_LIBRARY MATCHES MXML_LIBRARY-NOTFOUND)
message(FATAL_ERROR "Could not find MXML library!")
else()
find_module(MXML
LIB_NAMES mxml mxml1
HEADER_NAMES mxml.h
MOD_NAME mxml)
get_filename_component(MXML_LIBRARY_DIRS ${MXML_LIBRARY} PATH)
message(STATUS "Found MXML library: ${MXML_LIBRARY}")
message(STATUS "MXML libary path: ${MXML_LIBRARY_DIRS}")
endif()

if(NOT HAVE_MXML)
#the user has explicitely requested to build with MXML - as we could not
#find the library we have to exit the configuration
message(FATAL_ERROR "User requested MXML not found!")
#------------------------------------------------------------------------------
# find the MXML header file
#------------------------------------------------------------------------------
find_path(MXML_INCLUDE_DIRS mxml.h)

if(MXML_INCLUDE_DIRS MATCHES MXML_INCLUDE_DIRS-NOTFOUND)
message(FATAL_ERROR "Could not find MXML header files")
else()
message(STATUS "Found MXML header files in: ${MXML_INCLUDE_DIRS}")
endif()

list(APPEND NAPI_LINK_LIBS ${MXML_LIBFILES})
include_directories(${MXML_INCLUDE_DIRS})
list(APPEND NAPI_LINK_LIBS ${MXML_LIBRARY})

0 comments on commit c5af93f

Please sign in to comment.