Skip to content

Commit

Permalink
Merge pull request eLvErDe#17 from flv0/cmake-cleanup
Browse files Browse the repository at this point in the history
Cmake cleanup
  • Loading branch information
eLvErDe committed Mar 15, 2016
2 parents 4d8f291 + b6c6d5c commit bb859de
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 732 deletions.
326 changes: 142 additions & 184 deletions CMakeLists.txt

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Mucipher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
project(Mucipher CXX)
set(MUCIPHER_SOURCES
aes.cpp
hexdigest.cpp
md5.cpp
sha.cpp
sha256.cpp
)
aes.cpp
hexdigest.cpp
md5.cpp
sha.cpp
sha256.cpp
)
add_library(Mucipher STATIC ${MUCIPHER_SOURCES})

if (PYMUCIPHER)
add_subdirectory(PyMucipher)
else (PYMUCIPHER)
MESSAGE("!!! PyMucipher will NOT be installed.. [NO_PYMUCIPHER=0]")
endif (PYMUCIPHER)
if(PYMUCIPHER)
add_subdirectory(PyMucipher)
else()
message("!!! PyMucipher will NOT be installed.")
endif()

46 changes: 20 additions & 26 deletions Mucipher/PyMucipher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,42 @@
# perl tcl ruby php4 pike
project(PyMucipher)

IF(PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
ELSE(PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr")
ENDIF(PREFIX)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)

FIND_PACKAGE(SWIG REQUIRED)
find_package(SWIG REQUIRED)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

INCLUDE(${SWIG_USE_FILE})
include(${SWIG_USE_FILE})

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_PATH})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

SET(CMAKE_SWIG_FLAGS "")
set(CMAKE_SWIG_FLAGS "")

SET_SOURCE_FILES_PROPERTIES(mucipherc.py GENERATED)
SET_SOURCE_FILES_PROPERTIES(mucipher.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(mucipher.i PROPERTIES SWIG_FLAGS "-includeall")
set_source_files_properties(mucipherc.py GENERATED)
set_source_files_properties(mucipher.i PROPERTIES CPLUSPLUS ON)
set_source_files_properties(mucipher.i PROPERTIES SWIG_FLAGS "-includeall")
SWIG_ADD_MODULE(mucipherc python ${Mucipher_SOURCE_DIR}/aes.cpp ${Mucipher_SOURCE_DIR}/hexdigest.cpp ${Mucipher_SOURCE_DIR}/md5.cpp ${Mucipher_SOURCE_DIR}/sha.cpp ${Mucipher_SOURCE_DIR}/sha256.cpp ${Mucipher_SOURCE_DIR}/wraphelp.cpp mucipher.i )
SWIG_LINK_LIBRARIES(mucipherc ${PYTHON_LIBRARIES})

set(PYMUCIPHER_LIBS
mucipher.py
${CMAKE_CURRENT_BINARY_DIR}/mucipherc.py
${CMAKE_CURRENT_BINARY_DIR}/_mucipherc.so
)
mucipher.py
${CMAKE_CURRENT_BINARY_DIR}/mucipherc.py
${CMAKE_CURRENT_BINARY_DIR}/_mucipherc.so
)
EXECUTE_PROCESS(COMMAND python ${CMAKE_SOURCE_DIR}/cmake/get_python_lib.py museek OUTPUT_VARIABLE sitepackages OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE error)

if (NOT sitepackages OR error)
MESSAGE(FATAL_ERROR "Failed to find Python's site-packages directory" ${sitepackages} ${error})
endif (NOT sitepackages OR error)
if(NOT sitepackages OR error)
message(FATAL_ERROR "Failed to find Python's site-packages directory" ${sitepackages} ${error})
endif()

install(
FILES ${PYMUCIPHER_LIBS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}
)
MESSAGE("--> PyMucipher will be installed.. [NO_PYMUCIPHER=1]")
FILES ${PYMUCIPHER_LIBS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}
)
message("--> PyMucipher will be installed.")
25 changes: 12 additions & 13 deletions Muhelp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
project(Muhelp CXX)

INCLUDE(FindPkgConfig REQUIRED)
include(FindPkgConfig REQUIRED)

pkg_search_module(LIBXMLPP REQUIRED "libxml++-2.6")

ADD_DEFINITIONS(${LIBXMLPP_CFLAGS})

add_definitions(${LIBXMLPP_CFLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BUILD_DIR})
include_directories(${CMAKE_CURRENT_BUILD_DIR})

set(MUHELP_SOURCES
Codec.cc
DirEntry.cc
Muconf.cc
)
Codec.cc
DirEntry.cc
Muconf.cc
)

add_library(Muhelp STATIC ${MUHELP_SOURCES})

# Link the Muhelp library to some libraries.
target_link_libraries(
Muhelp
NewNet
${LIBXML2_LIBRARIES}
${LIBXMLPP_LIBRARIES}
)
Muhelp
NewNet
${LIBXML2_LIBRARIES}
${LIBXMLPP_LIBRARIES}
)
46 changes: 23 additions & 23 deletions NewNet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ project(NewNet CXX)
find_package(Event REQUIRED)
include_directories(${Event_INCLUDE_DIRS})

if (Event_LIBRARIES AND EVENT_FOUND)
if(Event_LIBRARIES AND EVENT_FOUND)
set(NEWNET_SOURCES
nnbuffer.cpp
nnclientsocket.cpp
nnlog.cpp
nnpath.cpp
nnratelimiter.cpp
nntcpserversocket.cpp
nnreactor.cpp
nnserversocket.cpp
nntcpclientsocket.cpp
)
nnbuffer.cpp
nnclientsocket.cpp
nnlog.cpp
nnpath.cpp
nnratelimiter.cpp
nntcpserversocket.cpp
nnreactor.cpp
nnserversocket.cpp
nntcpclientsocket.cpp
)

