forked from berdal84/nodable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (34 loc) · 1.42 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
# Nodable's main CMakeLists.txt
# prerequisites:
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") # earliest version supporting c++11
# project declaration
project( "Nodable" VERSION "0.8.0" )
option( ENABLE_TESTS "Enable tests" on )
# define where outputs goes
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
# include compiler configuration script
include( cmake/compiler-config.cmake )
# If a default install prefix has not been set, we set it to ./bin
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/bin" CACHE PATH "..." FORCE)
# libraries (external)
add_subdirectory( ./libs )
# nodable
add_subdirectory( ./src )
# Unit tests (gtest)
if ( ENABLE_TESTS )
enable_testing()
# https://stackoverflow.com/questions/12540970/how-to-make-gtest-build-mdd-instead-of-mtd-by-default-using-cmake
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# we don't need mocks (for now) nor install
option(BUILD_GMOCK OFF)
option(INSTALL_GTEST OFF)
# we need to set ./gtest since directory is not a subdirectory...
# this will tell cmake where to put the configured files inside
# build directory.
add_subdirectory( libs/googletest-release-1.10.0)
# nodable tests
add_subdirectory( tests )
endif()