use standard CMAKE vars for prefixes and suffixes

develop
Myk Taylor 2020-08-10 01:01:13 -07:00
parent 6da364a60b
commit 702228bf12
1 changed files with 5 additions and 9 deletions

@ -35,19 +35,15 @@ endforeach()
include(ExternalProject) include(ExternalProject)
if(WIN32) if(WIN32)
set(EXPAT_LIB_SUFFIX "MD.lib") set(EXPAT_LIB_NAME_SUFFIX "MD")
set(LIB_SUFFIX ".lib")
set(LIB_PREFIX "")
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} /DXML_STATIC") set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} /DXML_STATIC")
else() else()
set(EXPAT_LIB_SUFFIX ".a") set(EXPAT_LIB_NAME_SUFFIX "")
set(LIB_SUFFIX ".a")
set(LIB_PREFIX "lib")
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} -DXML_STATIC") set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} -DXML_STATIC")
endif() endif()
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat) set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
set(LIBEXPAT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_SUFFIX}) set(LIBEXPAT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_NAME_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LIBEXPAT_LIB ${LIBEXPAT_LIB} PARENT_SCOPE) set(LIBEXPAT_LIB ${LIBEXPAT_LIB} PARENT_SCOPE)
ExternalProject_Add(libexpat_project ExternalProject_Add(libexpat_project
PREFIX libexpat PREFIX libexpat
@ -58,7 +54,7 @@ ExternalProject_Add(libexpat_project
) )
set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip) set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip)
set(LIBZIP_LIB ${LIBZIP_INSTALL_DIR}/lib/${LIB_PREFIX}zip${LIB_SUFFIX}) set(LIBZIP_LIB ${LIBZIP_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}zip${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LIBZIP_LIB ${LIBZIP_LIB} PARENT_SCOPE) set(LIBZIP_LIB ${LIBZIP_LIB} PARENT_SCOPE)
ExternalProject_Add(libzip_project ExternalProject_Add(libzip_project
PREFIX libzip PREFIX libzip
@ -70,7 +66,7 @@ ExternalProject_Add(libzip_project
set(XLSXIO_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/xlsxio) set(XLSXIO_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/xlsxio)
set(XLSXIO_INSTALL_DIR ${XLSXIO_INSTALL_DIR} PARENT_SCOPE) set(XLSXIO_INSTALL_DIR ${XLSXIO_INSTALL_DIR} PARENT_SCOPE)
set(XLSXIO_LIB ${XLSXIO_INSTALL_DIR}/lib/${LIB_PREFIX}xlsxio_read${LIB_SUFFIX}) set(XLSXIO_LIB ${XLSXIO_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xlsxio_read${CMAKE_STATIC_LIBRARY_SUFFIX})
set(XLSXIO_LIB ${XLSXIO_LIB} PARENT_SCOPE) set(XLSXIO_LIB ${XLSXIO_LIB} PARENT_SCOPE)
ExternalProject_Add(xlsxio_project ExternalProject_Add(xlsxio_project
PREFIX xlsxio PREFIX xlsxio