Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# If Lua is installed in a non-standard location, please set the LUA_DIR
# environment variable to point to prefix for the install. Eg:
# Unix: export LUA_DIR=/home/user/pkg
# Windows: set LUA_DIR=c:\lua51
# Windows: set LUA_DIR=c:\lua54

project(lua-cjson C)
cmake_minimum_required(VERSION 2.6)

project(lua-cjson C)

option(USE_INTERNAL_FPCONV "Use internal strtod() / g_fmt() code for performance")
option(MULTIPLE_THREADS "Support multi-threaded apps with internal fpconv - recommended" ON)

Expand All @@ -15,7 +16,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

find_package(Lua51 REQUIRED)
find_package(Lua 5.4 REQUIRED)
include_directories(${LUA_INCLUDE_DIR})

if(NOT USE_INTERNAL_FPCONV)
Expand Down Expand Up @@ -65,7 +66,7 @@ if(WIN32)
# Windows sprintf()/strtod() handle NaN/inf differently. Not supported.
add_definitions(-DDISABLE_INVALID_NUMBERS)
else()
set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
set(_lua_module_dir "${_lua_lib_dir}/lua/5.4")
endif()

if(MSVC)
Expand All @@ -75,7 +76,7 @@ if(MSVC)
add_definitions(-Dstrncasecmp=_strnicmp)
endif()

add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES})
add_library(cjson STATIC lua_cjson.c strbuf.c ${FPCONV_SOURCES})
set_target_properties(cjson PROPERTIES PREFIX "")
target_link_libraries(cjson ${_MODULE_LINK})
install(TARGETS cjson DESTINATION "${_lua_module_dir}")
Expand Down