2020-12-22 18:10:01 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(libimhex)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
2020-12-27 14:12:53 +01:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/ImGui ${CMAKE_CURRENT_BINARY_DIR}/external/ImGui)
|
2021-01-11 21:51:52 +01:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/nlohmann_json ${CMAKE_CURRENT_BINARY_DIR}/external/nlohmann_json)
|
2021-02-22 23:36:13 +01:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../external/nativefiledialog ${CMAKE_CURRENT_BINARY_DIR}/external/nativefiledialog)
|
2021-01-11 21:51:52 +01:00
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
|
2021-01-06 19:19:01 +01:00
|
|
|
if (WIN32)
|
2021-02-26 17:29:57 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
|
2021-01-06 19:19:01 +01:00
|
|
|
endif()
|
2020-12-22 18:10:01 +01:00
|
|
|
|
2021-01-12 23:28:41 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
|
|
|
|
2021-01-12 23:49:51 +01:00
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
|
|
|
|
2021-01-12 23:28:41 +01:00
|
|
|
add_library(libimhex SHARED
|
2021-01-13 17:28:27 +01:00
|
|
|
source/api/event.cpp
|
2021-01-20 20:16:24 +01:00
|
|
|
source/api/imhex_api.cpp
|
2021-01-13 17:28:27 +01:00
|
|
|
source/api/content_registry.cpp
|
2021-02-03 11:54:41 +01:00
|
|
|
|
2020-12-27 14:12:53 +01:00
|
|
|
source/helpers/utils.cpp
|
2021-01-12 23:28:41 +01:00
|
|
|
source/helpers/shared_data.cpp
|
2021-02-03 11:54:41 +01:00
|
|
|
source/helpers/crypto.cpp
|
2021-02-10 18:17:09 +01:00
|
|
|
source/helpers/lang.cpp
|
2020-12-27 14:12:53 +01:00
|
|
|
|
2021-01-22 18:01:39 +01:00
|
|
|
source/lang/pattern_language.cpp
|
2021-01-11 23:54:12 +01:00
|
|
|
source/lang/preprocessor.cpp
|
|
|
|
source/lang/lexer.cpp
|
|
|
|
source/lang/parser.cpp
|
|
|
|
source/lang/validator.cpp
|
|
|
|
source/lang/evaluator.cpp
|
|
|
|
source/lang/builtin_functions.cpp
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
source/providers/provider.cpp
|
2020-12-27 14:12:53 +01:00
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
source/views/view.cpp
|
2020-12-27 14:12:53 +01:00
|
|
|
)
|
2020-12-22 18:10:01 +01:00
|
|
|
|
2021-02-07 22:57:34 +01:00
|
|
|
target_include_directories(libimhex PUBLIC include ${MBEDTLS_INCLUDE_DIR})
|
|
|
|
target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR})
|
2021-02-03 11:54:41 +01:00
|
|
|
|
|
|
|
if (WIN32)
|
2021-02-22 23:36:13 +01:00
|
|
|
target_link_libraries(libimhex PUBLIC imgui nlohmann_json libmbedcrypto.a nfd)
|
2021-02-03 11:54:41 +01:00
|
|
|
else ()
|
2021-02-22 23:36:13 +01:00
|
|
|
target_link_libraries(libimhex PUBLIC imgui nlohmann_json mbedcrypto nfd)
|
2021-02-03 11:54:41 +01:00
|
|
|
endif ()
|