-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (52 loc) · 1.55 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
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.14)
## Set Project and Version
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/version.txt" VERSION)
project(venus_nwchemex_plugin VERSION "${VERSION}" LANGUAGES CXX)
## Get CMaize
include(cmake/get_cmaize.cmake)
## Paths ##
set(${PROJECT_NAME}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(${PROJECT_NAME}_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(${PROJECT_NAME}_TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests")
## Options ##
cmaize_option_list(
BUILD_TESTING OFF "Should the tests be built?"
)
## Find or build dependencies ##
cmaize_find_or_build_dependency(
simde
URL github.com/NWChemEx/SimDE
VERSION master
BUILD_TARGET simde
FIND_TARGET nwx::simde
CMAKE_ARGS BUILD_TESTING=OFF
)
## Add libraries ##
cmaize_add_library(
${PROJECT_NAME}
SOURCE_DIR "${${PROJECT_NAME}_SOURCE_DIR}/${PROJECT_NAME}"
INCLUDE_DIRS "${${PROJECT_NAME}_INCLUDE_DIR}/${PROJECT_NAME}"
DEPENDS simde
)
## Build tests ##
if("${BUILD_TESTING}")
## Find or build dependencies for tests
cmaize_find_or_build_dependency(
Catch2
URL github.com/catchorg/Catch2
BUILD_TARGET Catch2
FIND_TARGET Catch2::Catch2
VERSION v2.x
)
## Add Tests ##
cmaize_add_tests(
test_${PROJECT_NAME}
SOURCE_DIR "${${PROJECT_NAME}_TESTS_DIR}/unit_tests"
INCLUDE_DIRS "${${PROJECT_NAME}_INCLUDE_DIR}/${PROJECT_NAME}"
DEPENDS Catch2 ${PROJECT_NAME}
)
endif()
## Add package ##
cmaize_add_package(
${PROJECT_NAME} NAMESPACE ${PROJECT_NAME}::
)