|
1 | | - |
2 | | -cmake_minimum_required(VERSION 3.12) |
3 | | - |
4 | | -project("libdbcppp" VERSION 0.1.0) |
5 | | - |
6 | | -set(CMAKE_CXX_STANDARD 17) |
7 | | -set(CMAKE_STATIC_LIBRARY_PREFIX "") |
8 | | -set(CMAKE_SHARED_LIBRARY_PREFIX "") |
9 | | -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
10 | | - |
11 | | -if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") |
12 | | - add_definitions("/bigobj") |
13 | | -endif() |
14 | | - |
15 | | -include_directories("include") |
16 | | -include_directories("third-party/libxml2/include") |
17 | | -include_directories("third-party/libxmlmm/libxmlmm") |
18 | | -include_directories("third-party/boost") |
19 | | -include_directories("third-party/cxxopts/include") |
20 | | - |
21 | | -set(LIBXML2_WITH_ICONV OFF) |
22 | | -set(LIBXML2_WITH_LZMA OFF) |
23 | | -set(LIBXML2_WITH_PYTHON OFF) |
24 | | -set(LIBXML2_WITH_ZLIB OFF) |
25 | | -set(LIBXML2_WITH_TESTS OFF) |
26 | | - |
27 | | -add_subdirectory(third-party/libxml2) |
28 | | - |
29 | | -file(GLOB libxmlmm_header |
30 | | - "third-party/libxmlmm/libxmlmm/*.h" |
31 | | -) |
32 | | -file(GLOB libxmlmm_src |
33 | | - "third-party/libxmlmm/libxmlmm/*.cpp" |
34 | | -) |
35 | | - |
36 | | -add_library(libxmlmm SHARED "") |
37 | | -target_link_libraries(libxmlmm LibXml2) |
38 | | - |
39 | | -target_sources("libxmlmm" |
40 | | - PRIVATE ${libxmlmm_header} |
41 | | - PRIVATE ${libxmlmm_src} |
42 | | -) |
43 | | - |
44 | | -install( |
45 | | - TARGETS "libxmlmm" |
46 | | - DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
47 | | -install( |
48 | | - DIRECTORY "libxmlmm" |
49 | | - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxmlmm |
50 | | - FILES_MATCHING PATTERN "*.h") |
51 | | - |
52 | | -add_subdirectory(src) |
53 | | -add_subdirectory(tests) |
54 | | -add_subdirectory(examples) |
55 | | - |
56 | | -set(CMAKE_STATIC_LIBRARY_PREFIX "") |
57 | | -set(CMAKE_SHARED_LIBRARY_PREFIX "") |
58 | | -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 1 | + |
| 2 | +cmake_minimum_required(VERSION 3.12) |
| 3 | + |
| 4 | +project("libdbcppp" VERSION 0.1.0) |
| 5 | + |
| 6 | +option(build_tests "Build tests" ON) |
| 7 | +option(build_examples "Build examples" ON) |
| 8 | + |
| 9 | +set(CMAKE_CXX_STANDARD 17) |
| 10 | +set(CMAKE_STATIC_LIBRARY_PREFIX "") |
| 11 | +set(CMAKE_SHARED_LIBRARY_PREFIX "") |
| 12 | +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 13 | + |
| 14 | +if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") |
| 15 | + add_definitions("/bigobj") |
| 16 | +endif() |
| 17 | + |
| 18 | +include_directories("include") |
| 19 | +include_directories("third-party/libxml2/include") |
| 20 | +include_directories("third-party/libxmlmm/libxmlmm") |
| 21 | +include_directories("third-party/boost") |
| 22 | +include_directories("third-party/cxxopts/include") |
| 23 | + |
| 24 | +set(LIBXML2_WITH_ICONV OFF) |
| 25 | +set(LIBXML2_WITH_LZMA OFF) |
| 26 | +set(LIBXML2_WITH_PYTHON OFF) |
| 27 | +set(LIBXML2_WITH_ZLIB OFF) |
| 28 | +set(LIBXML2_WITH_TESTS OFF) |
| 29 | + |
| 30 | +add_subdirectory(third-party/libxml2) |
| 31 | + |
| 32 | +file(GLOB libxmlmm_header |
| 33 | + "third-party/libxmlmm/libxmlmm/*.h" |
| 34 | +) |
| 35 | +file(GLOB libxmlmm_src |
| 36 | + "third-party/libxmlmm/libxmlmm/*.cpp" |
| 37 | +) |
| 38 | + |
| 39 | +add_library(libxmlmm SHARED "") |
| 40 | +target_link_libraries(libxmlmm LibXml2) |
| 41 | + |
| 42 | +target_sources("libxmlmm" |
| 43 | + PRIVATE ${libxmlmm_header} |
| 44 | + PRIVATE ${libxmlmm_src} |
| 45 | +) |
| 46 | + |
| 47 | +install( |
| 48 | + TARGETS "libxmlmm" |
| 49 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 50 | +install( |
| 51 | + DIRECTORY "libxmlmm" |
| 52 | + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxmlmm |
| 53 | + FILES_MATCHING PATTERN "*.h") |
| 54 | + |
| 55 | +add_subdirectory(src) |
| 56 | +if (build_tests) |
| 57 | + add_subdirectory(tests) |
| 58 | +endif() |
| 59 | +if (build_examples) |
| 60 | + add_subdirectory(examples) |
| 61 | +endif() |
| 62 | + |
| 63 | +set(CMAKE_STATIC_LIBRARY_PREFIX "") |
| 64 | +set(CMAKE_SHARED_LIBRARY_PREFIX "") |
| 65 | +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
0 commit comments