Commits

arrowdodger  committed 418f733

Add detection of Setup.hs filename.

  • Participants
  • Parent commits 072f37b

Comments (0)

Files changed (1)

File AddCabal.cmake

         message(FATAL_ERROR "Can't find package description file: ${ABSOLUTE_CABAL_FILE}")
     endif()
 
+    if(EXISTS ${ABSOLUTE_PACKAGE_DIR}/Setup.lhs)
+        set(SETUP_SRC "Setup.lhs")
+    else()
+        set(SETUP_SRC "Setup.hs")
+    endif()
+        
     file(READ ${ABSOLUTE_CABAL_FILE} CABAL_CONTENTS)
     get_cabal_fields(PKG_NAME ${CABAL_CONTENTS} "name")
 
     endif()
 
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${cabal_dir}/setup-config
-        COMMAND runhaskell ${ABSOLUTE_PACKAGE_DIR}/Setup.lhs configure
+        COMMAND runhaskell ${ABSOLUTE_PACKAGE_DIR}/${SETUP_SRC} configure
                 --builddir=${CMAKE_CURRENT_BINARY_DIR}/${cabal_dir}
                 ${OPTIMIZATION_FLAG}
                 ${VERBOSITY_FLAG}
     )
 
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${cabal_dir}/build
-        COMMAND runhaskell ${ABSOLUTE_PACKAGE_DIR}/Setup.lhs build
+        COMMAND runhaskell ${ABSOLUTE_PACKAGE_DIR}/${SETUP_SRC} build
                 --builddir=${CMAKE_CURRENT_BINARY_DIR}/${cabal_dir}
                 ${VERBOSITY_FLAG}
         COMMENT ""