diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e52b25b..160d787 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -12,23 +12,6 @@ include(Macros) | |||
12 | option(BUILD_SHARED_LIBS "shared/static libs" ON) | 12 | option(BUILD_SHARED_LIBS "shared/static libs" ON) |
13 | option(BUILD_TESTS "tests?" OFF) | 13 | option(BUILD_TESTS "tests?" OFF) |
14 | 14 | ||
15 | if(WIN32 AND NOT CMAKE_HOST_WIN32 AND CMAKE_CROSSCOMPILING AND BUILD_TESTS) | ||
16 | add_auto_option(ENABLE_WINE "Enable running tests with wine" AUTO) | ||
17 | find_program(WINE_EXECUTABLE wine) | ||
18 | check_auto_option(ENABLE_WINE "wine support" WINE_EXECUTABLE "wine executable") | ||
19 | if(ENABLE_WINE AND WINE_EXECUTABLE) | ||
20 | set(WRAPPER ${WINE_EXECUTABLE}) | ||
21 | set(RUN_TESTS 1) | ||
22 | message(STATUS "Support to run cross compiled tests - enabled") | ||
23 | endif() | ||
24 | elseif(BUILD_TESTS) | ||
25 | set(RUN_TESTS 1) | ||
26 | endif() | ||
27 | |||
28 | if(RUN_TESTS) | ||
29 | enable_testing() | ||
30 | endif() | ||
31 | |||
32 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | 15 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
33 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | 16 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
34 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | 17 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
@@ -44,5 +27,9 @@ if(WIN32) | |||
44 | endif() | 27 | endif() |
45 | 28 | ||
46 | if (BUILD_TESTS) | 29 | if (BUILD_TESTS) |
30 | if (CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR) | ||
31 | message(WARNING "You might want to set CMAKE_CROSSCOMPILING_EMULATOR to wine path in order to run tests") | ||
32 | endif () | ||
33 | enable_testing() | ||
47 | add_subdirectory(tests) | 34 | add_subdirectory(tests) |
48 | endif() | 35 | endif() |