Skip to content

Commit

Permalink
refs #3069 cmake changes for building on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Vanek committed Oct 27, 2018
1 parent fa9610e commit ebb67d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Expand Up @@ -268,21 +268,21 @@ find_package(MPFR REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PCRE REQUIRED libpcre)
if (NOT (WIN32 AND MINGW AND MSYS))
if (NOT (WIN32 OR MINGW OR MSYS))
find_package(Backtrace)
if (Backtrace_FOUND)
list(APPEND LIBQORE_OPTIONAL_INCLUDES ${Backtrace_INCLUDE_DIRS})
list(APPEND LIBQORE_OPTIONAL_LIBS ${Backtrace_LIBRARIES})
endif (Backtrace_FOUND)
endif (NOT (WIN32 AND MINGW AND MSYS))
endif (NOT (WIN32 OR MINGW OR MSYS))

if (WIN32 AND MINGW AND MSYS)
if (WIN32 OR MINGW OR MSYS)
SET(CMAKE_DL_LIBS dl)
SET(MPFR_LIBRARIES mpfr gmp)
SET(OPENSSL_LIBRARIES ssl crypto)
SET(WINSOCKET_LIBRARIES ws2_32)
SET(NO_SIGNAL_HANDLING ON)
endif (WIN32 AND MINGW AND MSYS)
endif (WIN32 OR MINGW OR MSYS)

create_git_revision()

Expand Down Expand Up @@ -629,16 +629,16 @@ target_compile_definitions(libqore PRIVATE MODULE_DIR="${MODULE_DIR}")
target_compile_definitions(libqore PRIVATE MODULE_VER_DIR="${MODULE_VER_DIR}")
target_compile_definitions(libqore PRIVATE USER_MODULE_DIR="${USER_MODULE_DIR}")
target_compile_definitions(libqore PRIVATE USER_MODULE_VER_DIR="${USER_MODULE_VER_DIR}")
if (WIN32 AND MINGW AND MSYS)
if (WIN32 OR MINGW OR MSYS)
target_compile_definitions(libqore PUBLIC BUILDING_DLL)
endif (WIN32 AND MINGW AND MSYS)
endif (WIN32 OR MINGW OR MSYS)

target_include_directories(libqore PUBLIC ${BZIP2_INCLUDE_DIR} ${ICONV_INCLUDE_DIR} ${MPFR_INCLUDE_DIRS} ${LIBQORE_OPTIONAL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${PCRE_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/lib)

target_link_libraries(libqore ${BZIP2_LIBRARIES} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${ICONV_LIBRARY} ${LIBQORE_LIBS} ${LIBQORE_OPTIONAL_LIBS} ${MPFR_LIBRARIES} ${OPENSSL_LIBRARIES} ${PCRE_LDFLAGS} ${ZLIB_LIBRARIES})
if (WIN32 AND MINGW AND MSYS)
if (WIN32 AND MINGW OR MSYS)
target_link_libraries(libqore ${WINSOCKET_LIBRARIES})
endif (WIN32 AND MINGW AND MSYS)
endif (WIN32 AND MINGW OR MSYS)

set_target_properties(libqore PROPERTIES OUTPUT_NAME qore)
if (APPLE)
Expand Down
4 changes: 0 additions & 4 deletions cmake/unix-config.h.cmake
Expand Up @@ -238,7 +238,3 @@
/* to be set later */
#define QORE_LIB_CFLAGS ""
#define QORE_LIB_LDFLAGS ""
#define MODULE_DIR "@MODULE_DIR@"
#define MODULE_VER_DIR "@MODULE_VER_DIR@"
#define USER_MODULE_DIR "@USER_MODULE_DIR@"
#define USER_MODULE_VER_DIR "@USER_MODULE_VER_DIR@"

0 comments on commit ebb67d6

Please sign in to comment.