2012-11-29 23:27:02 +00:00
|
|
|
# synergy -- mouse and keyboard sharing utility
|
2013-04-04 16:17:25 +00:00
|
|
|
# Copyright (C) 2013 Bolton Software Ltd.
|
2012-11-29 23:27:02 +00:00
|
|
|
#
|
|
|
|
# This package is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# found in the file COPYING that should have accompanied this file.
|
|
|
|
#
|
|
|
|
# This package is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-04-11 00:36:45 +00:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-11-29 23:27:02 +00:00
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2013-04-11 00:36:45 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-11-29 23:27:02 +00:00
|
|
|
|
2013-05-31 14:55:22 +00:00
|
|
|
set(cryptopp_dir cryptopp562)
|
2012-11-30 01:07:04 +00:00
|
|
|
|
2013-05-31 14:55:22 +00:00
|
|
|
# only compile the crypto++ files we need.
|
|
|
|
set(cryptopp_src
|
|
|
|
${cryptopp_dir}/3way.cpp
|
|
|
|
${cryptopp_dir}/algparam.cpp
|
|
|
|
${cryptopp_dir}/asn.cpp
|
|
|
|
${cryptopp_dir}/authenc.cpp
|
|
|
|
${cryptopp_dir}/basecode.cpp
|
|
|
|
${cryptopp_dir}/cpu.cpp
|
|
|
|
${cryptopp_dir}/cryptlib.cpp
|
2013-06-04 18:22:58 +00:00
|
|
|
${cryptopp_dir}/des.cpp
|
|
|
|
${cryptopp_dir}/dessp.cpp
|
2013-05-31 14:55:22 +00:00
|
|
|
${cryptopp_dir}/dll.cpp
|
|
|
|
${cryptopp_dir}/ec2n.cpp
|
|
|
|
${cryptopp_dir}/ecp.cpp
|
|
|
|
${cryptopp_dir}/filters.cpp
|
|
|
|
${cryptopp_dir}/fips140.cpp
|
|
|
|
${cryptopp_dir}/gcm.cpp
|
|
|
|
${cryptopp_dir}/gf2n.cpp
|
|
|
|
${cryptopp_dir}/gfpcrypt.cpp
|
|
|
|
${cryptopp_dir}/hex.cpp
|
|
|
|
${cryptopp_dir}/hmac.cpp
|
|
|
|
${cryptopp_dir}/hrtimer.cpp
|
|
|
|
${cryptopp_dir}/integer.cpp
|
|
|
|
${cryptopp_dir}/iterhash.cpp
|
|
|
|
${cryptopp_dir}/misc.cpp
|
|
|
|
${cryptopp_dir}/modes.cpp
|
|
|
|
${cryptopp_dir}/mqueue.cpp
|
|
|
|
${cryptopp_dir}/nbtheory.cpp
|
|
|
|
${cryptopp_dir}/oaep.cpp
|
|
|
|
${cryptopp_dir}/osrng.cpp
|
|
|
|
${cryptopp_dir}/pubkey.cpp
|
|
|
|
${cryptopp_dir}/queue.cpp
|
|
|
|
${cryptopp_dir}/randpool.cpp
|
|
|
|
${cryptopp_dir}/rdtables.cpp
|
|
|
|
${cryptopp_dir}/rijndael.cpp
|
|
|
|
${cryptopp_dir}/rng.cpp
|
|
|
|
${cryptopp_dir}/sha.cpp
|
|
|
|
)
|
2013-04-10 17:27:25 +00:00
|
|
|
|
2013-04-11 00:30:41 +00:00
|
|
|
# if 64-bit windows, compile asm file.
|
|
|
|
if (CMAKE_CL_64)
|
2013-05-31 14:55:22 +00:00
|
|
|
list(APPEND cryptopp_src ${cryptopp_dir}/x64dll.asm ${cryptopp_dir}/x64masm.asm)
|
2013-04-11 00:30:41 +00:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT $(IntDir)x64dll.obj
|
|
|
|
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64dll.obj /Zi
|
2013-05-31 14:55:22 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64dll.asm"
|
|
|
|
MAIN_DEPENDENCY ${cryptopp_dir}/x64dll.asm
|
2013-04-11 00:30:41 +00:00
|
|
|
VERBATIM)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT $(IntDir)x64masm.obj
|
|
|
|
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64masm.obj /Zi
|
2013-05-31 14:55:22 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64masm.asm"
|
|
|
|
MAIN_DEPENDENCY ${cryptopp_dir}/x64masm.asm
|
2013-04-11 00:30:41 +00:00
|
|
|
VERBATIM)
|
2013-04-05 00:01:54 +00:00
|
|
|
endif()
|
|
|
|
|
2013-04-11 02:41:56 +00:00
|
|
|
if (UNIX)
|
2013-04-11 03:18:40 +00:00
|
|
|
add_definitions(-DCRYPTOPP_DISABLE_ASM)
|
2013-04-11 02:41:56 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -pipe")
|
|
|
|
|
|
|
|
if (APPLE)
|
2013-04-11 03:18:40 +00:00
|
|
|
if (DARWIN_VERSION GREATER 10)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-compare")
|
|
|
|
endif()
|
2013-04-11 02:41:56 +00:00
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
|
|
|
endif()
|
2013-04-04 22:38:07 +00:00
|
|
|
endif()
|
|
|
|
|
2013-05-31 14:55:22 +00:00
|
|
|
add_library(cryptopp STATIC ${cryptopp_src})
|
2014-02-24 16:32:18 +00:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
# ignore warnings in crypto++
|
|
|
|
set_target_properties(cryptopp PROPERTIES COMPILE_FLAGS "-w")
|
|
|
|
endif()
|