From a5b122d91accdbc9c688b444fd3e68745ea12469 Mon Sep 17 00:00:00 2001 From: Michel Ferrero Date: Mon, 9 Sep 2013 14:49:15 +0200 Subject: [PATCH] Fix cmake so that -DMATHJAX_PATH works modified: CMakeLists.txt modified: cmake/FindMathJax.cmake --- CMakeLists.txt | 40 ++++++++++++++++++++++------------------ cmake/FindMathJax.cmake | 20 ++++++++++++-------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35a4efd0..73ca4dc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,24 +305,6 @@ EXECUTE_PROCESS(COMMAND id -un OUTPUT_VARIABLE WhoAmI RESULT_VARIABLE returncode set(TRIQS_HOSTNAME ${myHostName}) 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() @@ -405,6 +387,28 @@ endif (Build_Documentation) 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 #------------------------ diff --git a/cmake/FindMathJax.cmake b/cmake/FindMathJax.cmake index 1eade0b5..8433d5de 100644 --- a/cmake/FindMathJax.cmake +++ b/cmake/FindMathJax.cmake @@ -8,14 +8,18 @@ # It sets up : MATHJAX_PATH # -SET(TRIAL_PATHS - $ENV{MATHJAX_ROOT} - ${MATHJAX_ROOT} - $ENV{HOME}/MathJax - /usr/share/javascript/mathjax - /opt/local/share/javascript/mathjax - ) -FIND_PATH(MATHJAX_PATH MathJax.js ${TRIAL_PATHS} DOC "Root Path of MathJax") +if(NOT DEFINED MATHJAX_PATH) + + SET(TRIAL_PATHS + $ENV{MATHJAX_ROOT} + ${MATHJAX_ROOT} + $ENV{HOME}/MathJax + /usr/share/javascript/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)