-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build both C and C++ libraries every time
- Loading branch information
1 parent
786f926
commit 332dc26
Showing
2 changed files
with
16 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(QR-Code-Generator) | ||
|
||
include(src/files.cmake) | ||
|
||
IF (COMPILE_AS_C) | ||
set(SRC ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.c) | ||
set(CMAKE_C_STANDARD 99) | ||
set(LIBRARY_NAME qrcodegenc) | ||
set(HEADERS ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.h) | ||
set(INCLUDE_DIR qrcodegenc) | ||
ELSE () | ||
set(INCLUDE_DIR qrcodegen) | ||
ENDIF () | ||
set(SRC_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.c) | ||
set(LIBRARY_NAME_C qrcodegenc) | ||
set(HEADERS_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.h) | ||
|
||
add_library(${LIBRARY_NAME} ${SRC}) | ||
add_library(${LIBRARY_NAME_C} ${SRC_C}) | ||
set_target_properties(${LIBRARY_NAME_C} PROPERTIES PUBLIC_HEADER "${HEADERS_C}") | ||
install(TARGETS ${LIBRARY_NAME_C} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegenc) | ||
|
||
include(src/files.cmake) | ||
add_library(${LIBRARY_NAME} ${SRC}) | ||
set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") | ||
install(TARGETS ${LIBRARY_NAME} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/${INCLUDE_DIR}) | ||
install(TARGETS ${LIBRARY_NAME} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters