-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
52 lines (40 loc) · 1.59 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.14)
project(chemicalite)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CHEMICALITE_VERSION "2024.05.1")
add_compile_definitions("CHEMICALITE_VERSION=${CHEMICALITE_VERSION}")
if (MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()
find_package(SQLite3 REQUIRED)
include_directories(${SQLite3_INCLUDE_DIRS})
find_package(Boost 1.58.0 COMPONENTS system serialization iostreams REQUIRED)
find_package(RDKit 2023.09.1 REQUIRED)
include_directories(${RDKit_INCLUDE_DIRS})
option(CHEMICALITE_ENABLE_OPTIMIZED_POPCNT
"enable compiler optimization for the native architecture" ${RDKit_USE_OPTIMIZED_POPCNT})
option(CHEMICALITE_ENABLE_TESTS "enable tests" ON)
if (CHEMICALITE_ENABLE_OPTIMIZED_POPCNT)
# this logic is copied from the RDKit's cmake scripts
if (NOT MSVC)
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
message("RDK_OPTIMIZE_POPCNT is not available on aarch64")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
endif()
endif()
endif (CHEMICALITE_ENABLE_OPTIMIZED_POPCNT)
if (CHEMICALITE_ENABLE_TESTS)
find_program(MEMORYCHECK_COMMAND NAMES valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full")
include(CTest)
enable_testing()
endif (CHEMICALITE_ENABLE_TESTS)
add_subdirectory(src)