External_muparserx.cmake 1.52 KB
Newer Older
Guillaume Pasero's avatar
Guillaume Pasero committed
1
2
set(proj MUPARSERX)

3
4
5
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)

6
message(STATUS "Setup muParserX ...")
Guillaume Pasero's avatar
Guillaume Pasero committed
7
8

if(USE_SYSTEM_MUPARSERX)
9
  find_package ( MUPARSERX REQUIRED )
10
  add_custom_target(${proj})
Guillaume Pasero's avatar
Guillaume Pasero committed
11
12
  message(STATUS "  Using muParserX system version")
else()
13
  SETUP_SUPERBUILD(PROJECT ${proj})
14
  message(STATUS "  Using muParserX SuperBuild version")
Guillaume Pasero's avatar
Guillaume Pasero committed
15
  
16
17
  set(MUPARSERX_FLAGS)
  if(APPLE)
18
    set(MUPARSERX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-std=c++0x")
19
20
  endif()
  
Guillaume Pasero's avatar
Guillaume Pasero committed
21
22
23
24
25
26
27
28
29
  # svn checkout http://muparserx.googlecode.com/svn/trunk/ muparserx-read-only
  
  ExternalProject_Add(${proj}
    PREFIX ${proj}
    #URL "http://muparserx.googlecode.com/svn/archives/muparserx_v3_0_2.zip"
    #URL_MD5 487a91084f1929d2fdc9bedee598a77a
    SVN_REPOSITORY "http://muparserx.googlecode.com/svn/trunk"
    SVN_REVISION -r 291
    BINARY_DIR ${MUPARSERX_SB_BUILD_DIR}
30
    INSTALL_DIR ${SB_INSTALL_PREFIX}
Guillaume Pasero's avatar
Guillaume Pasero committed
31
    CMAKE_CACHE_ARGS
32
      -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
Guillaume Pasero's avatar
Guillaume Pasero committed
33
      -DCMAKE_BUILD_TYPE:STRING=Release
34
      -DBUILD_SHARED_LIBS:BOOL=ON
35
      ${MUPARSERX_FLAGS}
36
    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
Guillaume Pasero's avatar
Guillaume Pasero committed
37
38
39
40
41
42
    DEPENDS ${${proj}_DEPENDENCIES}
    PATCH_COMMAND ${CMAKE_COMMAND} -E copy 
      ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt 
      ${MUPARSERX_SB_SRC}
    )
  
43
44
45
46
47
48
  set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
  if(WIN32)
    set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparserx.lib)
  elseif(UNIX)
    set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparserx${CMAKE_SHARED_LIBRARY_SUFFIX})
  endif()
Guillaume Pasero's avatar
Guillaume Pasero committed
49

50
endif()
51
endif()