From 3921fc3012f91efedc36961ce7f15700af47aa7d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 26 Feb 2018 15:01:29 -0800 Subject: [PATCH] [chmlib] Use CMake buildsystem replacement --- ports/chmlib/CMakeLists.txt | 23 +++ ports/chmlib/CONTROL | 4 +- ports/chmlib/chm.vcxproj | 211 ---------------------------- ports/chmlib/enum_chmLib.vcxproj | 109 -------------- ports/chmlib/enumdir_chmLib.vcxproj | 100 ------------- ports/chmlib/extract_chmLib.vcxproj | 100 ------------- ports/chmlib/portfile.cmake | 54 ++----- 7 files changed, 36 insertions(+), 565 deletions(-) create mode 100644 ports/chmlib/CMakeLists.txt delete mode 100644 ports/chmlib/chm.vcxproj delete mode 100644 ports/chmlib/enum_chmLib.vcxproj delete mode 100644 ports/chmlib/enumdir_chmLib.vcxproj delete mode 100644 ports/chmlib/extract_chmLib.vcxproj diff --git a/ports/chmlib/CMakeLists.txt b/ports/chmlib/CMakeLists.txt new file mode 100644 index 0000000000..49ce1f129f --- /dev/null +++ b/ports/chmlib/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.5) +project(chm C) + +add_library(chm src/lzx.c src/chm_lib.c) + +if(BUILD_TOOLS) + link_libraries(chm) + add_executable(enum_chmLib src/enum_chmLib.c) + add_executable(enumdir_chmLib src/enumdir_chmLib.c) + add_executable(extract_chmLib src/extract_chmLib.c) + + install(TARGETS enum_chmLib extract_chmLib enumdir_chmLib + RUNTIME DESTINATION tools/chmlib + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() + +install(TARGETS chm + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/ports/chmlib/CONTROL b/ports/chmlib/CONTROL index 226a3be92b..b7f0cc863b 100644 --- a/ports/chmlib/CONTROL +++ b/ports/chmlib/CONTROL @@ -1,3 +1,3 @@ Source: chmlib -Version: 0.40-1 -Description: CHMLIB is a library for dealing with Microsoft ITSS/CHM format files. Right now, it is a very simple library, but sufficient for dealing with all of the .chm files I've come across. Due to the fairly well-designed indexing built into this particular file format, even a small library is able to gain reasonably good performance indexing into ITSS archives. \ No newline at end of file +Version: 0.40-2 +Description: CHMLIB is a library for dealing with Microsoft ITSS/CHM format files. Right now, it is a very simple library, but sufficient for dealing with all of the .chm files I've come across. Due to the fairly well-designed indexing built into this particular file format, even a small library is able to gain reasonably good performance indexing into ITSS archives. diff --git a/ports/chmlib/chm.vcxproj b/ports/chmlib/chm.vcxproj deleted file mode 100644 index 0cc2606fec..0000000000 --- a/ports/chmlib/chm.vcxproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {3bafee52-fe1a-494e-ab46-89bf77ed63a7} - chmLibExe1 - chm - 10.0.14393.0 - - - - StaticLibrary - true - v141 - - - StaticLibrary - false - v141 - true - - - StaticLibrary - true - v141 - - - StaticLibrary - false - v141 - true - - - - - - - - - - - - - - - - - - - - - - ..\..\..\x86-windows-static-dbg\ - ..\..\..\x86-windows-static-dbg\$(ProjectName)\ - - - - ..\..\..\x86-windows-static-rel\ - ..\..\..\x86-windows-static-rel\$(ProjectName)\ - - - - ..\..\..\x64-windows-static-dbg\ - ..\..\..\x64-windows-static-dbg\$(ProjectName)\ - - - - ..\..\..\x64-windows-static-rel\ - ..\..\..\x64-windows-static-rel\$(ProjectName)\ - - - - Disabled - true - false - WIN32;CHM_MT;CHM_DEBUG;_CRT_SECURE_NO_WARNINGS - 4018;4057;4127;4189;4244;4267;4295;4324;4458;4477;4701;4706;4800;4996;%(DisableSpecificWarnings) - MultiThreadedDebug - true - CompileAsC - OldStyle - false - true - - - - - Console - LinkVerbose - libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib - - - true - MachineX86 - Windows - true - libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib - true - - - - - Disabled - true - false - WIN32;CHM_MT;CHM_DEBUG;_CRT_SECURE_NO_WARNINGS - 4018;4057;4127;4189;4244;4267;4295;4324;4458;4477;4701;4706;4800;4996;%(DisableSpecificWarnings) - MultiThreadedDebug - true - CompileAsC - OldStyle - false - true - - - - - Console - LinkVerbose - libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib - - - Windows - true - libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib - true - - - - - true - true - true - false - CHM_MT;WIN32;_CRT_SECURE_NO_WARNINGS - 4018;4057;4127;4189;4244;4267;4295;4324;4458;4477;4701;4706;4800;4996;%(DisableSpecificWarnings) - MultiThreaded - CompileAsC - Full - - - true - true - - - Console - LinkVerbose - - - MachineX86 - Windows - true - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - true - true - true - false - CHM_MT;WIN32;_CRT_SECURE_NO_WARNINGS - 4018;4057;4127;4189;4244;4267;4295;4324;4458;4477;4701;4706;4800;4996;%(DisableSpecificWarnings) - MultiThreaded - CompileAsC - Full - - - true - true - - - Console - LinkVerbose - - - Windows - true - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ports/chmlib/enum_chmLib.vcxproj b/ports/chmlib/enum_chmLib.vcxproj deleted file mode 100644 index 1b847a409b..0000000000 --- a/ports/chmlib/enum_chmLib.vcxproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Release - Win32 - - - Release - x64 - - - - - - - 15.0 - {2c833145-059b-47d5-b0fe-b3ac6ff1ccb0} - enum_chmLib - 10.0.14393.0 - - - - Application - true - v141 - - - Application - false - v141 - true - MultiByte - - - Application - true - v141 - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - ..\..\..\x86-windows-static-rel\ - ..\..\..\x86-windows-static-rel\$(ProjectName)\ - - - ..\..\..\x64-windows-static-rel\ - ..\..\..\x64-windows-static-rel\$(ProjectName)\ - - - - MaxSpeed - true - true - true - false - WIN32;_UNICODE;UNICODE;_CRT_SECURE_NO_WARNINGS - true - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - true - true - true - false - WIN32;_UNICODE;UNICODE;_CRT_SECURE_NO_WARNINGS - true - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - - \ No newline at end of file diff --git a/ports/chmlib/enumdir_chmLib.vcxproj b/ports/chmlib/enumdir_chmLib.vcxproj deleted file mode 100644 index 8b7d552c53..0000000000 --- a/ports/chmlib/enumdir_chmLib.vcxproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Release - Win32 - - - Release - x64 - - - - - - - 15.0 - {bb0bfe9a-7d13-44a0-b2b5-3b69a07a77e8} - enumdir_chmLib - 10.0.14393.0 - - - - Application - false - v141 - true - MultiByte - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - ..\..\..\x86-windows-static-rel\ - ..\..\..\x86-windows-static-rel\$(ProjectName)\ - - - ..\..\..\x64-windows-static-rel\ - ..\..\..\x64-windows-static-rel\$(ProjectName)\ - - - - Level3 - MaxSpeed - true - true - true - false - WIN32;_CRT_SECURE_NO_WARNINGS - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - Level3 - MaxSpeed - true - true - true - false - WIN32;_CRT_SECURE_NO_WARNINGS - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - - \ No newline at end of file diff --git a/ports/chmlib/extract_chmLib.vcxproj b/ports/chmlib/extract_chmLib.vcxproj deleted file mode 100644 index a4666ed64e..0000000000 --- a/ports/chmlib/extract_chmLib.vcxproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Release - Win32 - - - Release - x64 - - - - 15.0 - {8F41248C-8E62-4822-9A85-4CAF00AACEEE} - extract_chmLib - 10.0.14393.0 - - - - Application - false - v141 - true - MultiByte - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - ..\..\..\x86-windows-static-rel\ - ..\..\..\x86-windows-static-rel\$(ProjectName)\ - - - ..\..\..\x64-windows-static-rel\ - ..\..\..\x64-windows-static-rel\$(ProjectName)\ - - - - Level3 - MaxSpeed - true - true - true - false - WIN32;_CRT_SECURE_NO_WARNINGS - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - Level3 - MaxSpeed - true - true - true - false - WIN32;_CRT_SECURE_NO_WARNINGS - MultiThreaded - - - true - true - $(OutputPath)chm.lib - Console - LinkVerbose - libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib - - - - - - - - - \ No newline at end of file diff --git a/ports/chmlib/portfile.cmake b/ports/chmlib/portfile.cmake index 60381bb1a1..e6a935b9fa 100644 --- a/ports/chmlib/portfile.cmake +++ b/ports/chmlib/portfile.cmake @@ -6,7 +6,7 @@ endif() set(CHMLIB_VERSION chmlib-0.40) set(CHMLIB_FILENAME ${CHMLIB_VERSION}.zip) set(CHMLIB_URL http://www.jedrea.com/chmlib/${CHMLIB_FILENAME}) -set(CHMLIB_SRC ${CURRENT_BUILDTREES_DIR}/src/${CHMLIB_VERSION}/src) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${CHMLIB_VERSION}) include(vcpkg_common_functions) vcpkg_download_distfile( @@ -17,50 +17,18 @@ vcpkg_download_distfile( ) vcpkg_extract_source_archive(${ARCHIVE}) -file(GLOB VCXPROJS "${VCPKG_ROOT_DIR}/ports/${PORT}/*.vcxproj") -file(COPY ${VCXPROJS} DESTINATION ${CHMLIB_SRC}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -vcpkg_build_msbuild( - PROJECT_PATH ${CHMLIB_SRC}/chm.vcxproj - RELEASE_CONFIGURATION Release - DEBUG_CONFIGURATION Debug - TARGET Build - OPTIONS /v:diagnostic +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_RELEASE -DBUILD_TOOLS=ON + OPTIONS_DEBUG -DBUILD_TOOLS=OFF ) -#enum_chmLib RELEASE only -vcpkg_build_msbuild( - PROJECT_PATH ${CHMLIB_SRC}/enum_chmLib.vcxproj - RELEASE_CONFIGURATION Release - DEBUG_CONFIGURATION Release - TARGET Build - OPTIONS /v:diagnostic -) +vcpkg_install_cmake() -#enumdir_chmLib RELEASE only -vcpkg_build_msbuild( - PROJECT_PATH ${CHMLIB_SRC}/enumdir_chmLib.vcxproj - RELEASE_CONFIGURATION Release - DEBUG_CONFIGURATION Release - TARGET Build - OPTIONS /v:diagnostic -) +file(INSTALL ${SOURCE_PATH}/src/chm_lib.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -#extract_chmLib RELEASE only -vcpkg_build_msbuild( - PROJECT_PATH ${CHMLIB_SRC}/extract_chmLib.vcxproj - RELEASE_CONFIGURATION Release - DEBUG_CONFIGURATION Release - TARGET Build - OPTIONS /v:diagnostic -) - -file(INSTALL ${CHMLIB_SRC}/chm_lib.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${VCPKG_TARGET_ARCHITECTURE}-windows-static-rel/chm.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${VCPKG_TARGET_ARCHITECTURE}-windows-static-dbg/chm.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${VCPKG_TARGET_ARCHITECTURE}-windows-static-rel/enum_chmLib.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${VCPKG_TARGET_ARCHITECTURE}-windows-static-rel/enumdir_chmLib.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/${VCPKG_TARGET_ARCHITECTURE}-windows-static-rel/extract_chmLib.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) - -file(COPY ${CURRENT_BUILDTREES_DIR}/src/chmlib-0.40/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/chmlib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/chmlib/COPYING ${CURRENT_PACKAGES_DIR}/share/chmlib/copyright) \ No newline at end of file +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/chmlib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/chmlib/COPYING ${CURRENT_PACKAGES_DIR}/share/chmlib/copyright)