Skip to content

Commit

Permalink
Merge pull request #1118 from guidefloripa/master
Browse files Browse the repository at this point in the history
Add static compilation on CMake
  • Loading branch information
hintjens committed Jul 2, 2014
2 parents 13ed711 + 9c42d28 commit e6b7c7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ else()
OUTPUT_NAME "zmq"
PUBLIC_HEADER "${public_headers}")
endif()
add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
set_target_properties(libzmq-static PROPERTIES
PUBLIC_HEADER "${public_headers}"
COMPILE_FLAGS "-DZMQ_STATIC"
OUTPUT_NAME "zmq-static")
endif()

target_link_libraries(libzmq ${SODIUM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
Expand Down Expand Up @@ -777,7 +782,7 @@ if(MSVC)
COMPONENT Runtime)
endif()
else()
install(TARGETS libzmq
install(TARGETS libzmq libzmq-static
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
Expand Down

0 comments on commit e6b7c7a

Please sign in to comment.