Skip to content

Commit

Permalink
CMake build fixes
Browse files Browse the repository at this point in the history
- Include directories publicly
- Don't modify git tree
- Dropped autotools support
  • Loading branch information
LizzyFleckenstein03 committed Apr 25, 2022
1 parent 21767c6 commit 4b4fbf4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 551 deletions.
15 changes: 15 additions & 0 deletions .gitignore
@@ -1,3 +1,16 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
*.a

*.diff
*.patch
*.orig
Expand All @@ -24,3 +37,5 @@
/configure.log

.DS_Store

zconf.h
21 changes: 9 additions & 12 deletions CMakeLists.txt
Expand Up @@ -66,18 +66,6 @@ if(MSVC)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()

if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(STATUS "Renaming")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
message(STATUS "but CMake generates it automatically in the build directory.")
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif()
endif()

set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
Expand Down Expand Up @@ -188,6 +176,15 @@ add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZL
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)

target_include_directories(zlib
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
)
target_include_directories(zlibstatic
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
)

if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
Expand Down
5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

0 comments on commit 4b4fbf4

Please sign in to comment.