forked from vindar/tgx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (48 loc) · 2.05 KB
/
CMakeLists.txt
File metadata and controls
58 lines (48 loc) · 2.05 KB
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
###############################################################################
###############################################################################
#
# CMakeList of the TGX library.
#
# How to build the library (Windows/Linux/MacOS).
#
# 1. Install CMake 3.10 (or later).
#
# 2. Open a terminal/shell at the library root folder /tgx and type:
# mkdir build
# cd build
# cmake ..
#
# 3. Build the library using the generated project files.
# - On Windows: open the Visual Studio solution file "tgx.sln" and build the
# library from within the IDE.
# - On Linux/MacOS: use the 'make' command to build the library.
#
###############################################################################
###############################################################################
if(DEFINED IDF_TARGET)
# ESP-IDF COMPONENT BUILD:
idf_component_register(SRC_DIRS "src" INCLUDE_DIRS "src")
else()
cmake_minimum_required(VERSION 3.10)
project(tgx)
file(GLOB_RECURSE _tgx_src_files ./src/*.cpp ./src/*.c)
file(GLOB_RECURSE _tgx_hdr_files ./src/*.hpp ./src/*.h ./src/*.inl)
add_library(tgx STATIC ${_tgx_src_files} ${_tgx_hdr_files})
target_include_directories(tgx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
target_compile_features(tgx PUBLIC cxx_std_17)
# set the project as the default startup project in visual studio.
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "${PROJECT_NAME}")
# move CMake specific project inside filter "CMakePredefinedTargets".
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PREDEFINED_TARGETS_FOLDER "CustomTargets")
# build only for debug and release conf.
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
endif()
###############################################################################
#end of file
###############################################################################