-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (23 loc) · 1.11 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
cmake_minimum_required(VERSION 3.0)
set(CMP0048 NEW)
#Disable in source compilation
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt." )
endif()
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type")
endif()
project(myApp VERSION 1.0.0 LANGUAGES CXX)
enable_testing()
#Set default install path
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../install_dir/" CACHE PATH "Where to install myApp")
#Set path to Dependencies
#Set path to Dependencies
set(GTEST_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../install_dir/" CACHE PATH "Root folder of the google test framework installation")
set(MYLIB_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../install_dir/" CACHE PATH "Root folder of myLib installation")
#Add custom path to find path
set(CMAKE_PREFIX_PATH ${MYLIB_ROOT_DIR})
find_package(myLib REQUIRED)
include(cmake/CompilerFlags.cmake)
add_subdirectory(src)
add_subdirectory(tests)