-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (29 loc) · 1.32 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
cmake_minimum_required(VERSION 3.9)
project(labpack VERSION 0.1.0 LANGUAGES C)
set(CMAKE_C_VISIBILITY_PRESET hidden)
# First for the generic no-config case (e.g. with mingw)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Second, for multi-config builds (e.g. msvc)
foreach(OUTPUT_CONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUT_CONFIG} OUTPUT_CONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUT_CONFIG} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUT_CONFIG} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUT_CONFIG} ${CMAKE_BINARY_DIR}/bin)
endforeach(OUTPUT_CONFIG CMAKE_CONFIGURATION_TYPES)
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
set(OUTPUT_NAME ${CMAKE_PROJECT_NAME}-x64)
set(OUTPUT_NAME ${CMAKE_PROJECT_NAME}-x64)
else()
set(OUTPUT_NAME ${CMAKE_PROJECT_NAME})
endif()
add_definitions(
-DVERSION="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
-DVERSION_MAJOR=${PROJECT_VERSION_MAJOR}
-DVERSION_MINOR=${PROJECT_VERSION_MINOR}
-DVERSION_PATCH=${PROJECT_VERSION_PATCH}
)
add_subdirectory(src)
enable_testing()
add_subdirectory(tests)