diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-21 12:48:48 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-21 12:48:48 +0300 |
commit | d03d853b9a608dda5ef9cbb40384f3dbabb3ed5a (patch) | |
tree | 71bb2b05c0ff8159d387116ef5dcf50075981c6d | |
parent | update cmake-common (diff) | |
download | aes-tools-d03d853b9a608dda5ef9cbb40384f3dbabb3ed5a.tar.gz aes-tools-d03d853b9a608dda5ef9cbb40384f3dbabb3ed5a.zip |
cmake: use Boost::* imported targets
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cxx/CMakeLists.txt | 3 | ||||
-rw-r--r-- | utils/CMakeLists.txt | 20 |
3 files changed, 9 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 56b32a7..d030045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) # for Boost::* imported targets project(aes_tools C CXX) @@ -31,7 +31,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) endif() add_subdirectory(cxx) - add_subdirectory(utils) install(FILES LICENSE.txt DESTINATION share) diff --git a/cxx/CMakeLists.txt b/cxx/CMakeLists.txt index 2c265f5..64613f7 100644 --- a/cxx/CMakeLists.txt +++ b/cxx/CMakeLists.txt @@ -2,8 +2,7 @@ find_package(Boost REQUIRED) add_library(aesxx INTERFACE) target_include_directories(aesxx INTERFACE include/) -target_include_directories(aesxx SYSTEM INTERFACE ${Boost_INCLUDE_DIRS}) -target_link_libraries(aesxx INTERFACE aes) +target_link_libraries(aesxx INTERFACE aes Boost::boost) if(MSVC_VERSION EQUAL 1900) # These annoying DbgHelp.h warnings: diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 50a682a..1aa22d8 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,39 +1,33 @@ -find_package(Boost REQUIRED COMPONENTS filesystem program_options system) +find_package(Boost REQUIRED COMPONENTS filesystem program_options) set(block_util_headers block_cmd_parser.hpp block_dumper.hpp block_input.hpp data_parsers.hpp helpers/command_line.hpp) add_executable(util_encrypt_block encrypt_block.cpp ${block_util_headers}) -target_include_directories(util_encrypt_block SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_encrypt_block PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_encrypt_block PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_encrypt_block PROPERTIES OUTPUT_NAME encrypt_block) add_executable(util_decrypt_block decrypt_block.cpp ${block_util_headers}) -target_include_directories(util_decrypt_block SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_decrypt_block PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_decrypt_block PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_decrypt_block PROPERTIES OUTPUT_NAME decrypt_block) set(file_util_headers data_parsers.hpp file_cmd_parser.hpp helpers/command_line.hpp helpers/file.hpp) add_executable(util_encrypt_file encrypt_file.cpp ${file_util_headers}) -target_include_directories(util_encrypt_file SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_encrypt_file PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_encrypt_file PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_encrypt_file PROPERTIES OUTPUT_NAME encrypt_file) add_executable(util_decrypt_file decrypt_file.cpp ${file_util_headers}) -target_include_directories(util_decrypt_file SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_decrypt_file PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_decrypt_file PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_decrypt_file PROPERTIES OUTPUT_NAME decrypt_file) set(bmp_util_headers ${file_util_headers} helpers/bmp.hpp) add_executable(util_encrypt_bmp encrypt_bmp.cpp ${bmp_util_headers}) -target_include_directories(util_encrypt_bmp SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_encrypt_bmp PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_encrypt_bmp PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_encrypt_bmp PROPERTIES OUTPUT_NAME encrypt_bmp) add_executable(util_decrypt_bmp decrypt_bmp.cpp ${bmp_util_headers}) -target_include_directories(util_decrypt_bmp SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(util_decrypt_bmp PRIVATE aesxx ${Boost_LIBRARIES}) +target_link_libraries(util_decrypt_bmp PRIVATE aesxx Boost::filesystem Boost::program_options) set_target_properties(util_decrypt_bmp PROPERTIES OUTPUT_NAME decrypt_bmp) install(TARGETS |