|
@@ -14,9 +14,9 @@ set(EXE_C_SOURCE_FILES src/main.c src/pngio.c src/libs/argparse.c) |
|
|
set(LIB_C_HEADER_FILES src/apt.h) |
|
|
set(LIB_C_HEADER_FILES src/apt.h) |
|
|
|
|
|
|
|
|
# Link with static library for aptdec executable, so we don't need to set the path |
|
|
# Link with static library for aptdec executable, so we don't need to set the path |
|
|
add_library(libaptdecstatic STATIC ${LIB_C_SOURCE_FILES}) |
|
|
|
|
|
|
|
|
add_library(aptstatic STATIC ${LIB_C_SOURCE_FILES}) |
|
|
# Create shared library for 3rd party apps |
|
|
# Create shared library for 3rd party apps |
|
|
add_library(libaptdec SHARED ${LIB_C_SOURCE_FILES}) |
|
|
|
|
|
|
|
|
add_library(apt SHARED ${LIB_C_SOURCE_FILES}) |
|
|
|
|
|
|
|
|
add_compile_definitions(PALETTE_DIR="../palettes") |
|
|
add_compile_definitions(PALETTE_DIR="../palettes") |
|
|
|
|
|
|
|
@@ -26,7 +26,7 @@ if (PNG_FOUND AND LIBSNDFILE_FOUND) |
|
|
include_directories(${LIBSNDFILE_INCLUDE_DIR}) |
|
|
include_directories(${LIBSNDFILE_INCLUDE_DIR}) |
|
|
target_link_libraries(aptdec PRIVATE PNG::PNG) |
|
|
target_link_libraries(aptdec PRIVATE PNG::PNG) |
|
|
target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY}) |
|
|
target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY}) |
|
|
target_link_libraries(aptdec PRIVATE libaptdecstatic) |
|
|
|
|
|
|
|
|
target_link_libraries(aptdec PRIVATE aptstatic) |
|
|
if (MSVC) |
|
|
if (MSVC) |
|
|
target_compile_options(aptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1 /DAPT_API_STATIC) |
|
|
target_compile_options(aptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1 /DAPT_API_STATIC) |
|
|
else() |
|
|
else() |
|
@@ -41,20 +41,21 @@ if (PNG_FOUND AND LIBSNDFILE_FOUND) |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
else() |
|
|
else() |
|
|
MESSAGE(STATUS "WARNING: Only building libaptdec, as not all of the required libraries were found.") |
|
|
|
|
|
|
|
|
MESSAGE(STATUS "WARNING: Only building apt library, as not all of the required libraries were found for aptdec.") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
if (MSVC) |
|
|
if (MSVC) |
|
|
target_compile_options(libaptdec PRIVATE /D_CRT_SECURE_NO_WARNINGS=1 /DAPT_API_EXPORT) |
|
|
|
|
|
|
|
|
target_compile_options(apt PRIVATE /D_CRT_SECURE_NO_WARNINGS=1 /DAPT_API_EXPORT) |
|
|
|
|
|
target_compile_options(aptstatic PRIVATE /D_CRT_SECURE_NO_WARNINGS=1 /DAPT_API_STATIC) |
|
|
else() |
|
|
else() |
|
|
# Math |
|
|
# Math |
|
|
target_link_libraries(libaptdec PRIVATE m) |
|
|
|
|
|
target_link_libraries(libaptdecstatic PRIVATE m) |
|
|
|
|
|
|
|
|
target_link_libraries(apt PRIVATE m) |
|
|
|
|
|
target_link_libraries(aptstatic PRIVATE m) |
|
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Release") |
|
|
if(CMAKE_BUILD_TYPE MATCHES "Release") |
|
|
target_compile_options(libaptdec PRIVATE -Wall -Wextra -pedantic -Wno-missing-field-initializers -Werror) |
|
|
|
|
|
|
|
|
target_compile_options(apt PRIVATE -Wall -Wextra -pedantic -Wno-missing-field-initializers -Werror) |
|
|
else() |
|
|
else() |
|
|
target_compile_options(libaptdec PRIVATE -Wall -Wextra -pedantic) |
|
|
|
|
|
|
|
|
target_compile_options(apt PRIVATE -Wall -Wextra -pedantic) |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
@@ -79,7 +80,7 @@ IF(NOT WIN32) |
|
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") |
|
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
install(TARGETS libaptdec LIBRARY DESTINATION lib) |
|
|
|
|
|
|
|
|
install(TARGETS apt LIBRARY DESTINATION lib) |
|
|
install(FILES ${LIB_C_HEADER_FILES} DESTINATION include/apt ) |
|
|
install(FILES ${LIB_C_HEADER_FILES} DESTINATION include/apt ) |
|
|
else() |
|
|
else() |
|
|
#set(CPACK_GENERATOR "ZIP;NSIS") |
|
|
#set(CPACK_GENERATOR "ZIP;NSIS") |
|
@@ -91,7 +92,7 @@ else() |
|
|
file(GLOB_RECURSE DLLS *.dll) |
|
|
file(GLOB_RECURSE DLLS *.dll) |
|
|
install(FILES ${DLLS} DESTINATION "bin/") |
|
|
install(FILES ${DLLS} DESTINATION "bin/") |
|
|
endif() |
|
|
endif() |
|
|
install(TARGETS libaptdec DESTINATION "bin/") |
|
|
|
|
|
|
|
|
install(TARGETS apt DESTINATION "bin/") |
|
|
install(FILES ${LIB_C_HEADER_FILES} DESTINATION include/apt ) |
|
|
install(FILES ${LIB_C_HEADER_FILES} DESTINATION include/apt ) |
|
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") |
|
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/") |
|
|
endif() |
|
|
endif() |
|
|