Skip to content

Commit c5af93f

Browse files
Fixed MXML configuration
1 parent 9c73bd8 commit c5af93f

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

cmake_include/FindMXML.cmake

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,30 @@
2626
#==============================================================================
2727

2828

29-
if(CMAKE_HOST_UNIX)
30-
find_module(MXML
31-
LIB_NAMES mxml
32-
HEADER_NAMES mxml.h
33-
MOD_NAME mxml)
29+
#------------------------------------------------------------------------------
30+
# find the runtime binaries of the MXML library
31+
#------------------------------------------------------------------------------
32+
find_library(MXML_LIBRARY NAMES mxml mxml1)
33+
34+
35+
if(MXML_LIBRARY MATCHES MXML_LIBRARY-NOTFOUND)
36+
message(FATAL_ERROR "Could not find MXML library!")
3437
else()
35-
find_module(MXML
36-
LIB_NAMES mxml mxml1
37-
HEADER_NAMES mxml.h
38-
MOD_NAME mxml)
38+
get_filename_component(MXML_LIBRARY_DIRS ${MXML_LIBRARY} PATH)
39+
message(STATUS "Found MXML library: ${MXML_LIBRARY}")
40+
message(STATUS "MXML libary path: ${MXML_LIBRARY_DIRS}")
3941
endif()
4042

41-
if(NOT HAVE_MXML)
42-
#the user has explicitely requested to build with MXML - as we could not
43-
#find the library we have to exit the configuration
44-
message(FATAL_ERROR "User requested MXML not found!")
43+
#------------------------------------------------------------------------------
44+
# find the MXML header file
45+
#------------------------------------------------------------------------------
46+
find_path(MXML_INCLUDE_DIRS mxml.h)
47+
48+
if(MXML_INCLUDE_DIRS MATCHES MXML_INCLUDE_DIRS-NOTFOUND)
49+
message(FATAL_ERROR "Could not find MXML header files")
50+
else()
51+
message(STATUS "Found MXML header files in: ${MXML_INCLUDE_DIRS}")
4552
endif()
4653

47-
list(APPEND NAPI_LINK_LIBS ${MXML_LIBFILES})
54+
include_directories(${MXML_INCLUDE_DIRS})
55+
list(APPEND NAPI_LINK_LIBS ${MXML_LIBRARY})

0 commit comments

Comments
 (0)