if(UNIX)
set(NEWNET_SOURCES
${NEWNET_SOURCES}
nnunixclientsocket.cpp
nnunixserversocket.cpp
)
endif(UNIX)
set(NEWNET_SOURCES
${NEWNET_SOURCES}
nnunixclientsocket.cpp
nnunixserversocket.cpp
)
endif()

add_library(NewNet STATIC ${NEWNET_SOURCES})

# Link the newnet binary to some libraries.
target_link_libraries(
NewNet
${Event_LIBRARIES}
)
else(Event_LIBRARIES AND EVENT_FOUND)
MESSAGE("!!! NewNet will NOT be installed..")
endif(Event_LIBRARIES AND EVENT_FOUND)
NewNet
${Event_LIBRARIES}
)
else()
message("!!! NewNet will NOT be installed.")
endif()
64 changes: 28 additions & 36 deletions mucous/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,50 @@
project(Mucous)


IF(PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
ELSE(PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr")
ENDIF(PREFIX)


if (NOT MANDIR)
set(MANUAL_DIRECTORY "man/man1")
else (NOT MANDIR)
set(MANUAL_DIRECTORY ${MANDIR}/man1)
endif (NOT MANDIR)

# add_subdirectory(pymucous)
set(MUCOUS_SOURCES
mucous
)

mucous
)

project(Pymucous)

file(GLOB_RECURSE PYMUCOUS_FILES pymucous/*.py)

set(PYMUCOUS_SOURCES
${PYMUCOUS_FILES}
)
${PYMUCOUS_FILES}
)

EXECUTE_PROCESS(COMMAND python ${CMAKE_SOURCE_DIR}/cmake/get_python_lib.py museek OUTPUT_VARIABLE sitepackages OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE error)
execute_process(COMMAND python
${CMAKE_SOURCE_DIR}/cmake/get_python_lib.py museek
OUTPUT_VARIABLE sitepackages
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE error)

if (NOT sitepackages OR error)
MESSAGE(FATAL_ERROR "Failed to find Python's site-packages directory" ${sitepackages} ${error})
endif (NOT sitepackages OR error)
if(NOT sitepackages OR error)
message(FATAL_ERROR
"Failed to find Python's site-packages directory"
${sitepackages} ${error})
endif()

install(
FILES ${PYMUCOUS_SOURCES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}/pymucous
)
FILES ${PYMUCOUS_SOURCES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}/pymucous
)


# Install the muscan binary to the 'bin' directory.
install(
FILES ${MUCOUS_SOURCES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
FILES ${MUCOUS_SOURCES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)

set(MANPAGES
mucous.1
)
mucous.1
)

install(
FILES ${MANPAGES}
DESTINATION ${MANUAL_DIRECTORY}
)
MESSAGE("--> Mucous will be installed..")
FILES ${MANPAGES}
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
)
message("--> Mucous will be installed.")
79 changes: 33 additions & 46 deletions murmur/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,73 +1,60 @@
project(Murmur)

IF(PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
ELSE(PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr")
ENDIF(PREFIX)


if (NOT MANDIR)
set(MANUAL_DIRECTORY "man/man1")
else (NOT MANDIR)
set(MANUAL_DIRECTORY ${MANDIR}/man1)
endif (NOT MANDIR)

set(MURMUR_SOURCES
murmur
)
murmur
)

project(Pymurmur)

file(GLOB_RECURSE PYMURMUR_FILES pymurmur/*.py)

set(PYMURMUR_SOURCES
${PYMURMUR_FILES}
)
${PYMURMUR_FILES}
)

EXECUTE_PROCESS(COMMAND python ${CMAKE_SOURCE_DIR}/cmake/get_python_lib.py museek OUTPUT_VARIABLE sitepackages OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE error)

if (NOT sitepackages OR error)
MESSAGE(FATAL_ERROR "Failed to find Python's site-packages directory" ${sitepackages} ${error})
endif (NOT sitepackages OR error)
if(NOT sitepackages OR error)
message(FATAL_ERROR "Failed to find Python's site-packages directory" ${sitepackages} ${error})
endif()

install(
FILES ${PYMURMUR_SOURCES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}/pymurmur
)
FILES ${PYMURMUR_SOURCES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${sitepackages}/pymurmur
)


# Install the murmur binary to the 'bin' directory.
install(
FILES ${MURMUR_SOURCES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
FILES ${MURMUR_SOURCES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
set(MANPAGES
murmur.1
)
murmur.1
)

install(
FILES ${MANPAGES}
DESTINATION ${MANUAL_DIRECTORY}
)
FILES ${MANPAGES}
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
)
set(ICONS
images/murmur-96px.png
images/murmur-64px.png
images/murmur-32px.png
images/murmur-16px.png
)
images/murmur-96px.png
images/murmur-64px.png
images/murmur-32px.png
images/murmur-16px.png
)

install(
FILES ${ICONS}
DESTINATION "share/pixmaps"
)
FILES ${ICONS}
DESTINATION "share/pixmaps"
)
set(DESKTOP
files/murmur.desktop
)
files/murmur.desktop
)

install(
FILES ${DESKTOP}
DESTINATION "share/applications"
)
MESSAGE("--> Murmur will be installed..")
FILES ${DESKTOP}
DESTINATION "share/applications"
)
message("--> Murmur will be installed.")
Loading

0 comments on commit bb859de

Please sign in to comment.