-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
22 lines (16 loc) · 952 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
# target a cmake version, you can target a lower version if you like
cmake_minimum_required(VERSION 3.24)
# declare our stub
project(stub CXX)
# this line will mark our stub as MultiThreaded, instead of MultiThreadedDLL
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# this will collect header and source files into a convenient variable
file(GLOB_RECURSE SRC_FILES FOLLOW_SYMLINKS ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HEADER_FILES FOLLOW_SYMLINKS ${PROJECT_SOURCE_DIR}/src/*.hpp)
# this will give you source groups in the resulting Visual Studio project
source_group(TREE "${PROJECT_SOURCE_DIR}" PREFIX "Header Files" FILES ${HEADER_FILES})
source_group(TREE "${PROJECT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SRC_FILES})
# this will create our stub executable
add_executable(stub ${HEADER_FILES} ${SRC_FILES})
# this will link the parent zlib project to our stub
target_link_libraries(stub zlibstatic)