Minor bug fix for the class modular_form_kernel: Ensure that the series-method includ...
[ginac.git] / ginsh / CMakeLists.txt
index dda2e00ca265aad718fcd60b35b9c076cecb8eb2..d90dd8e13c6ee5922aa857aee98f7b6d774a98fe 100644 (file)
@@ -1,15 +1,9 @@
-include_directories(
-       ${CMAKE_CURRENT_SOURCE_DIR}/../ginac
-       ${CMAKE_CURRENT_BINARY_DIR}/../ginac
-       ${CMAKE_CURRENT_SOURCE_DIR}
-       ${CMAKE_CURRENT_BINARY_DIR})
-add_definitions(-DIN_GINAC)
 
 bison_target(ginsh_parser
-             ginsh_parser.yy
+             ginsh_parser.ypp
             ${CMAKE_CURRENT_BINARY_DIR}/ginsh_parser.cpp)
 flex_target(ginsh_lexer
-            ginsh_lexer.ll
+            ginsh_lexer.lpp
            ${CMAKE_CURRENT_BINARY_DIR}/ginsh_lexer.cpp)
 add_flex_bison_dependency(ginsh_lexer ginsh_parser)
 
@@ -19,7 +13,7 @@ set(ginsh_SOURCES
 )
 
 set(ginsh_HEADERS
-    ginsh_parser.h
+    ginsh_parser.hpp
     ginsh.h
     ginsh_fcn_help.h
     ginsh_op_help.h
@@ -28,31 +22,31 @@ set(ginsh_HEADERS
 set(ginsh_DISTRIB
     ${ginsh_SOURCES}
     ${ginsh_HEADERS}
-    ginsh_parser.yy
-    ginsh_lexer.ll
+    ginsh_parser.ypp
+    ginsh_lexer.lpp
     ginsh.1.in
     ginsh_fcn_help.py
     ginsh_op_help.py
 )
+set(ginsh_include_directories ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
 if (READLINE_FOUND)
-       include_directories(${READLINE_INCLUDE_DIRS})
+       set(ginsh_include_directories ${ginsh_include_directories} ${READLINE_INCLUDE_DIRS})
 endif()
 
 add_custom_command(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ginsh_fcn_help.h
-       COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_fcn_help.py -o ginsh_fcn_help.h ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in
+       COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_fcn_help.py -o ginsh_fcn_help.h ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in
        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_fcn_help.py
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 
 add_custom_command(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ginsh_op_help.h
-       COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_op_help.py -o ginsh_op_help.h ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in
+       COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_op_help.py -o ginsh_op_help.h ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in
        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ginsh.1.in ${CMAKE_CURRENT_SOURCE_DIR}/ginsh_op_help.py
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 
 add_custom_command(
-       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ginsh_parser.h
-       COMMAND ${CMAKE_COMMAND} -E copy ginsh_parser.hpp ginsh_parser.h
+       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ginsh_parser.hpp
        DEPENDS ${BISON_ginsh_parser_OUTPUTS}
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -62,5 +56,7 @@ if (READLINE_FOUND)
 endif()
 
 add_executable(ginsh ${ginsh_SOURCES} ${ginsh_HEADERS})
-target_link_libraries(ginsh ginac ${ginsh_extra_libs})
-install(TARGETS ginsh RUNTIME DESTINATION "${BIN_INSTALL_DIR}")
+target_link_libraries(ginsh ginac::ginac ${ginsh_extra_libs})
+target_include_directories(ginsh PRIVATE ${ginsh_include_directories})
+target_compile_definitions(ginsh PRIVATE HAVE_CONFIG_H)
+install(TARGETS ginsh RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")