From 7efb65a5c2fd5baff62702ddd580d6bdac089f8e Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 28 Mar 2010 13:31:19 +0000 Subject: [PATCH] Move to using cmake for VisualStudio --- CMakeLists.txt | 22 +- .../dispatchkit/proxy_functions.hpp | 2 +- msvc/chai-example/chai-example.vcproj | 197 ------------ msvc/chaiscript/Boost.vsprops | 19 -- msvc/chaiscript/chaiscript.sln | 32 -- msvc/chaiscript/chaiscript.vcproj | 286 ------------------ msvc/test_module/test_module.vcproj | 198 ------------ src/main.cpp | 2 + 8 files changed, 18 insertions(+), 740 deletions(-) delete mode 100644 msvc/chai-example/chai-example.vcproj delete mode 100644 msvc/chaiscript/Boost.vsprops delete mode 100644 msvc/chaiscript/chaiscript.sln delete mode 100644 msvc/chaiscript/chaiscript.vcproj delete mode 100644 msvc/test_module/test_module.vcproj diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2a67d..fa97c97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,26 +19,34 @@ else(READLINE_LIBRARY) SET (READLINE_FLAG ) endif(READLINE_LIBRARY) -SET (CMAKE_C_FLAGS_REL " -Wall -O3 ${READLINE_FLAG}") -SET (CMAKE_CXX_FLAGS_REL " -Wall -O3 ${READLINE_FLAG}") +#SET (CMAKE_C_FLAGS_REL " -Wall -O3 ${READLINE_FLAG}") +#SET (CMAKE_CXX_FLAGS_REL " -Wall -O3 ${READLINE_FLAG}") -SET (CMAKE_C_FLAGS " -Wall -ggdb ${READLINE_FLAG}") -SET (CMAKE_CXX_FLAGS " -Wall -ggdb ${READLINE_FLAG}") +#SET (CMAKE_C_FLAGS " -Wall -ggdb ${READLINE_FLAG}") +#SET (CMAKE_CXX_FLAGS " -Wall -ggdb ${READLINE_FLAG}") include_directories(include) +SET(Boost_ADDITIONAL_VERSIONS "1.42" "1.42.0" "1.41") +SET(Boost_USE_MULTITHREADED ON) + find_package(Boost 1.36.0 COMPONENTS thread) -if (NOT Boost_FOUND) +if (Boost_FOUND) + link_directories( ${Boost_LIBRARY_DIRS} ) +else() message(FATAL_ERROR "Can not find Boost") -endif(NOT Boost_FOUND) +endif(Boost_FOUND) +if (CMAKE_HOST_UNIX) + SET(DYNAMIC_LOADER "dl") +endif(CMAKE_HOST_UNIX) include_directories(${Boost_INCLUDE_DIRS}) add_executable(chaiscript_eval src/main.cpp) #add_executable(dispatchkit_test contrib/test/dispatchkit_test.cpp) -target_link_libraries(chaiscript_eval dl ${Boost_LIBRARIES} ${READLINE_LIB}) +target_link_libraries(chaiscript_eval ${DYNAMIC_LOADER} ${Boost_LIBRARIES} ${READLINE_LIB}) add_library(test MODULE src/test_module.cpp) target_link_libraries(test ${Boost_LIBRARIES}) diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp index dae5162..fc1e3d2 100644 --- a/include/chaiscript/dispatchkit/proxy_functions.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions.hpp @@ -443,7 +443,7 @@ namespace chaiscript if (bv.is_const()) { const Class *o = boxed_cast(bv); - return Handle_Return::type>::handle(o->*m_attr); + return Handle_Return::type>::handle(o->*m_attr); } else { Class *o = boxed_cast(bv); return Handle_Return::type>::handle(o->*m_attr); diff --git a/msvc/chai-example/chai-example.vcproj b/msvc/chai-example/chai-example.vcproj deleted file mode 100644 index 3e3e947..0000000 --- a/msvc/chai-example/chai-example.vcproj +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msvc/chaiscript/Boost.vsprops b/msvc/chaiscript/Boost.vsprops deleted file mode 100644 index aa7c744..0000000 --- a/msvc/chaiscript/Boost.vsprops +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/msvc/chaiscript/chaiscript.sln b/msvc/chaiscript/chaiscript.sln deleted file mode 100644 index 3df4595..0000000 --- a/msvc/chaiscript/chaiscript.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chaiscript", "chaiscript.vcproj", "{46FD9DC7-2DA9-4C17-ADE4-E3A18C46E87B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chai-example", "..\chai-example\chai-example.vcproj", "{CE422E94-B360-4588-8C65-6A9BE80798F9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_module", "..\test_module\test_module.vcproj", "{775EDCC2-102F-4E75-A860-9AF398D04145}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {46FD9DC7-2DA9-4C17-ADE4-E3A18C46E87B}.Debug|Win32.ActiveCfg = Debug|Win32 - {46FD9DC7-2DA9-4C17-ADE4-E3A18C46E87B}.Debug|Win32.Build.0 = Debug|Win32 - {46FD9DC7-2DA9-4C17-ADE4-E3A18C46E87B}.Release|Win32.ActiveCfg = Release|Win32 - {46FD9DC7-2DA9-4C17-ADE4-E3A18C46E87B}.Release|Win32.Build.0 = Release|Win32 - {CE422E94-B360-4588-8C65-6A9BE80798F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {CE422E94-B360-4588-8C65-6A9BE80798F9}.Debug|Win32.Build.0 = Debug|Win32 - {CE422E94-B360-4588-8C65-6A9BE80798F9}.Release|Win32.ActiveCfg = Release|Win32 - {CE422E94-B360-4588-8C65-6A9BE80798F9}.Release|Win32.Build.0 = Release|Win32 - {775EDCC2-102F-4E75-A860-9AF398D04145}.Debug|Win32.ActiveCfg = Debug|Win32 - {775EDCC2-102F-4E75-A860-9AF398D04145}.Debug|Win32.Build.0 = Debug|Win32 - {775EDCC2-102F-4E75-A860-9AF398D04145}.Release|Win32.ActiveCfg = Release|Win32 - {775EDCC2-102F-4E75-A860-9AF398D04145}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/msvc/chaiscript/chaiscript.vcproj b/msvc/chaiscript/chaiscript.vcproj deleted file mode 100644 index d92320b..0000000 --- a/msvc/chaiscript/chaiscript.vcproj +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msvc/test_module/test_module.vcproj b/msvc/test_module/test_module.vcproj deleted file mode 100644 index 9a616a1..0000000 --- a/msvc/test_module/test_module.vcproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main.cpp b/src/main.cpp index 878f9f1..cb180c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,8 @@ #include +#define _CRT_SECURE_NO_WARNINGS + #ifdef READLINE_AVAILABLE #include #include