Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
10edb593
Unverified
Commit
10edb593
authored
Sep 10, 2018
by
Constantin Rack
Committed by
GitHub
Sep 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3246 from schulzch/cmake-fixes
CMake cleanup
parents
9c0bff2c
a21228b6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
33 deletions
+32
-33
CMakeLists.txt
CMakeLists.txt
+0
-0
CMakeLists.txt
tests/CMakeLists.txt
+28
-29
CMakeLists.txt
unittests/CMakeLists.txt
+4
-4
No files found.
CMakeLists.txt
View file @
10edb593
This diff is collapsed.
Click to expand it.
tests/CMakeLists.txt
View file @
10edb593
...
...
@@ -2,7 +2,7 @@
cmake_minimum_required
(
VERSION
"2.8.1"
)
# On Windows: solution file will be called tests.sln
PROJECT
(
tests
)
project
(
tests
)
set
(
tests
test_ancillaries
...
...
@@ -73,10 +73,12 @@ set(tests
test_reconnect_ivl
test_mock_pub_sub
)
if
(
ZMQ_HAVE_CURVE
)
list
(
APPEND tests
test_security_curve
)
endif
()
if
(
NOT WIN32
)
list
(
APPEND tests
test_ipc_wildcard
...
...
@@ -123,8 +125,7 @@ if(WITH_VMCI)
)
endif
()
IF
(
ENABLE_DRAFTS
)
if
(
ENABLE_DRAFTS
)
list
(
APPEND tests
test_poller
test_thread_safe
...
...
@@ -136,7 +137,7 @@ IF (ENABLE_DRAFTS)
test_app_meta
test_router_notify
)
ENDIF
(
ENABLE_DRAFTS
)
endif
(
)
# add location of platform.hpp for Windows builds
if
(
WIN32
)
...
...
@@ -146,64 +147,62 @@ if(WIN32)
link_libraries
(
ws2_32.lib
)
endif
()
add_library
(
unity
STATIC
add_library
(
unity STATIC
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity.c"
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity_internals.h"
)
set_target_properties
(
unity PROPERTIES
set_target_properties
(
unity PROPERTIES
PUBLIC_HEADER
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity.h"
)
target_compile_definitions
(
unity PUBLIC
"UNITY_USE_COMMAND_LINE_ARGS"
"UNITY_EXCLUDE_FLOAT"
)
target_include_directories
(
unity PUBLIC
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity"
)
target_compile_definitions
(
unity PUBLIC
"UNITY_USE_COMMAND_LINE_ARGS"
"UNITY_EXCLUDE_FLOAT"
)
target_include_directories
(
unity PUBLIC
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity"
)
IF
(
MSVC_VERSION LESS 1700
)
SET_SOURCE_FILES_PROPERTIES
(
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity.c"
PROPERTIES LANGUAGE CXX
)
ENDIF
()
if
(
MSVC_VERSION LESS 1700
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_LIST_DIR
}
/../external/unity/unity.c"
PROPERTIES LANGUAGE CXX
)
endif
()
IF
(
MSVC_VERSION LESS 1600
)
target_compile_definitions
(
unity PUBLIC
"UNITY_EXCLUDE_STDINT_H"
)
ENDIF
()
if
(
MSVC_VERSION LESS 1600
)
target_compile_definitions
(
unity PUBLIC
"UNITY_EXCLUDE_STDINT_H"
)
endif
()
# add library and include dirs for all targets
if
(
BUILD_SHARED
)
link_libraries
(
libzmq
${
OPTIONAL_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
unity
)
else
()
link_libraries
(
libzmq-static
${
OPTIONAL_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
unity
)
endif
()
if
(
BUILD_SHARED
)
link_libraries
(
libzmq
${
OPTIONAL_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
unity
)
else
()
link_libraries
(
libzmq-static
${
OPTIONAL_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
unity
)
endif
()
include_directories
(
"
${
ZeroMQ_SOURCE_DIR
}
/../include"
"
${
ZeroMQ_BINARY_DIR
}
"
)
foreach
(
test
${
tests
}
)
# target_sources not supported before CMake 3.1
if
(
ZMQ_HAVE_CURVE AND
${
test
}
MATCHES test_security_curve
)
if
(
ZMQ_HAVE_CURVE AND
${
test
}
MATCHES test_security_curve
)
add_executable
(
${
test
}
${
test
}
.cpp
"../src/tweetnacl.c"
"../src/err.cpp"
"../src/random.cpp"
"../src/clock.cpp"
"testutil_security.hpp"
)
elseif
(
${
test
}
MATCHES test_security_zap
)
elseif
(
${
test
}
MATCHES test_security_zap
)
add_executable
(
${
test
}
${
test
}
.cpp
"testutil_security.hpp"
)
else
()
else
()
add_executable
(
${
test
}
${
test
}
.cpp
"testutil.hpp"
"testutil_unity.hpp"
)
endif
()
endif
()
if
(
WIN32
)
# This is the output for Debug dynamic builds on Visual Studio 6.0
# You should provide the correct directory, don't know how to do it automatically
find_path
(
LIBZMQ_PATH
"libzmq.lib"
PATHS
"../bin/Win32/Debug/v120/dynamic"
)
if
(
NOT
${
LIBZMQ_PATH
}
STREQUAL
"LIBZMQ_PATH-NOTFOUND"
)
SET_TARGET_PROPERTIES
(
${
test
}
PROPERTIES LINK_FLAGS
"/LIBPATH:
${
LIBZMQ_PATH
}
"
)
set_target_properties
(
${
test
}
PROPERTIES LINK_FLAGS
"/LIBPATH:
${
LIBZMQ_PATH
}
"
)
endif
()
else
()
# per-test directories not generated on OS X / Darwin
if
(
NOT
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang.*"
)
if
(
NOT
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang.*"
)
link_directories
(
${
test
}
PRIVATE
"
${
ZeroMQ_SOURCE_DIR
}
/../lib"
)
endif
()
endif
()
if
(
RT_LIBRARY
)
target_link_libraries
(
${
test
}
${
RT_LIBRARY
}
)
target_link_libraries
(
${
test
}
${
RT_LIBRARY
}
)
endif
()
if
(
WIN32
)
add_test
(
NAME
${
test
}
WORKING_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
COMMAND
${
test
}
)
...
...
@@ -242,7 +241,7 @@ file(GLOB ALL_TEST_SOURCES "test_*.cpp")
foreach
(
TEST_SOURCE
${
ALL_TEST_SOURCES
}
)
get_filename_component
(
TESTNAME
"
${
TEST_SOURCE
}
"
NAME_WE
)
string
(
REGEX MATCH
"
${
TESTNAME
}
"
MATCH_TESTNAME
"
${
CURRENT_LIST_FILE_CONTENT
}
"
)
if
(
NOT MATCH_TESTNAME
)
if
(
NOT MATCH_TESTNAME
)
message
(
AUTHOR_WARNING
"Test '
${
TESTNAME
}
' is not known to CTest."
)
endif
()
endforeach
()
unittests/CMakeLists.txt
View file @
10edb593
...
...
@@ -9,10 +9,10 @@ set(unittests
unittest_udp_address
)
#
IF
(ENABLE_DRAFTS)
#
if
(ENABLE_DRAFTS)
# list(APPEND tests
# )
#
ENDIF
(ENABLE_DRAFTS)
#
endif
(ENABLE_DRAFTS)
# add location of platform.hpp for Windows builds
if
(
WIN32
)
...
...
@@ -30,7 +30,7 @@ foreach(test ${unittests})
add_executable
(
${
test
}
${
test
}
.cpp
"unittest_resolver_common.hpp"
)
# per-test directories not generated on OS X / Darwin
if
(
NOT
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang.*"
)
if
(
NOT
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang.*"
)
link_directories
(
${
test
}
PRIVATE
"
${
ZeroMQ_SOURCE_DIR
}
/../lib"
)
endif
()
...
...
@@ -61,7 +61,7 @@ file(GLOB ALL_TEST_SOURCES "test_*.cpp")
foreach
(
TEST_SOURCE
${
ALL_TEST_SOURCES
}
)
get_filename_component
(
TESTNAME
"
${
TEST_SOURCE
}
"
NAME_WE
)
string
(
REGEX MATCH
"
${
TESTNAME
}
"
MATCH_TESTNAME
"
${
CURRENT_LIST_FILE_CONTENT
}
"
)
if
(
NOT MATCH_TESTNAME
)
if
(
NOT MATCH_TESTNAME
)
message
(
AUTHOR_WARNING
"Test '
${
TESTNAME
}
' is not known to CTest."
)
endif
()
endforeach
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment