Skip to content

Commit

Permalink
General cmake simplifications and some MacOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wdobbe committed Apr 8, 2020
1 parent 568e5ea commit 6768362
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ tests/testargs.log
tests/testargs.trs
tests/test-setup.sh
tests/listing.txt

#QtCreator project settings
CMakeLists.txt.user
2 changes: 1 addition & 1 deletion Modules/DocbookToManUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function(add_docs)
string(CONCAT targetfilename "${docfilename}" "." "${man_number}")
list(APPEND doc_targets ${targetfilename})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${targetfilename}
COMMAND ${DOCBOOK2MAN_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/${xmlfile}
COMMAND ${DocbookToMan_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/${xmlfile}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${xmlfile}
)

Expand Down
8 changes: 4 additions & 4 deletions Modules/FindDocbookToMan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

find_program(DOCBOOK2MAN_EXE
NAMES docbook-to-man docbook2x-man)
find_program(DocbookToMan_EXE
NAMES docbook-to-man docbook2x-man docbook2man)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DOCBOOK2MAN REQUIRED_VARS DOCBOOK2MAN_EXE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DocbookToMan REQUIRED_VARS DocbookToMan_EXE)

MARK_AS_ADVANCED(
DOCBOOK2MAN_EXE
DocbookToMan_EXE
)

#function(DOCBOOK_TO_MAN docbookFile)
Expand Down
22 changes: 15 additions & 7 deletions Modules/FindZstd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,26 @@
# ZSTD_LIBRARY
#

find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)
find_path(Zstd_INCLUDE_DIR NAMES zstd.h)

find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd_staticd)
find_library(ZSTD_LIBRARY_RELEASE NAMES zstd zstd_static)
find_library(Zstd_LIBRARY_DEBUG NAMES zstdd zstd_staticd)
find_library(Zstd_LIBRARY_RELEASE NAMES zstd zstd_static)

include(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(ZSTD)
SELECT_LIBRARY_CONFIGURATIONS(Zstd)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
ZSTD DEFAULT_MSG
ZSTD_LIBRARY ZSTD_INCLUDE_DIR
Zstd DEFAULT_MSG
Zstd_LIBRARY Zstd_INCLUDE_DIR
)
if (Zstd_FOUND)
if (NOT TARGET Zstd::Zstd)
add_library(Zstd::Zstd UNKNOWN IMPORTED)
set_target_properties(Zstd::Zstd PROPERTIES
IMPORTED_LOCATION "${Zstd_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${Zstd_INCLUDE_DIR}")
endif ()
endif()

mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY_DEBUG ZSTD_LIBRARY_RELEASE)
mark_as_advanced(Zstd_INCLUDE_DIR Zstd_LIBRARY_DEBUG Zstd_LIBRARY_RELEASE)
6 changes: 1 addition & 5 deletions daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ add_executable(iceccd
target_link_libraries(iceccd
icecc
LibArchive::LibArchive
$<$<BOOL:${Libcap-ng_FOUND}>:Libcap-ng::Libcap-ng>
)

if(Libcap-ng_FOUND)
target_link_libraries(iceccd
Libcap-ng::Libcap-ng)
endif()

install(TARGETS iceccd
RUNTIME DESTINATION sbin
)
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

if (DOCBOOK2MAN_FOUND)
if (DocbookToMan_FOUND)
include(${CMAKE_SOURCE_DIR}/Modules/DocbookToManUtils.cmake)

set(man_xmls
Expand Down
2 changes: 1 addition & 1 deletion services/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_library(icecc STATIC
target_link_libraries(icecc
PRIVATE
LZO::lzo
${ZSTD_LIBRARY}
Zstd::Zstd
dl)

if(Libcap-ng_FOUND)
Expand Down

0 comments on commit 6768362

Please sign in to comment.