-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (23 loc) · 991 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
project(cBFGS VERSION 0.1.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_C_CLANG_TIDY clang-tidy;
# -checks=*
# )
add_compile_options(-fdiagnostics-color=always -Wall -Werror)
set(CMAKE_BUILD_TYPE Release) # Debug
option(BUILD_SHARED_LIBS "build shared libraries" OFF)
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not supported. Please create a new directory (e.g. 'Builds') and run CMake from there")
endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include_directories(${PROJECT_SOURCE_DIR})
add_subdirectory(cbfgs)
add_subdirectory(tests)
add_custom_target(__prebuild__ ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink "${PROJECT_BINARY_DIR}/compile_commands.json" "${PROJECT_SOURCE_DIR}/compile_commands.json"
)
# vim:fenc=utf-8 et sw=2: