|
1 | 1 | cmake_minimum_required(VERSION "3.12")
|
2 | 2 |
|
3 |
| -project("spackexample" VERSION 0.1.0) |
| 3 | +project("spackexample" VERSION 0.2.0) |
| 4 | + |
| 5 | +find_package(Boost |
| 6 | + 1.65.1 |
| 7 | + REQUIRED |
| 8 | + filesystem |
| 9 | + ) |
4 | 10 |
|
5 |
| -#find_package(Boost |
6 |
| -# 1.65.1 |
7 |
| -# REQUIRED |
8 |
| -# filesystem |
9 |
| -# ) |
10 |
| -# |
11 | 11 | #find_package(yaml-cpp
|
12 | 12 | # 0.7.0
|
13 | 13 | # REQUIRED
|
14 | 14 | # )
|
15 | 15 |
|
16 |
| -#add_library(spackexamplelib filesystem/filesystem.cpp fem/fem.cpp flatset/flatset.cpp yamlParser/yamlParser.cpp) |
| 16 | +add_library(spackexamplelib filesystem/filesystem.cpp flatset/flatset.cpp) |
| 17 | +#add_library(spackexamplelib filesystem/filesystem.cpp flatset/flatset.cpp yamlParser/yamlParser.cpp) |
17 | 18 |
|
18 |
| -#set_target_properties(spackexamplelib |
19 |
| -# PROPERTIES |
20 |
| -# PUBLIC_HEADER filesystem/filesystem.hpp |
21 |
| -# PUBLIC_HEADER fem/fem.hpp |
22 |
| -# PUBLIC_HEADER flatset/flatset.hpp |
23 |
| -# PUBLIC_HEADER yamlParser/yamlParser.hpp |
24 |
| -# ) |
| 19 | +set_target_properties(spackexamplelib |
| 20 | + PROPERTIES |
| 21 | + PUBLIC_HEADER filesystem/filesystem.hpp |
| 22 | + PUBLIC_HEADER flatset/flatset.hpp |
| 23 | + PUBLIC_HEADER yamlParser/yamlParser.hpp |
| 24 | + ) |
25 | 25 |
|
26 | 26 | add_executable(spackexample main.cpp)
|
27 |
| -#target_link_libraries(spackexample spackexamplelib) |
| 27 | +target_link_libraries(spackexample spackexamplelib) |
| 28 | +target_link_libraries(spackexamplelib Boost::filesystem) |
28 | 29 | #target_link_libraries(spackexamplelib Boost::filesystem ${YAML_CPP_LIBRARIES})
|
29 | 30 |
|
30 |
| -#target_include_directories(spackexamplelib |
31 |
| -# PRIVATE |
32 |
| -# ${CMAKE_CURRENT_SOURCE_DIR}/spackexamplelib |
33 |
| -# PUBLIC |
34 |
| -# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/spackexamplelib> |
35 |
| -# $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/spackexamplelib> |
36 |
| -# ) |
| 31 | +target_include_directories(spackexamplelib |
| 32 | + PRIVATE |
| 33 | + ${CMAKE_CURRENT_SOURCE_DIR}/spackexamplelib |
| 34 | + PUBLIC |
| 35 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/spackexamplelib> |
| 36 | + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/spackexamplelib> |
| 37 | + ) |
37 | 38 |
|
38 | 39 | # Create install targets
|
39 | 40 | include(GNUInstallDirs)
|
40 |
| -install(TARGETS spackexample |
41 |
| -#install(TARGETS spackexample spackexamplelib |
| 41 | +install(TARGETS spackexample spackexamplelib |
42 | 42 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
43 | 43 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
44 | 44 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
0 commit comments