-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
32 lines (24 loc) · 865 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
cmake_minimum_required(VERSION 3.2)
# Define the project
project(
CMakeTemplate
VERSION 0.1.0
LANGUAGES CXX
)
# Include standard CMake modules
include(CTest)
# Define the name of the subfolder where the project's include files are located
# set(PROJECT_INCLUDE_FOLDER_NAME "my_lib")
set(PROJECT_LIBRARY_NAME "my_lib")
# Specify the required libraries
find_package(Boost REQUIRED)
# The compiled library code is here
add_subdirectory(src)
# Append the cmake directory to the module path list
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Ensure that the libraries are shared
# set(BUILD_SHARED_LIBS ON)
# Define the executable (move to a subfolder along with the main.cpp file)
add_executable(CMakeTemplate main.cpp)
target_compile_features(CMakeTemplate PRIVATE cxx_std_17)
target_link_libraries(CMakeTemplate PRIVATE "my_lib")