Skip to content

Commit a47e7fd

Browse files
committed
link to Boost Process on Windows
1 parent 499d586 commit a47e7fd

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

code/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ else ()
9292
message ( FATAL_ERROR "zlib was not found!" )
9393
endif (ZLIB_FOUND)
9494

95+
# find Boost
96+
# Need to link to Boost Process, but only on Windows.
97+
if (WIN32)
98+
if (ENABLE_STATIC_LINKING)
99+
set (Boost_USE_STATIC_LIBS ON)
100+
else ()
101+
set (Boost_USE_STATIC_LIBS OFF)
102+
endif ()
103+
find_package(Boost REQUIRED COMPONENTS process)
104+
if (Boost_FOUND)
105+
target_link_libraries(pmdb Boost::process)
106+
else ()
107+
message ( FATAL_ERROR "Boost was not found!" )
108+
endif ()
109+
endif (WIN32)
110+
95111
## get the default templates
96112
execute_process(
97113
COMMAND cat folder.tpl

program-no-compression/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ else ()
7979
message ( FATAL_ERROR "libxml2 was not found!" )
8080
endif (LIBXML2_FOUND)
8181

82+
# find Boost
83+
# Need to link to Boost Process, but only on Windows.
84+
if (WIN32)
85+
if (ENABLE_STATIC_LINKING)
86+
set (Boost_USE_STATIC_LIBS ON)
87+
else ()
88+
set (Boost_USE_STATIC_LIBS OFF)
89+
endif ()
90+
find_package(Boost REQUIRED COMPONENTS process)
91+
if (Boost_FOUND)
92+
target_link_libraries(pmdb_no_comp Boost::process)
93+
else ()
94+
message ( FATAL_ERROR "Boost was not found!" )
95+
endif ()
96+
endif (WIN32)
97+
8298
# get the default templates
8399
execute_process(
84100
COMMAND cat folder.tpl

0 commit comments

Comments
 (0)