Skip to content

Cmake simplifications #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 2 additions & 8 deletions reformatter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
# set up a paths
SET (binDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/bin)

# create a directories
FILE(MAKE_DIRECTORY ${binDir})

SET (SRCS json_reformat.c)

# use the library we build, duh.
Expand All @@ -34,10 +31,7 @@ IF (NOT WIN32)
TARGET_LINK_LIBRARIES(json_reformat m)
ENDIF (NOT WIN32)

# copy the binary into the output directory
GET_TARGET_PROPERTY(binPath json_reformat LOCATION)

ADD_CUSTOM_COMMAND(TARGET json_reformat POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir})
SET_TARGET_PROPERTIES(json_reformat PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${binDir})

INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin)
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ CONFIGURE_FILE(yajl.pc.cmake ${shareDir}/yajl.pc)
# copy public headers to output directory
FOREACH (header ${PUB_HDRS})
SET (header ${CMAKE_CURRENT_SOURCE_DIR}/${header})
GET_FILENAME_COMPONENT(headerName ${header} NAME)

EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different ${header} ${incDir})
CONFIGURE_FILE(${header} ${incDir}/${headerName} COPYONLY)

ADD_CUSTOM_COMMAND(TARGET yajl_s POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${incDir})
Expand Down
10 changes: 2 additions & 8 deletions verify/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
# set up some paths
SET (binDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/bin)

# create some directories
FILE(MAKE_DIRECTORY ${binDir})

SET (SRCS json_verify.c)

# use the library we build, duh.
Expand All @@ -28,10 +25,7 @@ ADD_EXECUTABLE(json_verify ${SRCS})

TARGET_LINK_LIBRARIES(json_verify yajl_s)

# copy in the binary
GET_TARGET_PROPERTY(binPath json_verify LOCATION)

ADD_CUSTOM_COMMAND(TARGET json_verify POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir})
SET_TARGET_PROPERTIES(json_verify PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${binDir})

INSTALL(TARGETS json_verify RUNTIME DESTINATION bin)