diff --git a/CMakeLists.txt b/CMakeLists.txt index e4df6ac..73ec5d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.10) project(openFPGALoader VERSION "1.0.0" LANGUAGES CXX) add_definitions(-DVERSION=\"v${PROJECT_VERSION}\") -option(WINDOWS_CROSSCOMPILE "Enable cross-compile on windows" OFF) #if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") # set(WINDOWS_CROSSCOMPILE ON) #else() @@ -19,7 +18,8 @@ option(ENABLE_OPTIM "Enable build with -O3 optimization level" option(BUILD_STATIC "Whether or not to build with static libraries" OFF) option(USE_PKGCONFIG "Use pkgconfig to find libraries" ON) option(LINK_CMAKE_THREADS "Use CMake find_package to link the threading library" OFF) -option(WINDOWS_STATIC_ZLIB "Link zlib statically for Windows builds" ON) +option(WINDOWS_CROSSCOMPILE "Enable cross-compile on windows" OFF) +option(WINDOWS_STATIC_ZLIB "Link zlib statically for Windows builds" ON) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(ENABLE_UDEV OFF) @@ -225,7 +225,7 @@ if (USE_PKGCONFIG) endif() # zlib support (gzip) - if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + if(WINDOWS_CROSSCOMPILE) if (WINDOWS_STATIC_ZLIB) set(ZLIB_USE_STATIC_LIBS ON) endif()