1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-23 05:10:09 +00:00
Laika/lib/CMakeLists.txt
CPunch 3316c77667 minor 'DEBUG' refactoring
- for debug builds, the LAIKA_DEBUG_BUILD macro will be defined in lconfig.h
- LAIKA_OBFUSCATE now controls the winobf IAT obfuscation as well
2022-10-05 20:36:49 -05:00

35 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.16)
set(LIB_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
project(LaikaLib VERSION ${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})
# Put CMake targets (ALL_BUILD/ZERO_CHECK) into a folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# compile LaikaLib library
file(GLOB_RECURSE LIBSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
file(GLOB_RECURSE LIBHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h)
# include platform specific backends
if(WIN32)
file(GLOB_RECURSE LIBPLATFORMSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/win/**.c)
elseif(UNIX AND NOT APPLE)
file(GLOB_RECURSE LIBPLATFORMSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/lin/**.c)
endif ()
add_library(LaikaLib STATIC ${LIBSOURCE} ${LIBHEADERS} ${LIBPLATFORMSOURCE})
target_link_libraries(LaikaLib PUBLIC sodium)
# make sure we're compiled *AFTER* lboxconfig.h has been generated
add_dependencies(LaikaLib VMBoxGen)
# add the version definitions
target_compile_definitions(LaikaLib PUBLIC)
# add include directory
target_include_directories(LaikaLib PUBLIC ${LIB_INCLUDEDIR} ${CMAKE_CURRENT_SOURCE_DIR}/libsodium/libsodium/src/libsodium/include)
# set library name
set_target_properties(LaikaLib PROPERTIES OUTPUT_NAME laika-${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})