Commits

Shlomi Fish committed 9c53d86

Now CMakeLists.txt works better.

Comments (0)

Files changed (1)

 INCLUDE( "${CMAKE_CURRENT_SOURCE_DIR}/Common.cmake" )
 
+INCLUDE (CheckTypeSize)
+INCLUDE (CheckFunctionExists)
+INCLUDE (CheckCCompilerFlag)
+
 LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
 # This is the equivalent to perform a "make dist"/"make distdir" etc.
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Linear Programming Solver")
 SET(CPACK_PACKAGE_VENDOR "FILL IN")
 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
-SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
 
 # Process and extract the version number.
 FILE( READ "ver.txt" VERSION)
 # which point to directories outside the build tree to the install RPATH
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
-SET (FREECELL_SOLVER_LIB_MODULES alloc.c app_str.c card.c check_and_add_state.c cmd_line.c freecell.c instance.c lib.c move.c move_funcs_maps.c move_funcs_order.c preset.c scans.c simpsim.c split_cmd_line.c state.c)
+SET (LP_SOLVE_LIB_MODULES lp_MDO.c shared/commonlib.c colamd/colamd.c shared/mmio.c shared/myblas.c ini.c fortify.c lp_rlp.c lp_crash.c bfp/bfp_LUSOL/lp_LUSOL.c bfp/bfp_LUSOL/LUSOL/lusol.c lp_Hash.c lp_lib.c lp_wlp.c lp_matrix.c lp_mipbb.c lp_MPS.c lp_params.c lp_presolve.c lp_price.c lp_pricePSE.c lp_report.c lp_scale.c lp_simplex.c lp_solve/lp_solve.c lp_SOS.c lp_utils.c yacc_read.c)
 
-IF (FCS_FREECELL_ONLY)
-    LIST (REMOVE_ITEM FREECELL_SOLVER_LIB_MODULES preset.c)
-    SET (FCS_DISABLE_SIMPLE_SIMON 1)
-ENDIF (FCS_FREECELL_ONLY)
+CHECK_TYPE_SIZE("void *" PTR_SIZE_IN_BYTES)
+MATH(EXPR PTR_SIZE_IN_BITS "8 * ${PTR_SIZE_IN_BYTES}")
+SET (PLATFORM "ux${PTR_SIZE_IN_BYTES}")
 
-IF (FCS_DISABLE_SIMPLE_SIMON)
-    LIST (REMOVE_ITEM FREECELL_SOLVER_LIB_MODULES simpsim.c)
-ENDIF (FCS_DISABLE_SIMPLE_SIMON)
+CHECK_FUNCTION_EXISTS(isnan HAS_ISNAN)
 
-# Add the fcs_hash.c if (and only if) it is being used.
-# 
-IF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_INTERNAL_HASH") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_INTERNAL_HASH"))
+IF (NOT HAS_ISNAN)
+    ADD_DEFINITIONS("-DNOISNAN")
+ENDIF (NOT HAS_ISNAN)
 
-    LIST(APPEND FREECELL_SOLVER_LIB_MODULES fcs_hash.c)
-
-ENDIF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_INTERNAL_HASH") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_INTERNAL_HASH"))
-
-    
-# Add the google_hash.cpp if (and only if) it is being used.
-# 
-IF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_GOOGLE_DENSE_HASH") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_GOOGLE_DENSE_HASH"))
-
-    LIST(APPEND FREECELL_SOLVER_LIB_MODULES google_hash.cpp)
-
-ENDIF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_GOOGLE_DENSE_HASH") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_GOOGLE_DENSE_HASH"))
-
-# Add fcs_dm.c if (and only if) it is being used.
-# 
-IF (${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_INDIRECT")
-    LIST(APPEND FREECELL_SOLVER_LIB_MODULES fcs_dm.c)
-ENDIF (${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_INDIRECT")
-
-# Search for libredblack if appropriate.
-IF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_LIBREDBLACK_TREE") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_LIBREDBLACK_TREE"))
-
-    FIND_LIBRARY(LIBREDBLACK_LIB redblack)
-
-ENDIF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_LIBREDBLACK_TREE") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_LIBREDBLACK_TREE"))
-
-# Search for Judy ( http://judy.sourceforge.net/ ) if appropriate.
-IF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_JUDY") OR
-    (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_JUDY"))
-
-    FIND_LIBRARY(LIBJUDY_LIB Judy)
-
-ENDIF ((${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_JUDY") OR
-       (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_JUDY"))
-
-SET (LIBAVL2_COPIED_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libavl2")
-
-# Initialize to the empty list - it may or may not be populated.
-SET (LIBAVL2_TREE_TYPES )
-
-MACRO(ADD_TREE_TYPE TREE_TYPE)
-    LIST(APPEND LIBAVL2_TREE_TYPES ${TREE_TYPE})
-    LIST(REMOVE_DUPLICATES LIBAVL2_TREE_TYPES)
-ENDMACRO(ADD_TREE_TYPE TREE_TYPE)
-
-IF (${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_LIBAVL2_TREE")
-    SET (TREE_TYPE "${FCS_STATE_STORAGE_LIBAVL2_TREE_TYPE}")
-    ADD_TREE_TYPE("${TREE_TYPE}")
-    FILE (MAKE_DIRECTORY "${LIBAVL2_COPIED_MODULES_DIR}")
-    INCLUDE_DIRECTORIES(BEFORE "${LIBAVL2_COPIED_MODULES_DIR}")
-    SET (MPROT "FC_SOLVE__STATE_STORAGE_H")
-    SET (PREFIXO "fcs_libavl2_states_tree")
-    FILE (WRITE "${LIBAVL2_COPIED_MODULES_DIR}/fcs_libavl2_state_storage.h"
-"
-#ifndef ${MPROT}
-#define ${MPROT}
-
-#include \"${TREE_TYPE}.h\"
-
-typedef struct ${TREE_TYPE}_table ${PREFIXO}_table_t;
-#define ${PREFIXO}_insert(a,b) ${TREE_TYPE}_insert((a),(b))
-#define ${PREFIXO}_create(a,b,c) ${TREE_TYPE}_create((a),(b),(c))
-#define ${PREFIXO}_destroy(a,b) ${TREE_TYPE}_destroy((a),(b))
-
-#endif /* ${MPROT} */
-"
+ADD_DEFINITIONS(
+    "-I${CMAKE_CURRENT_SOURCE_DIR}"
+    "-I${CMAKE_CURRENT_SOURCE_DIR}/bfp"
+    "-I${CMAKE_CURRENT_SOURCE_DIR}/bfp/bfp_LUSOL"
+    "-I${CMAKE_CURRENT_SOURCE_DIR}/bfp/bfp_LUSOL/LUSOL"
+    "-I${CMAKE_CURRENT_SOURCE_DIR}/colamd"
+    "-I${CMAKE_CURRENT_SOURCE_DIR}/shared"
+    "-DYY_NEVER_INTERACTIVE"
+    "-DPARSER_LP"
+    "-DINVERSE_ACTIVE=INVERSSE_LUSOL"
+    "-DRoleIsExternalInvEngine"
 )
 
-ENDIF (${FCS_STATE_STORAGE} STREQUAL "FCS_STATE_STORAGE_LIBAVL2_TREE")
-
-IF (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_LIBAVL2_TREE")
-    SET (TREE_TYPE "${FCS_STACK_STORAGE_LIBAVL2_TREE_TYPE}")
-    ADD_TREE_TYPE("${TREE_TYPE}")
-    FILE (MAKE_DIRECTORY "${LIBAVL2_COPIED_MODULES_DIR}")
-    SET (MPROT "FC_SOLVE__STACK_STORAGE_H")
-    SET (PREFIXO "fcs_libavl2_stacks_tree")
-    FILE (WRITE "${LIBAVL2_COPIED_MODULES_DIR}/fcs_libavl2_stack_storage.h"
-"
-#ifndef ${MPROT}
-#define ${MPROT}
-
-#include \"${TREE_TYPE}.h\"
-
-typedef struct ${TREE_TYPE}_table ${PREFIXO}_table_t;
-#define ${PREFIXO}_insert(a,b) ${TREE_TYPE}_insert((a),(b))
-#define ${PREFIXO}_create(a,b,c) ${TREE_TYPE}_create((a),(b),(c))
-#define ${PREFIXO}_destroy(a,b) ${TREE_TYPE}_destroy((a),(b))
-
-#endif /* ${MPROT} */
-"
-    )
-
-ENDIF (${FCS_STACK_STORAGE} STREQUAL "FCS_STACK_STORAGE_LIBAVL2_TREE")
-
-IF (LIBAVL2_TREE_TYPES)
-    INCLUDE_DIRECTORIES(BEFORE "${LIBAVL2_COPIED_MODULES_DIR}")
-    FOREACH (TREE_TYPE ${LIBAVL2_TREE_TYPES})
-        SET (C_FN "${TREE_TYPE}.c")
-        SET (H_FN "${TREE_TYPE}.h")
-        CONFIGURE_FILE ("${LIBAVL2_SOURCE_DIR}/${C_FN}" 
-            "${LIBAVL2_COPIED_MODULES_DIR}/${C_FN}"
-            COPYONLY
-        )
-        CONFIGURE_FILE ("${LIBAVL2_SOURCE_DIR}/${H_FN}" 
-            "${LIBAVL2_COPIED_MODULES_DIR}/${H_FN}"
-            COPYONLY
-        )
-        LIST(APPEND FREECELL_SOLVER_LIB_MODULES "${LIBAVL2_COPIED_MODULES_DIR}/${C_FN}")
-    ENDFOREACH (TREE_TYPE ${LIBAVL2_TREE_TYPES})
-ENDIF (LIBAVL2_TREE_TYPES)
-
 SET (MY_LINK_FLAGS )
 SET (MY_TO_PROFILE "")
 IF (CMAKE_BUILD_TYPE STREQUAL profile)
     SET (CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_DEBUG} -pg")
     LIST (APPEND MY_LINK_FLAGS "-pg" "-static-libgcc")
     SET (BUILD_STATIC_LIBRARY "1")
-    SET (MY_TARGET_LINK_LIBS "freecell-solver-static" "m_p" "c_p")
+    SET (MY_TARGET_LINK_LIBS "m_p" "c_p")
 ELSE (CMAKE_BUILD_TYPE STREQUAL profile)
     IF (FCS_LINK_TO_STATIC)
         SET (BUILD_STATIC_LIBRARY "1")
-        SET (MY_TARGET_LINK_LIBS "freecell-solver-static")
+        # SET (MY_TARGET_LINK_LIBS "${CPACK_PACKAGE_NAME}-static")
     ELSE (FCS_LINK_TO_STATIC)
-        SET (MY_TARGET_LINK_LIBS "freecell-solver")
+        # SET (MY_TARGET_LINK_LIBS "${CPACK_PACKAGE_NAME}")
     ENDIF(FCS_LINK_TO_STATIC)
 ENDIF (CMAKE_BUILD_TYPE STREQUAL profile)
 
 
 INCLUDE(CPack)
 
-include(CheckFunctionExists)
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(FindThreads)
-
-ADD_SUBDIRECTORY ("board_gen")
-ADD_SUBDIRECTORY ("man")
-ADD_SUBDIRECTORY ("Presets")
-ADD_SUBDIRECTORY ("t")
-
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 SET(COMPILER_FLAGS_TO_CHECK 
-    "-Wall" "-Werror=implicit-function-declaration" "-fvisibility=hidden"
+    "-Wall" "-Werror=implicit-function-declaration"
 )
 
 IF (CPU_ARCH)
 
 ADD_LIBRARY (freecell-solver
     SHARED
-    ${FREECELL_SOLVER_LIB_MODULES}
+    ${LP_SOLVE_LIB_MODULES}
     )
 
 LIST (APPEND FREECELL_SOLVER_LIBS "freecell-solver")
 IF (BUILD_STATIC_LIBRARY)
     ADD_LIBRARY (freecell-solver-static
         STATIC
-        ${FREECELL_SOLVER_LIB_MODULES}
+        ${LP_SOLVE_LIB_MODULES}
     )
     LIST (APPEND FREECELL_SOLVER_LIBS "freecell-solver-static")
 
     )
 ENDIF (BUILD_STATIC_LIBRARY)
 
-ADD_LIBRARY (fcs_gen_ms_freecell_boards
-    SHARED
-    gen_boards_lib.c
-    )
-
 SET_TARGET_PROPERTIES(freecell-solver
     PROPERTIES VERSION 0.5.0 SOVERSION 0
     )
 ENDMACRO(FCS_ADD_EXEC)
 
 
-FCS_ADD_EXEC(fc-solve main.c)
-FCS_ADD_EXEC(freecell-solver-range-parallel-solve test_multi_parallel.c)
-FCS_ADD_EXEC(freecell-solver-fc-pro-range-solve fc_pro_range_solver.c fc_pro_iface.c)
-FCS_ADD_EXEC_NO_INSTALL(measure-depth-dep-tests-order-perf measure_depth_dep_tests_order_performance.c)
+FCS_ADD_EXEC(${CPACK_PACKAGE_NAME} ${LP_SOLVE_LIB_MODULES})
 
-FCS_ADD_EXEC_NO_INSTALL(
-    temp-flair-solver temp-fc_pro_range_solver_with_flair_support.c
-    fc_pro_iface.c
-)
-
-IF (CMAKE_USE_PTHREADS_INIT)
-    FCS_ADD_EXEC(freecell-solver-multi-thread-solve threaded_range_solver.c)
-    TARGET_LINK_LIBRARIES(freecell-solver-multi-thread-solve "pthread")
-ENDIF (CMAKE_USE_PTHREADS_INIT)
-
-IF (UNIX)
-    FCS_ADD_EXEC_NO_INSTALL(
-        freecell-solver-fork-solve "forking_range_solver.c"
-    )
-ENDIF (UNIX)
-
-
-IF (FCS_LINK_TO_STATIC)
-    SET (TARGETS "freecell-solver" ${FREECELL_SOLVER_EXECUTABLES})
-ELSE (FCS_LINK_TO_STATIC)
-    SET (TARGETS "freecell-solver")
-ENDIF(FCS_LINK_TO_STATIC)
-
-FOREACH (TGT ${TARGETS})
-    TARGET_LINK_LIBRARIES (${TGT}
-        ${MATH_LIB} ${LIBTCMALLOC_LIB_LIST} ${LIBREDBLACK_LIB} ${LIBJUDY_LIB}
-    )
-ENDFOREACH (TGT)
-
-
-SET (MY_EXES_LINK_FLAGS ${MY_LINK_FLAGS} ${MY_EXE_FLAGS})
-SET (MY_LIBS_LINK_FLAGS ${MY_LIBS_LINK_FLAGS})
-IF (MY_LIBS_LINK_FLAGS)
-    STRING (REPLACE ";" " "  MY_LIBS_LINK_FLAGS_STRING "${MY_LIBS_LINK_FLAGS}")
-    SET_TARGET_PROPERTIES(
-        ${FREECELL_SOLVER_LIBS} 
-        PROPERTIES LINK_FLAGS "${MY_LIBS_LINK_FLAGS_STRING}"
-    )
-ENDIF (MY_LIBS_LINK_FLAGS)
-
-IF (MY_EXES_LINK_FLAGS)
-    STRING (REPLACE ";" " "  MY_EXES_LINK_FLAGS_STRING "${MY_EXES_LINK_FLAGS}")
-    SET_TARGET_PROPERTIES(
-        ${FREECELL_SOLVER_EXECUTABLES} 
-        PROPERTIES LINK_FLAGS "${MY_EXES_LINK_FLAGS_STRING}"
-    )
-ENDIF (MY_EXES_LINK_FLAGS)
-
-CHECK_FUNCTION_EXISTS(pow HAVE_POW)
-
-SET(AUTOGENERATED_CONFIG_H "config.h was auto-generated from config.h.in . Do not modify directly")
-
-INCLUDE (CheckTypeSize)
-CHECK_TYPE_SIZE("int" INT_SIZE_IN_BYTES)
-
-MATH(EXPR INT_SIZE_IN_BITS "8 * ${INT_SIZE_IN_BYTES}")
-
-SET(TEMP_SIZE 1)
-SET(FCS_INT_BIT_SIZE_LOG2 0)
-
-WHILE ( NOT ("${TEMP_SIZE}" STREQUAL "${INT_SIZE_IN_BITS}") )
-
-    MATH(EXPR TEMP2 "${TEMP_SIZE} << 1")
-    SET(TEMP_SIZE "${TEMP2}")
-
-    MATH(EXPR TEMP2 "${FCS_INT_BIT_SIZE_LOG2} + 1")
-    SET(FCS_INT_BIT_SIZE_LOG2 "${TEMP2}")
-
-ENDWHILE ( NOT ("${TEMP_SIZE}" STREQUAL "${INT_SIZE_IN_BITS}") )
-
-# Inspired from /usr/share/autoconf/autoconf/c.m4
-FOREACH(KEYWORD "inline" "__inline__" "__inline")
-   IF(NOT DEFINED HAVE_C_INLINE)
-     TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}"
-       "${CMAKE_CURRENT_SOURCE_DIR}/test_inline.c"
-       COMPILE_DEFINITIONS "-Dinline=${KEYWORD}")
-     IF(C_HAS_${KEYWORD})
-       SET(HAVE_C_INLINE TRUE)
-       SET(FCS_INLINE_KEYWORD "${KEYWORD}")
-     ENDIF(C_HAS_${KEYWORD})
-   ENDIF(NOT DEFINED HAVE_C_INLINE)
-ENDFOREACH(KEYWORD)
-
-CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
-    ${CMAKE_CURRENT_BINARY_DIR}/config.h
-    )
-
-CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/prefix.h.in
-    ${CMAKE_CURRENT_BINARY_DIR}/prefix.h
-    )
-
-CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/${CPACK_PACKAGE_NAME}.spec.in
-    ${CMAKE_CURRENT_SOURCE_DIR}/${CPACK_PACKAGE_NAME}.spec
-    )
-
-CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/${CPACK_PACKAGE_NAME}-config.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${CPACK_PACKAGE_NAME}-config
-    )
-
-CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib${CPACK_PACKAGE_NAME}.pc.in
-    ${CMAKE_CURRENT_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}.pc
-    @ONLY
-    )
-
-INSTALL(
-    TARGETS ${FREECELL_SOLVER_LIBS}
-    DESTINATION "lib"
-)
-
-IF (WIN32 AND NOT UNIX)
-    # This is so on Windows, the .dll's will be installed in the bin/ 
-    # directory as well where the Freecell Solver command-line utilities
-    # will be able to find them.
-
-    INSTALL(
-        TARGETS "freecell-solver"
-        DESTINATION "bin"
-    )
-ENDIF (WIN32 AND NOT UNIX)
-
-INSTALL(
-    FILES "${CMAKE_CURRENT_BINARY_DIR}/${CPACK_PACKAGE_NAME}-config"
-    DESTINATION "bin"
-)
-
-RUN_POD2MAN(
-    "${CMAKE_CURRENT_SOURCE_DIR}/fc-solve.pod"
-    "fc-solve.6"
-    "6"
-    "Freecell Solver"
-    "Freecell Solver ${VERSION}"
-)
-
-INSTALL_MAN ("${CMAKE_CURRENT_BINARY_DIR}/fc-solve.6" 6)
-
-INSTALL(
-    FILES
-        ${docs_to_install}
-        "README.win32.txt"
-    DESTINATION
-        "share/doc/freecell-solver/"
-)
-
-INSTALL(
-    FILES
-        "fcs_cl.h"
-        "fcs_enums.h"
-        "fcs_move.h"
-        "fcs_user.h"
-    DESTINATION
-        "include/freecell-solver"
-)
-
-
-INSTALL(
-    FILES
-        "${CMAKE_CURRENT_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}.pc"
-    DESTINATION 
-        "lib/pkgconfig"
-)
-
-# Rebuild config.h if ver.txt has changed.
-ADD_CUSTOM_COMMAND(
-    OUTPUT "config.h.in"
-    DEPENDS "ver.txt"
-    COMMAND "touch"
-    ARGS "config.h.in"
-)
-
-SET (BOARDS "")
-
-MACRO(GEN_BOARD idx)
-    SET(board "${idx}.board")
-    ADD_CUSTOM_COMMAND(
-        OUTPUT ${board}
-        COMMAND "python"
-        ARGS "board_gen/make_pysol_freecell_board.py" ${idx} ">" ${board}
-    )
-    SET(BOARDS ${BOARDS} ${board})
-ENDMACRO(GEN_BOARD idx)
-
-FOREACH(idx 24 1941)
-    GEN_BOARD(${idx})
-ENDFOREACH(idx)
-
-ADD_CUSTOM_TARGET(
-    boards
-    DEPENDS ${BOARDS}
-)
-
-FIND_PACKAGE(Asciidoc)
-
-SET (_docfiles "AUTHORS.txt" "COPYING.txt" "HACKING.txt" "INSTALL.txt" 
-    "NEWS.txt" "README.txt" "TODO.txt" "USAGE.txt" 
-)
-
-SET (docs_to_install)
-FOREACH(_file ${_docfiles})
-    GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
-    SET(_full_file "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}")
-    LIST(APPEND docs_to_install ${_full_file})
-ENDFOREACH(_file)
-
-IF(ASCIIDOC_FOUND)
-
-    SET (_pdf_targets)
-
-    FOREACH(_file ${_docfiles})
-        GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
-        SET(_in "${_file_we}")
-        SET(_html_out "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.html")
-        SET(_full_file "${CMAKE_CURRENT_SOURCE_DIR}/${_file}")
-        SET(_docbook_out "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.xml")
-        # MESSAGE(STATUS "_in == <<${_in}>> _html_out == <<${_html_out}>>")
-
-        # -a toc 
-        ADD_CUSTOM_COMMAND(
-            OUTPUT "${_html_out}"
-            COMMAND ${ASCIIDOC_EXECUTABLE} 
-                -o ${_html_out} "${_full_file}"
-            DEPENDS "${_full_file}"
-            COMMENT "Asciidoc ${_in}"
-            )
-
-
-        ADD_CUSTOM_COMMAND(
-            OUTPUT "${_docbook_out}"
-            COMMAND ${ASCIIDOC_EXECUTABLE} 
-                --backend=docbook -o ${_docbook_out} "${_full_file}"
-            DEPENDS "${_full_file}"
-            COMMENT "Asciidoc->DocBook ${_in}"
-            )
-
-        SET (_pdf "${_file_we}.pdf")
-
-        SET (target "${_file_we}_build")
-
-        ADD_CUSTOM_COMMAND(
-            OUTPUT "${_pdf}"
-            COMMAND docmake -v --make -o ${_pdf} pdf ${_docbook_out}
-            DEPENDS ${_docbook_out}
-            COMMENT "docmake to PDF"
-        )
-
-        ADD_CUSTOM_COMMAND(
-            OUTPUT ${_file_we}
-            COMMAND cp -f "${_full_file}" ${_file_we}
-            DEPENDS "${_file_we}.txt"
-            COMMENT "copy AsciiDoc to non-\".txt\" file"
-        )
-    
-        ADD_CUSTOM_TARGET(${target} ALL echo -n
-            DEPENDS "${_html_out}" "${_docbook_out}" "${_file_we}"
-        )
-
-        ADD_CUSTOM_TARGET(${_in}_pdf echo -n
-            DEPENDS "${_pdf}"
-        )
-
-        LIST(APPEND _pdf_targets ${_in}_pdf)
-
-    ENDFOREACH(_file)
-
-    # MESSAGE ("PDF_TARGETS == ${_pdf_targets}")
-
-    SET (_master_pdf_target "pdfs")
-    ADD_CUSTOM_TARGET("${_master_pdf_target}" echo -n)
-    ADD_DEPENDENCIES("${_master_pdf_target}" ${_pdf_targets})
-
-ENDIF(ASCIIDOC_FOUND)
-
-IF (FCS_WITH_TEST_SUITE)
-    
-    ADD_CUSTOM_TARGET(
-        "test"
-        "perl" "run-tests.pl"
-    )
-
-    ADD_DEPENDENCIES(
-        "test"
-        "all"
-    )
-
-ENDIF(FCS_WITH_TEST_SUITE)
-
-ADD_CUSTOM_TARGET(
-    "bench" bash scripts/time-threads-num.bash -s 2 "${MAX_NUM_BENCHMARK_THREADS}"
-    COMMAND perl scripts/time-fcs.pl dump "DUMPS/*"
-)
-