Skip to content

Commit

Permalink
Set Python and Postgres Info for cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jan 2, 2018
1 parent a31bee0 commit 8ddf378
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
28 changes: 24 additions & 4 deletions CMakeLists.txt
Expand Up @@ -50,6 +50,7 @@ execute_process(
)

INCLUDE(BareosExtractVersionInfo)

INCLUDE(BareosFindAllLibraries)


Expand All @@ -76,13 +77,32 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "HP-UX")
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# add_definitions(-DMINGW64 -DHAVE_WIN32 -DHAVE_MINGW -D_WIN32_WINNT=0x600)
add_definitions(-DMINGW64 -DHAVE_WIN32 -DHAVE_MINGW -D_WIN32_WINNT=0x600 -m64 -mwin32 -mthreads)
# add_definitions(-DMINGW64 -DHAVE_WIN32 -DHAVE_MINGW -D_WIN32_WINNT=0x600 -D_BDB_PRIV_INTERFACE_ -Wall -m64 -mwin32 -mthreads)
include_directories(${CMAKE_SOURCE_DIR}/src/win32/include ${CMAKE_SOURCE_DIR}/src/win32/compat/include)

include_directories(
${CMAKE_SOURCE_DIR}/src/win32/include
${CMAKE_SOURCE_DIR}/src/win32/compat/include
#${CMAKE_SOURCE_DIR}/src/win32/cats/pgsql/include
#${CMAKE_SOURCE_DIR}/src/win32/plugins/python/include
)
set(HAVE_WIN32 1)
link_directories(/usr/x86_64-w64-mingw32/sys-root/mingw/lib)

link_directories(
#/usr/x86_64-w64-mingw32/sys-root/mingw/lib
#${CMAKE_SOURCE_DIR}/src/win32/cats/pgsql/lib/64
#${CMAKE_SOURCE_DIR}/src/win32/plugins/python/lib/64
)

set(WINDOWS_LIBRARIES ws2_32)

SET(PYTHON_LIBRARIES ${CMAKE_SOURCE_DIR}/src/win32/plugins/python/lib/64/python27.dll )
SET(PYTHON_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/win32/plugins/python/include)

SET(PostgreSQL_LIBRARY ${CMAKE_SOURCE_DIR}/src/win32/cats/pgsql/lib/64/libpq.dll)
SET(PostgreSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/win32/cats/pgsql/include)
SET(PostgreSQL_TYPE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/win32/plugins/python/include)


else()
add_definitions("-D_FILE_OFFSET_BITS=64")
endif()
Expand Down
19 changes: 12 additions & 7 deletions cmake/BareosFindAllLibraries.cmake
Expand Up @@ -23,16 +23,21 @@ if (${SYSTEMD_FOUND})
SET(HAVE_SYSTEMD 1)
endif()

# make sure we get python 2 not 3
set(Python_ADDITIONAL_VERSIONS 2.5 2.6 2.7 2.8 2.9)
find_package(PythonInterp)
INCLUDE(FindPythonLibs)
if (${PYTHONLIBS_FOUND})
SET(HAVE_PYTHON 1)

if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# make sure we get python 2 not 3
set(Python_ADDITIONAL_VERSIONS 2.5 2.6 2.7 2.8 2.9)
find_package(PythonInterp)
INCLUDE(FindPythonLibs)

if (${PYTHONLIBS_FOUND})
SET(HAVE_PYTHON 1)
endif()

INCLUDE(FindPostgreSQL)
endif()

INCLUDE(CMakeUserFindMySQL)
INCLUDE(FindPostgreSQL)

INCLUDE(FindOpenSSL)
if (${OPENSSL_FOUND})
Expand Down
2 changes: 1 addition & 1 deletion src/cats/CMakeLists.txt
Expand Up @@ -91,7 +91,7 @@ ENDIF()

IF (HAVE_POSTGRESQL)
add_library(bareoscats-postgresql MODULE ${POSTGRESQL_SRCS})
target_link_libraries(bareoscats-postgresql bareossql bareos ${PostgreSQL_LIBRARIES} )
target_link_libraries(bareoscats-postgresql bareossql bareos ${PostgreSQL_LIBRARY} )
INSTALL(TARGETS bareoscats-postgresql DESTINATION ${backenddir})

INSTALL(DIRECTORY ddl
Expand Down

0 comments on commit 8ddf378

Please sign in to comment.