Commit fe40c605 authored by Ben Boeckel's avatar Ben Boeckel

bzip2: use a patch for the cmake file

parent 5ee59365
patches/*.patch whitespace=-blank-at-eol
......@@ -3,12 +3,5 @@ superbuild_add_project(bzip2
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS})
#-------------------------------------------------------
# bzip2 needs a fix for '--version-script' linker option. The option needs to be
# removed on Macs. The fix to CMakeLists.txt works for all OSs.
superbuild_project_add_step(bzip2-patch-CMakeLists.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_LIST_DIR}/patches/bzip2.CMakeLists.txt"
"<SOURCE_DIR>/CMakeLists.txt"
DEPENDEES update
DEPENDERS patch)
superbuild_apply_patch(bzip2 add-cmake
"Add a CMake build system to bzip2")
diff -Nr -U5 bzip2-1.0.6/CMakeLists.txt bzip2-1.0.6.cmake/CMakeLists.txt
--- bzip2-1.0.6/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500
+++ bzip2-1.0.6.cmake/CMakeLists.txt 2015-12-02 11:56:08.777042304 -0500
@@ -0,0 +1,63 @@
+cmake_minimum_required(VERSION 2.8.8)
+
+project(bzip2 C)
+
+if (CMAKE_C_COMPILER_ID MATCHES "GNU")
+ set(CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} -Wall -Winline -O2 -g")
+endif ()
+
+set(bz2_srcs
+ blocksort.c
+ huffman.c
+ crctable.c
+ randtable.c
+ compress.c
+ decompress.c
+ bzlib.c)
+if(WIN32)
+ list(APPEND bz2_srcs libbz2.def)
+endif()
+
+add_library(bz2
+ ${bz2_srcs})
+add_executable(bzip2
+ bzip2.c)
+target_link_libraries(bzip2
+ bz2)
+add_executable(bzip2recover
+ bzip2recover.c)
+target_link_libraries(bzip2recover
+ bz2)
+
+install(
+ TARGETS bzip2 bzip2recover bz2
+ ARCHIVE
+ DESTINATION "lib"
+ LIBRARY
+ DESTINATION "lib"
+ RUNTIME
+ DESTINATION "bin"
+ COMPONENT runtime)
+# TODO: Generator expressions aren't expanded in install()?
+#if (UNIX)
+# foreach (binname bunzip2 bzcat)
+# install(
+# FILES "$<TARGET_FILE:bzip2>"
+# DESTINATION "bin"
+# RENAME "${binname}"
+# COMPONENT runtime)
+# endforeach ()
+#endif ()
+foreach (scriptname bzdiff bzmore bzgrep)
+ install(
+ PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/${scriptname}"
+ DESTINATION "bin"
+ COMPONENT runtime)
+endforeach ()
+foreach (header bzlib.h)
+ install(
+ FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}"
+ DESTINATION "include"
+ COMPONENT development)
+endforeach ()
cmake_minimum_required(VERSION 2.8.8)
project(bzip2 C)
if (CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Winline -O2 -g")
endif ()
set(bz2_srcs
blocksort.c
huffman.c
crctable.c
randtable.c
compress.c
decompress.c
bzlib.c)
if(WIN32)
list(APPEND bz2_srcs libbz2.def)
endif()
add_library(bz2
${bz2_srcs})
add_executable(bzip2
bzip2.c)
target_link_libraries(bzip2
bz2)
add_executable(bzip2recover
bzip2recover.c)
target_link_libraries(bzip2recover
bz2)
install(
TARGETS bzip2 bzip2recover bz2
ARCHIVE
DESTINATION "lib"
LIBRARY
DESTINATION "lib"
RUNTIME
DESTINATION "bin"
COMPONENT runtime)
# TODO: Generator expressions aren't expanded in install()?
#if (UNIX)
# foreach (binname bunzip2 bzcat)
# install(
# FILES "$<TARGET_FILE:bzip2>"
# DESTINATION "bin"
# RENAME "${binname}"
# COMPONENT runtime)
# endforeach ()
#endif ()
foreach (scriptname bzdiff bzmore bzgrep)
install(
PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/${scriptname}"
DESTINATION "bin"
COMPONENT runtime)
endforeach ()
foreach (header bzlib.h)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}"
DESTINATION "include"
COMPONENT development)
endforeach ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment