3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 13:53:40 +01:00

Fix cmake so that -DMATHJAX_PATH works

modified:   CMakeLists.txt
  modified:   cmake/FindMathJax.cmake
This commit is contained in:
Michel Ferrero 2013-09-09 14:49:15 +02:00
parent dade89f60d
commit a5b122d91a
2 changed files with 34 additions and 26 deletions

View File

@ -305,24 +305,6 @@ EXECUTE_PROCESS(COMMAND id -un OUTPUT_VARIABLE WhoAmI RESULT_VARIABLE returncode
set(TRIQS_HOSTNAME ${myHostName}) set(TRIQS_HOSTNAME ${myHostName})
set(TRIQS_COMPILEDBY ${WhoAmI}) set(TRIQS_COMPILEDBY ${WhoAmI})
# TRIQS cmake file and config.h
message( STATUS "-------- Making TRIQSConfig.cmake -------------")
get_property(ALL_DEFS GLOBAL PROPERTY TRIQS_COMPIL_DEFINITIONS)
configure_file(./cmake/triqs_config.h.in Config/triqs_config.h @ONLY)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
configure_file(./cmake/TRIQSConfig.cmake.in Config/TRIQSConfig.cmake @ONLY)
else()
configure_file(./cmake/TRIQSConfig.cmake.in Config/TRIQSConfig1.cmake @ONLY )
EXEC_PYTHON_SCRIPT( "import re;open('${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig.cmake','w').write(re.sub(r';*\\s*-framework\\s+([a-zA-Z_][a-zA-Z_0-9]*)',r' \"-framework \\1\"',open('${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig1.cmake').read()))", ConfigFile)
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig.cmake DESTINATION share/triqs/cmake)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/triqs_config.h DESTINATION include/triqs)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/FindTRIQS.cmake DESTINATION share/triqs/cmake)
configure_file(./cmake/FindTriqsTest.cmake.in Config//FindTriqsTest.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/FindTriqsTest.cmake DESTINATION share/triqs/cmake)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/run_test.cmake DESTINATION share/triqs/cmake)
# #
enable_testing() enable_testing()
@ -405,6 +387,28 @@ endif (Build_Documentation)
install (FILES ${CMAKE_SOURCE_DIR}/cmake/FindTRIQS.cmake DESTINATION share/triqs/cmake) install (FILES ${CMAKE_SOURCE_DIR}/cmake/FindTRIQS.cmake DESTINATION share/triqs/cmake)
#------------------------
# TRIQS cmake file and config.h
#------------------------
message( STATUS "-------- Making TRIQSConfig.cmake -------------")
get_property(ALL_DEFS GLOBAL PROPERTY TRIQS_COMPIL_DEFINITIONS)
configure_file(./cmake/triqs_config.h.in Config/triqs_config.h @ONLY)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
configure_file(./cmake/TRIQSConfig.cmake.in Config/TRIQSConfig.cmake @ONLY)
else()
configure_file(./cmake/TRIQSConfig.cmake.in Config/TRIQSConfig1.cmake @ONLY )
EXEC_PYTHON_SCRIPT( "import re;open('${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig.cmake','w').write(re.sub(r';*\\s*-framework\\s+([a-zA-Z_][a-zA-Z_0-9]*)',r' \"-framework \\1\"',open('${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig1.cmake').read()))", ConfigFile)
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/TRIQSConfig.cmake DESTINATION share/triqs/cmake)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/triqs_config.h DESTINATION include/triqs)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/FindTRIQS.cmake DESTINATION share/triqs/cmake)
configure_file(./cmake/FindTriqsTest.cmake.in Config//FindTriqsTest.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/FindTriqsTest.cmake DESTINATION share/triqs/cmake)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/run_test.cmake DESTINATION share/triqs/cmake)
#------------------------ #------------------------
# Packaging # Packaging
#------------------------ #------------------------

View File

@ -8,14 +8,18 @@
# It sets up : MATHJAX_PATH # It sets up : MATHJAX_PATH
# #
SET(TRIAL_PATHS if(NOT DEFINED MATHJAX_PATH)
$ENV{MATHJAX_ROOT}
${MATHJAX_ROOT} SET(TRIAL_PATHS
$ENV{HOME}/MathJax $ENV{MATHJAX_ROOT}
/usr/share/javascript/mathjax ${MATHJAX_ROOT}
/opt/local/share/javascript/mathjax $ENV{HOME}/MathJax
) /usr/share/javascript/mathjax
FIND_PATH(MATHJAX_PATH MathJax.js ${TRIAL_PATHS} DOC "Root Path of MathJax") /opt/local/share/javascript/mathjax
)
FIND_PATH(MATHJAX_PATH MathJax.js ${TRIAL_PATHS} DOC "Root Path of MathJax")
endif()
mark_as_advanced(MATHJAX_PATH) mark_as_advanced(MATHJAX_PATH)