add support for appveyor builds (32 bit windows only)

This commit is contained in:
mlangkabel
2018-12-03 12:10:46 +01:00
parent ea3abfc026
commit a3da0edf1e
4 changed files with 110 additions and 38 deletions
+19 -8
View File
@@ -45,6 +45,21 @@ message(STATUS "Found Python include dirs: ${PYTHON_INCLUDE_DIRS}")
message(STATUS "Found Python libraries: ${PYTHON_LIBRARIES}")
# --- Find Core ---
if (NOT EXISTS "${CORE_INCLUDE_DIRS}")
message(STATUS "Core include dir \"${CORE_INCLUDE_DIRS}\" does not exist, trying to find Core automatically.")
set(CORE_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/../core/include" CACHE FILEPATH "path to core include directory")
message(STATUS "Set Core include dir to \"${CORE_INCLUDE_DIRS}\".")
endif ()
if (NOT EXISTS "${CORE_LIBRARIES}")
message(STATUS "Core library \"${CORE_LIBRARIES}\" does not exist, trying to find Core automatically.")
set(CORE_LIBRARIES "${CMAKE_SOURCE_DIR}/../core/build/${ARCH}bit/Release/sourcetraildb.lib" CACHE FILEPATH "path to core library directory")
message(STATUS "Set Core library to \"${CORE_LIBRARIES}\".")
endif ()
# --- Setup Paths ---
set(RESOURCES_SWIG_DIR "${CMAKE_SOURCE_DIR}/../resources_swig")
@@ -53,9 +68,6 @@ set(GENERATED_SRC_DIR "${CMAKE_BINARY_DIR}/src")
set(SWIG_INTERFACE_FILE "${RESOURCES_SWIG_DIR}/interface/${PACKAGE_NAME}.i")
set(GENERATED_WRAPPER_FILE "${GENERATED_SRC_DIR}/${PACKAGE_NAME}_wrap.cxx")
set(CORE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../core/include" CACHE FILEPATH "path to core include directory")
set(CORE_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/../core/build/${ARCH}bit/Debug/sourcetraildb.lib" CACHE FILEPATH "path to core library directory")
set(CORE_RELEASE_LIBRARY "${CMAKE_SOURCE_DIR}/../core/build/${ARCH}bit/Release/sourcetraildb.lib" CACHE FILEPATH "path to core library directory")
if (WIN32)
file(WRITE ${GENERATED_WRAPPER_FILE} "")
@@ -80,18 +92,17 @@ set_target_properties(${LIB_NAME} PROPERTIES SUFFIX ".pyd")
add_custom_command(
TARGET ${LIB_NAME}
PRE_BUILD
COMMAND if not exist \"${GENERATED_SRC_DIR}\" mkdir \"${GENERATED_SRC_DIR}\" \n $ENV{SWIG_DIR}/swig.exe -c++ -python -I${RESOURCES_SWIG_DIR}/include -o ${GENERATED_WRAPPER_FILE} -outdir ${CMAKE_BINARY_DIR}/$(CONFIGURATION) ${SWIG_INTERFACE_FILE}
COMMAND if not exist \"${GENERATED_SRC_DIR}\" mkdir \"${GENERATED_SRC_DIR}\" \n swig -c++ -python -I${RESOURCES_SWIG_DIR}/include -o ${GENERATED_WRAPPER_FILE} -outdir ${CMAKE_BINARY_DIR}/$(CONFIGURATION) ${SWIG_INTERFACE_FILE}
COMMENT "Generating wrapper code file."
)
target_include_directories(${LIB_NAME} PUBLIC
"${RESOURCES_SWIG_DIR}/include"
"${CORE_INCLUDE_DIR}"
"${CORE_INCLUDE_DIRS}"
${PYTHON_INCLUDE_DIRS}
)
message("CORE_RELEASE_LIBRARY: ${CORE_RELEASE_LIBRARY}")
message("CORE_RELEASE_LIBRARY: ${CORE_LIBRARIES}")
target_link_libraries(${LIB_NAME} ${PYTHON_LIBRARIES})
target_link_libraries(${LIB_NAME} debug "${CORE_DEBUG_LIBRARY}" )
target_link_libraries(${LIB_NAME} optimized "${CORE_RELEASE_LIBRARY}" )
target_link_libraries(${LIB_NAME} ${CORE_LIBRARIES})