Skip to content

Commit 3b8049d

Browse files
committed
Add getopt-win32 as dependecy for Windows build.
1 parent 525c553 commit 3b8049d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ image: Visual Studio 2017
77
configuration: Release
88
clone_folder: c:\projects\openscap
99
install:
10-
- cmd: vcpkg install curl libxml2 libxslt bzip2 pcre pthreads zlib
10+
- cmd: vcpkg install curl libxml2 libxslt bzip2 pcre pthreads zlib getopt-win32
1111
cache: c:\tools\vcpkg\installed\
1212
before_build:
1313
- cmd: >-

utils/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ if(ENABLE_OSCAP_UTIL)
1010
add_executable(oscap ${UTILS_SOURCES})
1111
target_link_libraries(oscap openscap)
1212
if(WIN32)
13+
find_path(GETOPT_INCLUDE_DIR getopt.h)
14+
include(SelectLibraryConfigurations)
15+
find_library(GETOPT_LIBRARY_RELEASE NAMES getopt)
16+
find_library(GETOPT_LIBRARY_DEBUG NAMES getopt PATH_SUFFIXES debug/lib)
17+
select_library_configurations(GETOPT)
18+
19+
message("GETOPT_INCLUDE_DIR: ${GETOPT_INCLUDE_DIR}")
20+
message("GETOPT_LIBRARY: ${GETOPT_LIBRARY}")
21+
22+
target_include_directories(oscap PRIVATE ${GETOPT_INCLUDE_DIR})
23+
target_link_libraries(oscap PRIVATE ${GETOPT_LIBRARY})
1324
set(OSCAP_UTIL_DESTINATION ".")
1425
# Install the 'oscap' utility
1526
install(TARGETS "oscap"

0 commit comments

Comments
 (0)