Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d2da574

Browse files
author
alex85k
committedOct 15, 2017
support building shared library (for vcpkg)
1 parent 9ad612d commit d2da574

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
 

‎CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
PROJECT(wingetopt)
22
cmake_minimum_required(VERSION 2.8)
33

4+
option(BUILD_SHARED_LIBS "Build the shared library" OFF)
5+
46
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
5-
add_library(wingetopt STATIC src/getopt.c src/getopt.h)
7+
8+
if(BUILD_SHARED_LIBS)
9+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
10+
endif()
11+
12+
add_library(wingetopt src/getopt.c src/getopt.h)
613

714
install(FILES src/getopt.h DESTINATION include)
8-
install(TARGETS wingetopt LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
15+
16+
install(TARGETS wingetopt
17+
RUNTIME DESTINATION bin
18+
LIBRARY DESTINATION lib
19+
ARCHIVE DESTINATION lib)
920

0 commit comments

Comments
 (0)
Failed to load comments.