diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ab385f1..e331318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT (libsolv) -CMAKE_MINIMUM_REQUIRED (VERSION 2.4) +CMAKE_MINIMUM_REQUIRED (VERSION 2.8.5) OPTION (ENABLE_STATIC "Build a static version of the libraries?" OFF) OPTION (DISABLE_SHARED "Do not build a shared version of the libraries?" OFF) @@ -38,35 +38,16 @@ OPTION (ENABLE_ZSTD_COMPRESSION "Build with zstd compression support?" OFF) OPTION (ENABLE_ZCHUNK_COMPRESSION "Build with zchunk compression support?" OFF) OPTION (WITH_SYSTEM_ZCHUNK "Use system zchunk library?" OFF) OPTION (WITH_LIBXML2 "Build with libxml2 instead of libexpat?" OFF) +OPTION (WITHOUT_COOKIEOPEN "Disable the use of stdio cookie opens?" OFF) -# Library -IF (DEFINED LIB) - SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}") -ELSE (DEFINED LIB) - IF (CMAKE_SIZEOF_VOID_P MATCHES "8") - SET (LIB_SUFFIX "64") - ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8") - SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -ENDIF (DEFINED LIB) -MESSAGE (STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}") -# Library -IF (DEFINED INCLUDE) - SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}") -else (DEFINED INCLUDE) - SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") -ENDIF (DEFINED INCLUDE) -MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}") -SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") -IF (NOT MAN_INSTALL_DIR) -SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man") -IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") - SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man") -ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") -ENDIF (NOT MAN_INSTALL_DIR) -MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}") +include (GNUInstallDirs) +message (STATUS "Libraries will be installed in ${CMAKE_INSTALL_FULL_LIBDIR}") +message (STATUS "Header files will be installed in ${CMAKE_INSTALL_FULL_INCLUDEDIR}") +message (STATUS "Binaries will be installed in ${CMAKE_INSTALL_FULL_BINDIR}") +message (STATUS "Man pages will be installed in ${CMAKE_INSTALL_FULL_MANDIR}") IF (NOT PKGCONFIG_INSTALL_DIR) - SET (PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig) + SET (PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ENDIF (NOT PKGCONFIG_INSTALL_DIR) #################################################################### # CONFIGURATION # @@ -287,7 +268,7 @@ ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2) # should create config.h with #cmakedefine instead... FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN - HAVE_RPM_DB_H HAVE_PGPDIGGETPARAMS WITH_LIBXML2 ) + HAVE_RPM_DB_H HAVE_PGPDIGGETPARAMS WITH_LIBXML2 WITHOUT_COOKIEOPEN) IF(${VAR}) ADD_DEFINITIONS (-D${VAR}=1) SET (SWIG_FLAGS ${SWIG_FLAGS} -D${VAR}) @@ -389,10 +370,15 @@ INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOU MESSAGE (STATUS "Looking for modules in ${CMAKE_MODULE_PATH}") -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3") -set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3") -set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0") +IF (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /wd4267") + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +ELSE () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3") + set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3") + set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0") +ENDIF () # set system libraries SET (SYSTEM_LIBRARIES "") |