Commit 41c80e9c authored by Ahmed Charles's avatar Ahmed Charles Committed by Joshua Warner

Fix cmake build.

parent c2e48e4d
......@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -std=c++11")
if(EXISTS "${dir}" AND IS_DIRECTORY "${dir}")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest" AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/gtest")
add_subdirectory(gtest)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gtest/include)
else()
......@@ -12,4 +12,4 @@ endif()
include(CTest)
add_subdirectory(src)
\ No newline at end of file
add_subdirectory(src)
......@@ -75,11 +75,10 @@ add_executable(capnp-tool
)
target_link_libraries(capnp-tool capnpc capnp kj)
add_executable(capnp-c++
add_executable(capnpc-c++
capnp/compiler/capnpc-c++.c++
)
target_link_libraries(capnp-c++ capnp kj)
get_property(capnp-c++_location TARGET capnp-c++ PROPERTY LOCATION)
target_link_libraries(capnpc-c++ capnp kj)
set(test_capnp_files
capnp/test.capnp
......@@ -106,11 +105,11 @@ add_custom_command(
${test_capnp_cpp_files}
${test_capnp_header_files}
COMMAND capnp-tool compile
-o ${capnp-c++_location}
-o $<TARGET_FILE:capnpc-c++>
--src-prefix=${CMAKE_CURRENT_SOURCE_DIR}
-I${CMAKE_CURRENT_SOURCE_DIR}
${test_capnp_capnp_files}
DEPENDS capnp-tool capnp-c++ ${test_capnp_files})
DEPENDS capnp-tool capnpc-c++ ${test_capnp_files})
add_library(capnp_test_lib ${test_capnp_cpp_files})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment