TheAlgorithms-C/CMakeLists.txt

76 lines
2.2 KiB
CMake
Raw Normal View History

2020-07-04 02:04:34 +03:00
cmake_minimum_required(VERSION 3.6)
2020-04-07 06:50:46 +03:00
project(Algorithms_in_C
LANGUAGES C
2020-04-07 06:50:46 +03:00
VERSION 1.0.0
DESCRIPTION "Set of algorithms implemented in C."
)
option(USE_OPENMP "flag to use OpenMP for multithreading" ON)
2020-05-25 05:28:28 +03:00
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW)
find_package(Doxygen OPTIONAL_COMPONENTS dot dia)
if(DOXYGEN_FOUND)
set(DOXYGEN_GENERATE_MAN NO)
2020-05-25 05:28:28 +03:00
set(DOXYGEN_USE_MATHJAX YES)
2020-05-26 02:17:03 +03:00
set(DOXYGEN_GENERATE_HTML YES)
2020-06-28 18:27:18 +03:00
# set(DOXYGEN_HTML_TIMESTAMP YES)
set(DOXYGEN_EXTRACT_STATIC YES)
2020-05-25 05:28:28 +03:00
set(DOXYGEN_INLINE_SOURCES YES)
2020-05-26 02:06:21 +03:00
set(DOXYGEN_CREATE_SUBDIRS YES)
2020-06-05 16:22:46 +03:00
set(DOXYGEN_GENERATE_TREEVIEW YES)
2020-06-28 22:30:06 +03:00
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
2020-05-25 05:28:28 +03:00
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
set(DOXYGEN_EXT_LINKS_IN_WINDOW YES)
2020-05-26 02:06:21 +03:00
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
set(DOXYGEN_CLANG_ASSISTED_PARSING YES)
set(DOXYGEN_FILE_PATTERNS *.c *.h *.md)
set(DOXYGEN_MATHJAX_EXTENSIONS TeX/AMSmath TeX/AMSsymbols)
set(DOXYGEN_TAGFILES "doc/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/")
2020-05-26 04:21:26 +03:00
set(DOXYGEN_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML")
2020-05-25 05:28:28 +03:00
if(Doxygen_dot_FOUND)
set(DOXYGEN_HAVE_DOT YES)
2020-05-26 00:02:03 +03:00
set(DOXYGEN_CALL_GRAPH YES)
2020-05-25 05:28:28 +03:00
set(DOXYGEN_INTERACTIVE_SVG YES)
2020-05-26 02:17:03 +03:00
set(DOXYGEN_DOT_IMAGE_FORMAT "svg")
2020-05-25 05:28:28 +03:00
endif()
doxygen_add_docs(
doc
${PROJECT_SOURCE_DIR}
COMMENT "Generate documentation"
)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED YES)
2020-04-08 05:27:27 +03:00
2020-04-24 03:00:57 +03:00
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
2020-06-30 20:38:53 +03:00
# add_compile_options(/Za)
2020-04-24 03:00:57 +03:00
endif(MSVC)
find_library(MATH_LIBRARY m)
if(USE_OPENMP)
find_package(OpenMP)
if (OpenMP_C_FOUND)
message(STATUS "Building with OpenMP Multithreading.")
else()
message(STATUS "No OpenMP found, no multithreading.")
endif()
endif()
2020-04-07 06:50:46 +03:00
add_subdirectory(misc)
add_subdirectory(sorting)
2020-07-04 02:04:34 +03:00
add_subdirectory(graphics)
add_subdirectory(searching)
2020-06-07 00:09:31 +03:00
add_subdirectory(conversions)
add_subdirectory(project_euler)
2020-05-31 17:56:51 +03:00
add_subdirectory(machine_learning)
add_subdirectory(numerical_methods)
2020-04-07 06:50:46 +03:00
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)