Skip to content

Commit

Permalink
Test on Windows compiles and links properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
karastojko committed Jan 6, 2023
1 parent dfb8af9 commit 56a8969
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ endif(NOT SHARE_INSTALL_DIR)
# options for mailio to control how the project is built.
option(MAILIO_BUILD_DOCUMENTATION "Turn on to build doxygen based documentation." ON)
option(MAILIO_BUILD_EXAMPLES "Turn on to build examples." ON)
option(MAILIO_BUILD_SHARED_LIBRARY "Turn on to build the shared library." OFF)
option(MAILIO_BUILD_TESTS "Turn on to build the tests." OFF)
option(MAILIO_BUILD_SHARED_LIBRARY "Turn on to build the shared library." ON)
option(MAILIO_BUILD_TESTS "Turn on to build the tests." ON)

# add a dependent option to build latex documentation or not.
include(CMakeDependentOption)
Expand Down Expand Up @@ -199,5 +199,5 @@ if(${MAILIO_BUILD_EXAMPLES})
endif(${MAILIO_BUILD_EXAMPLES})

if(${MAILIO_BUILD_TESTS})
add_subdirectory(test)
add_subdirectory(test)
endif(${MAILIO_BUILD_TESTS})
9 changes: 3 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
cmake_minimum_required(VERSION 3.16.3)
cmake_minimum_required(VERSION 3.16.3)

set(PROJECT_NAME test_message)
find_package(Boost REQUIRED COMPONENTS system date_time regex unit_test_framework)
find_package(OpenSSL)

enable_testing()

add_executable(
${PROJECT_NAME}
test_message.cpp
${project_sources}
)

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include/ PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../ PUBLIC ${Boost_INCLUDE_DIRS} PUBLIC ${OPENSSL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include/ PUBLIC ${Boost_INCLUDE_DIRS} PUBLIC ${OPENSSL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC mailio ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})


2 changes: 1 addition & 1 deletion test/test_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ copy at http://www.freebsd.org/copyright/freebsd-license.html.
*/


#define BOOST_TEST_DYN_LINK
//#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE message_test

#include <string>
Expand Down

0 comments on commit 56a8969

Please sign in to comment.