Skip to content

Commit 2ca1381

Browse files
CMake: Add an option to turn on and off the install target
1 parent 181077d commit 2ca1381

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
cmake_minimum_required(VERSION 3.13.3)
88
project(thirdparty_sqlite)
99

10+
option(SQLITE_GENERATE_INSTALL_TARGET "When enabled, will cause the project to create the install targets" OFF)
11+
1012
function(sqliteMain)
1113
set(parameter_list
1214
"SQLITE_VERSION=3.29.0"
@@ -46,8 +48,10 @@ function(sqliteMain)
4648
"${CMAKE_CURRENT_SOURCE_DIR}/src"
4749
)
4850

49-
install(TARGETS thirdparty_sqlite DESTINATION lib)
50-
install(FILES src/sqlite3ext.h src/sqlite3.h DESTINATION include)
51+
if(SQLITE_GENERATE_INSTALL_TARGET)
52+
install(TARGETS thirdparty_sqlite DESTINATION lib)
53+
install(FILES src/sqlite3ext.h src/sqlite3.h DESTINATION include)
54+
endif()
5155
endfunction()
5256

5357
sqliteMain()

0 commit comments

Comments
 (0)