aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSilvio Traversaro <silvio@traversaro.it>2021-04-29 09:44:52 +0200
committerGitHub <noreply@github.com>2021-04-29 09:44:52 +0200
commit010969070719fe14435f4b146ecef5e65df0098f (patch)
treef3f5e43983a89ff9d886c64342f977a324931ca4 /CMakeLists.txt
parent020e3142953ce9d044b6144bc7a55629341bb715 (diff)
parenta130887781373f5f29552ee6d7139b99a829512d (diff)
downloaddlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.tar.gz
dlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.tar.bz2
dlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.zip
Merge pull request #99 from xantares/wine
cmake: use CROSSCOMPILING_EMULATOR
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
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)
12option(BUILD_SHARED_LIBS "shared/static libs" ON) 12option(BUILD_SHARED_LIBS "shared/static libs" ON)
13option(BUILD_TESTS "tests?" OFF) 13option(BUILD_TESTS "tests?" OFF)
14 14
15if(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()
24elseif(BUILD_TESTS)
25 set(RUN_TESTS 1)
26endif()
27
28if(RUN_TESTS)
29 enable_testing()
30endif()
31
32set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 15set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
33set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 16set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
34set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 17set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -44,5 +27,9 @@ if(WIN32)
44endif() 27endif()
45 28
46if (BUILD_TESTS) 29if (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)
48endif() 35endif()