-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (29 loc) · 1.22 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
# Just for the sake of easy lib inclusion in CMake based projects
# Not for use in **Arduino** projects!
cmake_minimum_required(VERSION 3.12.0)
project(VISL VERSION 0.0.1 LANGUAGES CXX C)
set(VIS_SOURCE_DIR "src")
file(GLOB_RECURSE VIS_SOURCES
"${VIS_SOURCE_DIR}/*.h"
"${VIS_SOURCE_DIR}/*.cpp")
list(FILTER VIS_SOURCES EXCLUDE REGEX "^[VIS-]")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(VISL_TEST_PROGRAM ON)
add_library(VISL STATIC ${VIS_SOURCES})
set_target_properties(VISL PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/bin"
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib"
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/lib"
)
target_include_directories(VISL PUBLIC "${VIS_SOURCE_DIR}")
if(VISL_TEST_PROGRAM)
add_executable(visl-test "test/main.cpp")
target_include_directories(visl-test PUBLIC "${VIS_SOURCE_DIR}")
target_link_libraries(visl-test VISL)
target_compile_options(visl-test PRIVATE -g)
endif()