-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
45 lines (36 loc) · 1.46 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
38
39
40
41
42
43
44
45
cmake_policy(SET CMP0048 NEW)
cmake_minimum_required(VERSION 3.2)
project(OEHSHOP
VERSION 0.2)
set(OEHSHOP_VERSION ${OEHSHOP_VERSION_MAJOR}.${OEHSHOP_VERSION_MINOR}.${OEHSHOP_VERSION_PATCH})
find_package(Threads)
# Add Dependencies
add_subdirectory(third_party)
add_subdirectory(shared)
# Printing Station only works on Linux
if(NOT WIN32)
add_subdirectory(printing_station)
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lstdc++fs ${CMAKE_CXX_STANDARD_LIBRARIES}")
else()
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CXX_STANDARD_LIBRARIES}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
endif()
if(NOT (CMAKE_BUILD_TYPE MATCHES DEBUG))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -Os")
endif()
# Desk is multiplatform
if(NOT ONLY_PRINTING)
add_subdirectory(desk)
endif()
# Packaging
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME ${OEHSHOP})
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VENDOR "https://github.com/oeh-tnf/OEH-Shop")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ÖH Shop")
set(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md)
set(CPACK_PACKAGE_FILE_NAME "OEHSHOP-v${VERSION}")
include(CPack)